Instructions
UM-0085-B09 DT80 Range User Manual Page 365
RG
The following options specify how the DT80 should interpret the contents of a Modbus register, or pair of registers:
• MBI - 16 bit signed integer (default)
•
MBU - 16 bit unsigned integer
•
MBL - 32 bit signed integer transferred using two consecutive 16 bit registers
•
MBF - 32 bit IEEE-754 floating point value transferred using two consecutive 16 bit registers
•
MBLE - 32 bit signed integer transferred using "Enron Modbus" protocol variant
•
MBFE - 32 bit floating point value transferred using "Enron Modbus" protocol variant
If MBL or MBF are selected, the following two options can be used to specify the order in which the two halves of the 32
bit value are stored:
• MES - "straight endian" (default): the first register of the pair contains the upper 16 bits
•
MER - "reverse endian": the first register of the pair contains the lower 16 bits
Communications (TO, RT)
Two options control how communications errors or timeouts are handled.
The
TOn option specifies the timeout (n) in seconds for Modbus master requests (minimum=1, default=3)
The
RTn option specifies the number of retries to perform following a Modbus master error or timeout (default=0)
Unit ID (MUID)
The MUIDn option sets the Modbus "unit ID" field to n (0-255), and is only applicable for network connections
(
4MODBUS). It is typically used where the connected Modbus device is acting as a gateway to a serial Modbus network.
In this case the unit ID represents the address of the device on the serial network that you wish to access.
Scaling
The standard DT80 scaling facilities such as spans, polynomials and the channel factor can be used to scale the slave
device's measurement units into the desired units for logging.
For example, if a device register contains a temperature in tenths of a degree Celsius you could specify a scaling factor
of 0.1 using the channel factor, e.g.
1MODBUS(AD1,R3:22,0.1,"Temp~degC")
If the device instead measured in tenths of a degree Fahrenheit, a span could be used to apply a scaling factor and an
offset:
S1=0,100,320,2120"degC"
1MODBUS(AD1,R3:22,S1)
In this example the span (see Spans (Sn) (P65)) is specifying that we want to indicate a value of 0 (degrees C) when we
read a value of 320 (tenths of a degree F) from the device, and a value of 100 when we read a value of 2120.
The
SRn channel option can be used to apply a span in reverse. So if the above device also contained a setpoint register
(also in tenths of a degree F), you could use the following to set the setpoint to 22.5 °C:
1MODBUS(AD1,R4:20,SR1)=22.5
Block Transfers
It is also possible to read a block of consecutive Modbus registers into a block of CVs. In this case the return value of the
channel is the number of values transferred (which you would generally ignore by using the
W option to make the channel
a working channel). The actual data values are written to the specified CVs.
To do a block read, specify a starting register number and a CV range. The extent of the CV range specifies the number
of registers to read. For example
1MODBUS(AD1,R3:21,=1..5CV)
will read input registers #21-25 into 1CV-5CV.
To write a block of CVs to a block of registers, a CV range can be specified where the expression would normally be, e.g.
1MODBUS(AD1,R4:1)=51..60CV
will set holding registers #1-10 to the values of 51CV-60CV.
In the following slightly convoluted example, the current values of 1CV-50CV can be copied to 101CV-150CV in one
operation by telling the DT80 to "poll itself"
4MODBUS(AD"127.0.0.1",R3:1,=101..150CV)