LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with Modbus.vi to read holding registers on Eurotherm recorder

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?

0 Kudos
Message 1 of 6
(3,670 Views)

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

 

 

Message 2 of 6
(3,658 Views)

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

0 Kudos
Message 3 of 6
(3,650 Views)

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

Message 4 of 6
(3,641 Views)

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

0 Kudos
Message 5 of 6
(3,617 Views)

Good to hear that!

If you want you can mark the topic as solved and give Kudos 😉

 

Marco

Message 6 of 6
(3,614 Views)