From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus RTU Command Via TCPIP and Receive The Holding Register Value

I have connected Energy Meter with Modbus to Ethernet Conveter Via RS485. My Slave Id:1. Mode: RTU. I want to read holdig register values from 3911 to 3920. I have formatted the modbus command and write to tcp write and read the value from TCP read. I have getting invalid values while decoding. 

 

Please provide your suggestion.

 

Download All
0 Kudos
Message 1 of 2
(4,300 Views)

Hi,

 

If I am right you are sending serial ModBus data to the TCP link and you don't handle the received data correctly.

You also are using the wrong port. Default port 502 is used for ModBus TCP.

Here is an example how it could be done. Data in is the loopback command.

 

Data out is the TCP data without the slave address and CRC of the serial data

 

Kees

0 Kudos
Message 2 of 2
(4,252 Views)