6.2.- MODBUS PROTOCOL
In the Modbus protocol, the DHC-96 device uses the RTU (Remote Terminal Unit) mode.
The Modbus functions implemented in the device are as follows:
Function 0x01: Reading a relay.
Function 0x02: Reading input status.
Function 0x03 and 0x04: Reading integer registers.
Function 0x05: Writing a relay.
Function 0x0F: Writing multiples relays
Function 0x10: Writing multiples registers.
6�2�1� READING EXAMPLE : FUNCTION 0x01�
Question: Status of output relays
Address Function
Initial
Register
No� of
Registers
CRC
01 01 0000 0002 BDCB
Address: 01, Peripheral number: 1 in decimal.
Function: 01, Read function.
Initial Register: 0000, on which the reading will start.
No� of Registers: 0002, number of registers read.
CRC: BDCB, CRC Character.
Response:
Address Function
No� of
Bytes
Register
No� 1
CRC
01 01 01 03 1189
Address: 01, Responding peripheral number: 1 in decimal.
Function: 01, Read function.
No� of bytes: 01, No. of bytes received.
Registre: 03, in binary it is: 0000 0011, output relays 1 and 2 closed.
CRC:1189, CRC.Character.
6�2�2� EXAMPLE OF OPERATION OF THE REMOTE CONTROL: FUNCTION 0X05�
Question: Activate the output of relay 1, programmed to work in remote control mode.
Address Function
Initial
Register
Relay action CRC
01 05 0000 FF00 8C3A
Address: 01, Peripheral number: 1 in decimal.
Function: 05, Writing a relay
Initial Register: 0000, relay 1 address.
Relay action: FF00, We indicate that we want to close the relay.
CRC: 8C3A, CRC.Character.
33
Instruction Manual
DHC-96 Aac