Coil Mappings - Toshiba XLTR-200 Instruction Manual

Toshiba serial multiprotocol network gateway user's manual
Table of Contents

Advertisement

object, no Modbus exception will be immediately returned. However, the
point will always reflect the "source port" status and object value. In other
words, if such an out-of-range write attempt is performed, the unsuccessful
"source port" network write can be observed by reading the current
(unchanged) value of the point during a subsequent Modbus transaction.

13.1.1 Coil Mappings

The Modbus slave implementation provides read/write support for coils (0X
references). Accessing coils does not reference any new physical data: coils
are simply indexes into various bits of Modbus holding registers. What this
means is that when a coil is accessed, that coil is resolved by the gateway into
a specific holding register, and a specific bit within that holding register. The
pattern of coil-to-register/bit relationships can be described as follows:
Coils 1...16 map to holding register #1, bit0...bit15 (bit0=LSB, bit15=MSB)
Coils 17...32 map to holding register #2, bit0...bit15, and so on.
Arithmetically, the coil-to-register/bit relationship can be described as follows:
For any given coil, the holding register in which that coil resides can be
determined by:
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 coil, the targeted bit in the holding register in which that coil
resides can be determined by:
Where "coil" ∈[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).
From these equations, it can be seen that the largest holding register number
that can be accessed via this coil-to-register mapping method is 4096 (which
contains coil 65535).
For clarity, let's use Equation 1 and Equation 2 in a calculation example. Say,
for instance, that we are going to read coil #34. Using Equation 1, we can
determine that coil #34 resides in holding register #3, as 3.0625 = 3 r1 = 3.
Then, using Equation 2, we can determine that the bit within holding register #3
that coil #34 targets is (34-1)%16 = 1, as 33%16 = mod(3 r1) = 1. Therefore,
reading coil #34 will return the value of holding register #3, bit #1.
holding
register
= coil
bit
(
+
coil
15
=
 
 
16
) 1
%
16
45
...Equation 1
...Equation 2

Advertisement

Table of Contents
loading

Table of Contents