Operating instructions

A Appendix: Modbus Interface WirelessHART Fieldgate SWG70
98 Endress+Hauser
A.3.4 Read Discrete Inputs
HART Specification 285 describes the requirements for discrete and hybrid field devices. A discrete
device will return discrete values only. A hybrid device may return both analog and discrete values.
Discrete inputs are read by means of HART Command 64,386, which returns a block of discrete
variables (values and status). The length of the data string depends upon the device polled. For
further details, please consult the device manual.
Request Data Bytes
Byte Format Description
0-1 Unsigned16 Index of First Discrete Variable to read
2 Unsigned8 Number of Discrete Variables to read (n)
Response Data Bytes
Byte Format Description
0-1 Unsigned16 Index of first Discrete Variable Returned
2 Unsigned8 Number of Discrete Variables returned (n)
3 Bits-8 Extended Device Status
4-7 Time Time stamp for most recent change to Actual Value of first Discrete Variable Value
8-9 Unsigned16 First Discrete Variable Value
10 Bits-8 First Discrete Variable Status
0x01: 1 = Discrete Variable in Simulation or Local Override
0x02: 1 = Discrete Variable in Fault Mode
0x02-0x04: Reserved, bit set to zero
11-12 Unsigned16 Second Discrete Variable Value
13 Bits-8 Second Discrete Variable Status
.....
3n+8-
3n+9
Unsigned16 Last Discrete Variable Value
3n+10 Bits-8 Last Discrete Variable Status
Command-Specific Response Codes
Code Class Description
0 Success No Command-Specific Errors
1 Undefined
2 Error Invalid Selection
3-4 Undefined
5 Error Too Few data Bytes Received
6 Error Device-Specific Command Error
7 Undefined
7 Undefined
8 Warning Set to nearest value
9-15 Undefined
16 Error Access Restricted
17-127 Undefined