Descargar Imprimir esta página

S&P CAD-REG Manual página 37

Publicidad

Idiomas disponibles

Idiomas disponibles

7. MODBUS REGISTERS
COMMUNICATIONS PROTOCOL OF CAD-REG CONTROL REGULATOR
The protocol used is MODBUS RTU mode with the following characteristics: RS-485 (2 wire). Maximum number of items
on the bus: 32 (1 master + 31 slaves).
• Communication speed: 9600 baud.
• Data Format:
− 8 bit.
− No parity.
− 1 stop bit.
• Registers of 16 bits (2 bytes).
Variable format: High Word First (H/L).
• CRC according to polynomial x16 + x15 + x2 + 1.
Note: It is advisable to perform retries in the communications. Timeout: 1 sec.
Note: Minimum time wait to send recommended: 100 ms.
REGISTERS READING
For reading registers, it is possible to use command codes 3 or 4 with the following message structure:
Slave No. (1 byte) - Code (03 or 04) (1 byte) - Address of the 1st record to be read (00-XX) (2 bytes) - Number of
registers to read (00-YY) (2 bytes) - CRC16 (2 bytes)
Maximum number of registers to read in the same message = 32 (from register 0 to register 31)
The controller answer has the following message structure:
Slave No. (1 byte) - Code (03 or 04) (1 byte) - Number of data bytes (XX) (1 byte) - Data (AA-BB-CC-DD...) (2 bytes-
for each register) - CRC16 (2 bytes)
Number of data bytes = 2 * Number of registers to read
REGISTERS WRITING
For the writing of the registers the command code 6 is used with the following message structure:
Slave number (1 byte)-Code (06) (1 byte)- Address of the register to be written (00-XX) (2 bytes)- Data to be wri-
tten in the register (AA-BB) (2 bytes)- CRC16 (12 bytes)
The response of the control unit has the following message structure:
Slave number (1 byte)- code (06) (1 byte)- CRC16 (2 bytes)
ERRORS
If it is used a code different than the reading or writing , the answer received is:
Slave number - OR code 80Hex - Error code (1) - CRC16 (2 bytes)
If you try to access a register with a non-existent address in read or write, the answer you receive is:
Slave number - OR code 80Hex - Error code (2) - CRC16 (2 bytes)
If you try to write to a read-only register or you try to write an illegal value to a register, the answer you receive is:
Slave number - OR code 80Hex - Error code (3) - CRC16 (2 bytes)
REGISTERS MAP
The unused bits of the following registers are 0.
Note: In some communications programs, the fi rst word address is set to 400001, which means thatthe register 0 of the
regulator corresponds to the word address 400001. In summary, the word address to whichcorresponds each register of
the regulator is calculated by adding 1 to the registration number of the register map described below.
EN
37

Publicidad

loading