Write Single Coil - Siemens SITRANS F Modbus RTU RS 485 Operating Instructions Manual

Communication modules
Hide thumbs Also See for SITRANS F Modbus RTU RS 485:
Table of Contents

Advertisement

Functions codes

6.4 Write single coil

Read sensor temperature (4:03007)
• Query: 1,3,11,190,0,2,166,11 (Hex 01,03,0B,BE,00,02,A6,0B)
• Response: 1,3,4,189,216,115,34,251,77 (Hex 01,03,04,BD,D8,73,22,FB,4D)
• Sensor temperature = −0.10569 °C
6.4
Write single coil
Command messages
The write coil functions (05hex) allow the master to control single bits in the slave. The
command message of a coil write is structured as shown below.
The initial slave address is 1. Address 0 (broadcast) and other values between 1 and 255 can be
used.
The function code of this message is 05hex (write coil).
The coil address is the coil to be written to.
The requested coil status is specified by a constant in the query data field. A value of FFhex ,
00hex (upper, lower) requests the coil/bit to be set. A value of 00hex , 00hex requests it to be
reset. All other values are illegal and will not affect the coil.
CRC check and exception handling is performed as described for command 'Read multiple
registers'.
Table 6-8
Message byte
Slave address
Function code
Coil address
New coil value
CRC-16
Normal response
The normal response message contains the same slave address and function code as the
command message.
The coil address is the coil that was written to.
28
Write coil command messages
Upper
Lower
Upper
Lower
Lower
Upper
Example
xxhex
05hex
xxhex
xxhex
FFhex or 00hex
00hex
xxhex
xxhex
Operating Instructions, 03/2021, A5E00753974-AB
Modbus RTU RS 485

Advertisement

Table of Contents
loading

Table of Contents