IoT News
IoT Applications

Industrial Ethernet Remote I/O Module Application, Example of reading registers of the input coil of this device

Views : 3976
Author : Jeakie
Update time : 2023-03-09 10:13:21

Example of reading and writing registers

For example:M series device 485 is used as a slave, we can use other host software or host device to read (or write commands) the value of the data point of the local device. Moreover, the network port of the device can also be used as a master, adding other slaves to the mapping register through the Modbus TCP protocol.

Read the input coil of this device

Master Send Data Format:

Receiver Return Data Format:

Example: Query 16 DIN data of this device at the same time, then:

Server send: 01 02 00 00 00 10 79 C6

01= Device address;

02= Query DIN status command;

00 00=DIN starting address;

00 10 = Continuously read 16 DIN states;

BD D9= CRC verify.

Device answer: 01 02 02 03 90 B9 24

01= Device address;

02= Query DIN status command;

02= Return Byte Length;

03 90= DIN status, each bit represents a DIN status, 0 represents open, 1 represents closed; the first byte 03H is converted into binary: 0000 0011, corresponding to DIN1-DIN8 status from low to high; the second byte 90H is converted into binary: 1001 0000, corresponding to 

B9 24 =CRC verify.

If you want to query certain DIN statuses, you only need to change the "register starting address" and "read register number", recalculate the CRC check, and the returned data is analyzed as described above.

More information view:

Related News