Problem reading Serial Port C#.net 2.0 to get Weighing machine output

China☆狼群 提交于 2019-12-01 01:54:32

I know this is probably old now ... but for future reference ...

Look at the handshaking. There is both hardware handshaking and software handshaking. Your problem could be either - so you need to try both.

For hardware handshaking you can try:

        mySerialPort.DtrEnable = True
        mySerialPort.RtsEnable = True

Note that

        mySerialPort.Handshake = Handshake.RequestToSend

I do not think sets the DTR line which some serial devices might require

Software handshaking is also known as XON/XOFF and can be set with

        mySerialPort.Handshake = Handshake.XOnXOff

OR

        mySerialPort.Handshake = Handshake.RequestToSendXOnXOff

You may still need to enable DTR

When all else fails - dont forget to check all of these combinations of handshaking.

Since someone else will probably have trouble with this in the future, hand shaking is a selectable option.

In most of the balances you will see the options for Software, Hardware 2 char, Hardware 1 char. The default setting for the Sartorius balances is Hardware 2 Char. I usually recommend changing to Software.

Also if it stops working all together it can often be fixed by defaulting the unit using the 9 1 1 parameter. And then resetting the communication settings.

An example of how to change the settings can be found on the manual on this page:

http://www.dataweigh.com/products/sartorius/cpa-analytical-balances/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!