Communication
2.3 Modbus communication
SIMOCODE pro - Communication
100
Function Manual, 11/2018, A5E40508495002A/RS-AC/003
Function codes 01 - Read Coils and 02 - Read Discrete Inputs
Function
These functions enable the Modbus master system to read individual bits from the
SIMOCODE pro bit memory area.
Functions codes 01 and 02 behave in the same way here and supply an identical feedback
signal. A valid offset from the bit memory area is expected as the start address. Up to
2000 bits can be read per frame.
If a number that is not equal to a multiple of eight bits is called up, the remaining bits are
filled with zeros. The number of bytes n always refers to the number of fully returned bytes.
Note
Start address and number of coils
The start address and the number of coils must be within the valid range.
Request message frame
Slave address
Function code
Start address
Number of bits
CRC
1 byte
1 byte
2 bytes
2 bytes
2 bytes
Response message frame
Slave address
Function code
Number of bytes n Bit status
CRC
1 byte
1 byte
1 byte
n bytes
2 bytes
Example
Reading in of the SIMOCODE pro device statuses from slave number 16. The device
statuses start from offset 0x1C08 and are 16 bits in length.
Request message frame
Slave address
Function code
Start address
Number of bits
CRC
1 byte
1 byte
2 bytes
2 bytes
2 bytes
0x10
0x01
0x1C08
0x000F
0x....
Response message frame
Slave address
Function code
Number of bytes n Bit status
CRC
1 byte
1 byte
1 byte
2 bytes
2 bytes
0x10
0x01
0x02
0x3C08
0x....