04-03-2013 05:59 AM
I have labview 2012 base development system SP1 and have downloaded the modbus vi library.
I want to use labview to read holding registers on a Eurotherm 5100 series recorder using modbus TCP but can't get a response.
The recorder address is: 192.168.000.107 and has a unit ID: 1
As an example I wish to send the following query:
The function code is: 03, and start address is :031F and the data is held in 10 registers.
According to the Eurotherm manual, I should sent the following request: 0000000000060003031F000A (in hex)
and expect the following reply: 0000000000170003144368616E6E656C20352044657363726970746F72 (in hex)
I do not know if the recorder is receiving the correct data or whether it is not sending or I am not receiving a response.
I know that the recorder is working as it is can communicate with other software on the PC that uses modbus.
Can anyone help?
04-03-2013 06:53 AM
ikna wrote:
I do not know if the recorder is receiving the correct data or whether it is not sending or I am not receiving a response.
Hi!
What's the error you get from the modbus vi?
A low level approach could be to install a sniffer (e.g. Wireshark) and see the packets sent by the software (the one communicating succesfully).
You can compare them with the packets sent by your vi and debug you application.
Regards,
Marco
04-03-2013 08:55 AM
Thanks for the reply Marco,
The error message is:
'Error 56 occured at TCP read in MB Ethernet Receiver.vi:2-> Master Query.vi:1->MB Ethernet Master Query Read Input egister (poly).vi->modbus 1.vi'.
Regards
ikna
04-03-2013 09:13 AM
Error 56 is a timeout error (http://digital.ni.com/public.nsf/allkb/D90C4F99C1EF3F6A86256E4A0080A120).
So you didn't get a response.
I'd suggest using Wireshark to check what's happening.
(are you using the TCP master example provided by NI?)
Regards,
Marco
04-05-2013 03:44 AM
Marco
Thanks for your help.
Wireshark identified the problem, which was resolved by changing the 'Unit ID tab' on the 'MPAB Header' in the 'Read Holding Regiters vi'.
Thanks again
IKNA
04-05-2013 03:47 AM
Good to hear that!
If you want you can mark the topic as solved and give Kudos 😉
Marco