com.eurotech.framework.protocol.modbus
Class ModbusDataFormation
java.lang.Object
com.eurotech.framework.protocol.modbus.ModbusDataFormation
public class ModbusDataFormation
- extends Object
This static class defines the various data types and extended data
implementations for Modbus. The Modbus specification only defines boolean and
16 bit analog data, many manufacturers have extended the protocol to handle
32 bit data, both as 32 bit integers and 32 bit IEEE floating point values.
There are two variations in how this extension is done.
The first variation doesn't specifically break the protocol, but does create
an unexpected response. In this variation, some registers are simply treated
as 32 bit registers and so only require a single offset to specify a 32 bit
register and value. The one "broken" response is in a read or write, the byte
count will be 4 times the data count versus the "normal" two bytes to one
data.
The other variation, in order to not break the very specifics of the
protocol, implemented 32 bit data through register pairing. In register
pairing, a pair of adjacent 16 bit registers, such as registers at offset 0
and 1 or offset 10 and 11, would be joined to construct the 32 bit value.
This variation remains compatible with all intermediate equipment.
Note: Care must be taken in setting up data maps for this second
variation. As each 32 bit value is represented by two consecutive registers,
the Modbus offsets must be doubled relative to the contained data. In other
words, 5 32 bit data values occupy 10 consecutive registers. If a data map
specifies a data field starting at Modbus offset 100 and having 50
"PAIRED_32_BIT" values, the map will represent 100 registers at offsets 100
through 199 on the Modbus field device.
The Field values, not the field names should be used in configuration files.
- Author:
- matt.demaree
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BOOLEAN
public static final String BOOLEAN
- See Also:
- Constant Field Values
SINGLE_16_BIT
public static final String SINGLE_16_BIT
- See Also:
- Constant Field Values
PAIRED_32_BIT
public static final String PAIRED_32_BIT
- See Also:
- Constant Field Values
SINGLE_32_BIT
public static final String SINGLE_32_BIT
- See Also:
- Constant Field Values
Copyright © 2013. All Rights Reserved.