COMMERCIAL IN CONFIDENCE
Page 12
2.4.3
Force Single Coil (write single bit)
Byte No
Meaning
Value (hex)
1
Slave address
xx
2
ModBus Function code (force coil)
05
3
Starting Address MSB, always 00, all bits are in internal
memory
00
4
Starting Address LSB
xx
5
Force Data MSB (FF sets the bit, 00 clears it)
FF or 00
6
Force Data LSB (always 00)
00
7
CRC lo byte
??
8
CRC hi byte
??
An error response code 2 (illegal address) will be returned if the bit is not a valid writeable bit,
otherwise the response is the same as the above message.
2.4.4
Preset Single Register
Byte No
Meaning
Value (hex)
1
Slave address
xx
2
ModBus Function code (write register)
06
3
Starting Address MSB
xx
4
Starting Address LSB
xx
5
Data MSB
xx
6
Data LSB
xx
7
CRC lo byte
??
8
CRC hi byte
??
The normal response is the same as the message. An error response code 2 (illegal address)
will be returned if the address is not within the processor bounds.
2.4.5
Preset Multiple Registers
Byte No
Meaning
Value (hex)
1
Slave address
xx
2
ModBus Function code (write register)
10
3
Starting Address MSB
xx
4
Starting Address LSB
xx
5
Number of registers MSB
00
6
Number of registers LSB
01
7
Number of bytes to follow
02
8
Data MSB
xx
9
Data LSB
xx
10
CRC lo byte
??
11
CRC hi byte
??
note that this function is a subset of the normal ModBus function code 16 in that only one register of up
to 2 bytes may be written. Thus byte numbers 5, 6 and 7
must
be as shown, otherwise an error
response with error code 1 (illegal request) will be returned.