LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus serial communication

Solved!
Go to solution

Hi everyone,

 

I am trying to read holding registers from a USB RS485  which is connected to a current transducer with ASCII based control. I keep getting "Error 56 occurred at ASCII Data Unit.lvclass:Read ADU Packet.vi:5030001". I believe I have correctly configured by serial port because I can write without any error in VISA test panel; however, I get the same timeout error when trying to query, read, and read status byte.

 

Can anyone help solve this error? I am very new to modbus and would appreciate any help.

 

Thanks

0 Kudos
Message 1 of 5
(2,715 Views)

Do you have documentation for your transducer that gives the port settings, unit ID, and Modbus addresses to use? In particular I'm curious if parity is actually supposed to be set to "none". Also, it's usually not necessary to use VISA Configure Serial Port before the Modbus Create Serial Master.vi, because the latter will take care of configuring the port.

0 Kudos
Message 2 of 5
(2,698 Views)

Here is the spec page for my transducer. Thanks for the tip on the VISA configure.

0 Kudos
Message 3 of 5
(2,695 Views)

Here is the supplemental Modbus information and ASCII programming guide also.

Thanks

0 Kudos
Message 4 of 5
(2,680 Views)
Solution
Accepted by topic author cml0715

It looks from your Modbus documentation that you're right to select "none" for parity (what the manual calls "check bit"). However, the Modbus format needs to be set for "RTU" instead of "ASCII", though strangely the only place this is stated is on the front cover. You also should note that address 20 (decimal) that you have entered is the same as address 0x14 (hex), and so trying to read 20 registers starting at that address will read beyond the range of valid addresses and might result in the transducer returning an error. I would try reading just one register at first.

 

I forgot to ask, is your transducer the Modbus version, or the standard ASCII version? It looks from the datasheet like the Modbus version has an "M" at the end of the part number.

0 Kudos
Message 5 of 5
(2,663 Views)