Download X-317 Users Manual

Transcript
Operation
X-317™ Users Manual
5.3.4 Read Holding Registers – Modbus Function Code 03 (0x03)
The Read Holding Registers function is used to read the analog output values. 32-bit values are read
from 16-bit register pairs. Consequently, the addresses and registers must be even numbers.
5.3.4.1 Request
Modbus TCP Request Frame Example – Read analog output 1 and 2
Field Name
Length
Function
Example Data
Transaction Identifier
2 bytes
Synchronization number.
0x0001
Protocol Identifier
2 bytes
Zero for Modbus/TCP
0x0000
Message Length
2 bytes
Number of bytes in frame (below)
0x0005
Unit Identifier
1 byte
Slave Address (0xff if not used)
0xFF
Function Code
1 byte
Read Holding Register
0x03
Start Address
2-bytes
Start Address
0x0510
Quantity of Registers
2 bytes
Quantity of Registers
0x0002
5.3.4.2 Response
Each value is returned as two registers in IEEE 754 floating point formats. The four data bytes are
treated as two individual big-endian 16-bit words with the least significant word being sent first. In other
words, the 32-bit floating point number represented as '1234 ABCD' is sent as an 'ABCD 1234.'
The device returns a value of 0xFFFFFFFF (NaN) if there isn't a valid reading or when the output is in an
alarm condition.
X-317 Response Frame Example – Read Sensor 1 and 2
Page 46
Field Name
Length
Function
Example Data
Transaction Identifier
2 bytes
Synchronization number.
0x0001
Protocol Identifier
2 bytes
Zero for Modbus/TCP
0x0000
Message Length
2 bytes
Number of bytes in frame (below)
0x000C
Unit Identifier
1 byte
Slave Address (0xff if not used)
0xFF
Function Code
1 byte
Read Holding Registers
0x03
Byte Count
1 byte
Byte Count
0x08
Analog Out 1
4-bytes
Data Value (0x00000000 – 0xFFFFFFFF)
0x999A41B1
Analog Out 2
4-bytes
Data Value (0x00000000 – 0xFFFFFFFF)
0xB85142D2
Xytronix Research & Design, Inc.