Read Coils - Siemens SITRANS F Operating Instructions Manual

Communication modules sitrans f m mag 8000 modbus rtu
Hide thumbs Also See for SITRANS F:
Table of Contents

Advertisement

Function codes

6.2 Read coils

6.2
Read coils
Command messages
The read coils functions (01 hex) allow the master to request information from the slave. The
command message of a coil read is structured as shown below. Each row in the table compares
to a byte in the message – top byte (Slave address) is transmitted first.
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 01 hex (read coil) .
The starting coil is the first binary data to be read.
The quantity indicates how many consecutive bits are to be read. The quantity may range
from 1 to 432 bits.
A CRC value is generated from a calculation using the values of the slave address, function
code, and data sections of the message. When the slave receives the command message it
calculates a CRC-16 value and compares it to the one in the CRC-16 field of the command
message. If these two CRC-16 values are the same the slave has received the proper
command message. If the two CRC-16 values are not the same the slave will not respond.
Table 6- 2
Message byte
Slave address
Function code
Starting coil
Quantity
CRC-16
Note
The coil address used in physical message should be the listed address (in chapter 9) minus
1. For example, the coil command of reset customer totalizer is listed as 0:0019, but should
be expressed in the physical message as 18 (0012 hex).
Normal response
If the command message has a valid slave address, function code, starting coil and quantity
value, the slave will respond with a normal response message. If the command message has
an invalid slave address, function code, starting coil and/or quantity, the slave will respond with
an exception response message.
The normal response message contains the same slave address and function code as the
command message.
26
Read coil command messages
Upper
Lower
Upper
Lower
Lower
Upper
Example
xx hex
01 hex
xx hex
xx hex
xx hex
xx hex
xx hex
xx hex
MAG 8000 Modbus RTU
Operating Instructions, 04/2016, A5E03409989-AB

Advertisement

Table of Contents
loading

Table of Contents