Quantcast
Channel: All LabVIEW posts
Viewing all articles
Browse latest Browse all 203311

Re: Modbus - Issues with Reading Holding Registers

$
0
0

As Dennis said, use the NI Modbus library.

 

The problem with your command structure is you forgot to append the checksum to the end.

 

There is another possible problem.  What are you using as the RS-485 port on your PC?  I know that some (many?  all?) NI brand RS-485 ports need special treatment when you use 2-wire mode.  One thing you may need to do is jumper the RX and TX pins (assuming that the port is also configurable for 4 wire RS-485).  It's possible that the port has jumpers that will do this for you automatically.  The other thing is that depending on the nature of the serial port, you might get back an echo of your outgoing command since the receiving pins may be getting a copy of the message that the transmit pins are sending out.  RS-485 ports I've used account for that by disabling the receive pins when it is in transmit mode.  But not all ports might do that.

 

Search the NI.com website for "2 wire RS-485" for some articles discussing how NI handles its RS-485 ports.


Viewing all articles
Browse latest Browse all 203311


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>