Overview
MODBUS Protocol is a messaging structure, widely used to establish master-slave communication between intelligent devices. A MODBUS message sent from a master to a slave contains the address of the slave, the 'command' (e.g. 'read register' or 'write register'), the data, and a check sum (LRC or CRC).
Since Modbus protocol is just a messaging structure, it is independent of the underlying physical layer. In AMB-4I-4O is implemented using RS485 interface.
MODBUS RTU Framing
The AMB-4I-4O module supports standard RTU Modbus protocol for getting the input status and setting/getting the relays status. RTU Modbus Protocol frame is illustrated below:
Start | Address | Function | Data | CRC Check | End |
---|---|---|---|---|---|
≥ 3.5 Char | 8 Bits | 8 Bits | N*8 Bits | 16 Bits | ≥ 3.5 Char |
- Start is at least 3.5 char time of silent interval between master and slave to start communication
- Address is a slave ID Address
- Function is the function code of MODBUS protocol
- Data is the appropriate data for function code
- CRC is Cyclic Redundancy Check for Error Checking (here, CRC-16,Big Endian(ABCD))
- End is at least 3.5 char time of silent interval between master and slave to start communication
MODBUS Serial Port Parameter
Parameter | Option/range |
---|---|
Baudrate | 9600 – 128000 configurable |
Data bit | 8 |
Parity | None |
Stop bit | 1 |
ID Configuration of MODBUS Card
User can set the slave ID address using 8 Bit DIP switch found on board. This allow 0 to 255 different IDs to be set. The number below the switches are added together and the result will be identifier of the device slave ID.
To set the slave ID 125, you need to turn ON switch 1,3,4,5,6,7 on DIP switch and OFF the others (In this, convert slave ID number 125 into 8bit binary form – 01111101, turn ON DIP switch 1,3,4,5,6,7 and turn OFF DIP switch 2,8) and so on….
Baudrate Configuration of MODBUS
User can set the baudrate using 4 Bit DIP switch found on board. To set baudrate, first turn off power supply of card. This allows to set baudrate between 2400bps to 128000bps as shown below table.
Baudrate | SW1 | SW2 | SW3 | SW4 |
---|---|---|---|---|
9600 | OFF | OFF | OFF | OFF |
2400 | ON | OFF | OFF | OFF |
4800 | OFF | ON | OFF | OFF |
14400 | OFF | OFF | ON | OFF |
19200 | OFF | OFF | OFF | ON |
28800 | ON | ON | OFF | OFF |
38400 | OFF | ON | ON | OFF |
57600 | OFF | OFF | ON | ON |
115200 | ON | OFF | OFF | ON |
128000 | ON | ON | ON | ON |