52
CVM-C4
Instruction Manual
7�2�- MODBUS PROTOCOL
In the Modbus protocol, the
CVM-C4
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 multiple relays.
Function 0x10
: Writing multiple registers.
7�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
, register on which you want the reading to start.
Nº of registers: 0002
, number of registers to 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.
Register: 03
, in binary it is: 0000 0011, output relays 1 and 2 closed.
CRC: 1189
, CRC character.
7�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.