12/90
User manual SCAIME:
NU-Soft-eNod4F-E-0716_235704-C.doc
3
MODBUS RTU
3.1
Physical interfaces
Modbus RTU communication protocol can be used either through
eNod4
USB port, AUX port. Modbus RTU or Profibus
only depending on version on DB9 connection.
USB port behaves as a full duplex interface whereas the DB9 and AUX ports support half-duplex RS485
communication. Supported baud rates are 9600, 19200, 38400, 57600, and 115200.
For a complete description of the recommendations about
eNod4
RS485 connection, please refer to the user manual
“characteristics and functioning” of the
eNod4
.
Note:
using
eNod4
through USB requires installing first the necessary USB drivers available on the website
3.2
Byte format
Data transmitted to
eNod4
thanks to Modbus RTU communication protocol must respect following format:
•
1 start bit
•
8 data bits
•
no parity
•
2 stop bits
Every Modbus RTU frame is ended by a CRC-16 2-bytes code whose polynomial generator is
(cf. CRC-16 calculation algorithm).
3.3
Modbus RTU supported functions
As a Modbus RTU slave,
eNod4
supports following Modbus RTU functions:
Function
Code
read N registers*
03
H
/ 04
H
write 1 register*
06
H
write N registers*
10
H
* 1 register = 2 bytes, maximum admitted value for N is 30.
Note
: Broadcast addressing is not allowed by
eNod4
.
3.4
Frames structure
During a read or write transaction, the two bytes of a register are transmitted MSB first then LSB.
If a data is coded on
4 bytes
(that means it requires two registers),
the two LSB are stored in the low address register
and the two MSB are stored in the high address register.
3.4.1
Function (03H/04H)
–
read N input registers (N = 30 max)
•
request command sent to the slave :
slave address
03
H
or 04
H
starting register
offset
N registers
CRC16
1 byte
1 byte
2 bytes
2 bytes
2 bytes
•
slave response :
slave address
03
H
or 04
H
NB *
data 1
…
CRC16
1 byte
1 byte
1 byte
2 bytes
2 bytes
2 bytes
* NB: number of read bytes (= N*2)
3.4.2
Function (06H)
–
write single register
•
request command sent to the slave :
slave address
06
H
register offset
data
CRC16
1 byte
1 byte
2 bytes
2 bytes
2 bytes
G(x) = x
16
+ x
15
+ x
2
+ 1