ICC XLTR-1000 Instruction Manual page 139

Miltiprotocol rs-485 gateway
Hide thumbs Also See for XLTR-1000:
Table of Contents

Advertisement

ICC
9.9.2.3 Coil & Discrete Input Mappings
The Modbus RTU slave driver provides read/write support for coils (0X
references) and read-only support for discrete inputs (1X references). These will
collectively be referred to from here on out as simply "discretes". Accessing
discretes does not reference any new physical data: discretes are simply indexes
into various bits of existing registers. What this means is that when a discrete is
accessed, that discrete is resolved by the gateway into a specific register, and a
specific bit within that register. The pattern of discrete-to-register/bit relationships
can be described as follows:
Discretes 1...16 map to register #1, bit0...bit15 (bit0=LSB, bit15=MSB)
Discretes 17...32 map to register #2, bit0...bit15, and so on.
Arithmetically, the discrete-to-register/bit relationship can be described as follows:
For any given discrete, the register in which that discrete resides can be
determined by Equation 9:
Where the bracket symbols " " indicate the "floor" function, which means that
any fractional result (or "remainder") is to be discarded, with only the integer
value being retained.
Also, for any given discrete, the targeted bit in the register in which that discrete
resides can be determined by Equation 10:
Where "discrete" ∈[1...65535], "bit" ∈[0...15], and "%" is the modulus operator,
which means that any fractional result (or "remainder") is to be retained, with the
integer value being discarded (i.e. it is the opposite of the "floor" function).
Conversely, for any bit in a register, the targeted discrete corresponding to that
bit can be calculated by Equation 11:
discrete
For clarity, let's use Equation 9 and Equation 10 in a calculation example. Say,
for instance, that we are going to read coil #34. Using Equation 9, we can
determine that coil #34 resides in register #3, as 3.0625 = 3 r1 = 3. Then,
using Equation 10, we can determine that the bit within register #3 that coil #34
targets is (34-1)%16 = 1, as 33%16 = mod(2 r1) = 1. Therefore, reading coil #34
will return the value of register #3, bit #1.
Note that discretes are mapped to registers, not database addresses. The
location of a given register in the database determines what physical address the
discrete will access. Because of this, it is possible to indirectly remap discretes
using register remap objects. If a register has been remapped to an alternate
database address, then the discretes that map to that register will also be
remapped to that alternate address.
discrete
register
=
16
bit
=
(
discrete
1
(
=
16
×
register
+
15
)
%
16
)
1
+
bit
+
1
138
Equation 9
Equation 10
Equation 11

Advertisement

Table of Contents
loading

Table of Contents