ModBUS Communication Protocol v2 - 5 GB
ModBUS Communication Protocol v2 - 5 GB
to DIXELL devices.
1. COMMANDS DESCRIPTION
1.1 READ HOLDING REGISTERS (0X03):
The command has the following format:
Slave Address: Defined the device address that received the answer of reading data.
Number of Registers: Defines the number of Elements (Register) that the device has to return (es. 3 =
3 Registers). No more than 5 Elements allowed.
CRC : Defined the CRC calculated for the frame data received and has to be used to verify the integrity
of data received. It is calculated
Slave Address: Defined the device address that received the answer of reading data.
CRC : Defined the CRC calculated for the frame data received and has to be used to verify the integrity
of data received. It is calculated
The answer message is an Eco of the command you sent (it has the same format)
Slave Function Register Register Number Number NumByte DATA CRC CRC
address Code Address Address of of (LSByte) (MSByte)
(MSByte) (LSByte) Registers Registers
(MSByte) (LSByte)
Slave Address: Defined the device address that received the answer of writing data.
Number of Registers. : Defines the number of registers to write to. No more than 5 Elements allowed.
NumByte: Defined the number of bytes followed without CRC. The number of bytes has to be double
respect the number of addressed Elements (NumByte = 2*Nreg).
CRC:
Defined the CRC calculated for the frame data received and has to be used to verify the integrity of data
received.
XJ500 system, when linking by means of RS232 port and ModBUS protocol, RTS and DTR signals have to be kept
at logical level LOW.
√ Slave addresses:
This field range is 1-247. Address 0 is used for the broadcast address. In this case the slave execute the command
( only Write Holding Register command) but doesn’t return some response
√ Exceptions code:
Dixell’s devices answers with exception codes when they are not able to execute the last command received. The
exception configuration is:
The CRC value is calculated (on the entire message) by the transmitting device, which appends the CRC to the
message. The receiving device recalculates a CRC during receipt of the message and compares the calculated
value to the actual value it received in the CRC field. If the two values are not equal, an error results.
Here there is the code (in C format) to generate CRC.
For(CntByte=0;CntByte<LenFrame;CntByte++)
{
CRC ^= Frame[CntByte];
for(j=0;j<8;j++)
{
bitVal = CRC & 0x0001;
CRC = CRC >> 1;
if(bitVal == 1)
CRC ^= MODBUS_GENERATOR;
}
}
}
√ NOTE:
To uniform interpretation mode of data, all data areas will have the following format:
2. REGISTRY ADDRESSES
In this section are reported the registry addresses to consider when acting directly with the controllers (If the device
is connected to an XJ500 this last have to be set in “Transparent Mode”, see next page).
Device’s address represent the “Slave address” to be set in the command structure while the “number of registers”
is always 1 (see command description).
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Integer value “120” – [range (0-999) (1000 is null value)] (ASCII code char “C”) -hex(20)
In order to enable a function (device ON.OFF, defrost, etc..), you have to set the relevant bit of the MSByte to 1
(enable) or to 0 (disable). The writing of the status bit is allowed only when the relative bit of the LSByte is set to 1.
TABLE 4 : ALARMS
Register 3328 ALARMS LIST I°
MSByte LSByte
bit0 Load 9 alarm bit0 Load 1 alarm
Bit1 Load 10 alarm bit1 Load 2 alarm
bit2 Load 11 alarm bit2 Load 3 alarm
bit3 Door open or liquid level alarm bit3 Load 4 alarm
bit4 Generic Digital input alarm bit4 Load 5 alarm
bit5 Real Time clock alarm bit5 Load 6 alarm
bit6 Bit6 Load 7 alarm
bit7 Bit7 Load 8 alarm
The following section state the registry addresses to consider when reading information about controllers
connected to an XJ500.
XJ500 System ID represent the “Slave address” to be set in the command structure. The registry address is 12800
+ Adr parameter of the instrument you want to read. The “number of register” to read will give you back information
desired following the table below:
EXAMPLE: we want to read the device label of a controller (with address 5) connected to an XJ500 (whose “System
ID” is 0002). The structure of the reading command will be the following (please reefer to page 2):
The following section state the registry addresses to consider when reading information about controllers
connected to an XJ500.
XJ500 System ID represent the “Slave address” to be set in the command structure. The registry address is 13056
+ Adr parameter of the instrument you want to read. The “number of register” to read will give you back information
desired following the table below:
EXAMPLE: we want to read probe 2 value of a controller (with address 12) connected to an XJ500 (whose “System
ID” is 0001). The structure of the reading command will be the following (please reefer to page 2):
(*) for each status byte, if bit 6=1 the probe resolution is decimal