EasyManua.ls Logo

ICC OPC-PRT3 - Coil & Discrete Input Mappings; Connection Timeout Options

ICC OPC-PRT3
115 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
ICC
51
10.1.5 Coil & Discrete Input Mappings
The Modbus/TCP 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 interface into a specific register, and a specific bit within that register. The pattern of
discrete-to-register/bit relationships can be described as follows:
Discrete 1...16 map to register #1, bit0...bit15 (bit0=LSB, bit15=MSB)
Discrete 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:
+
=
16
15discrete
register
Equation 3
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:
161discretebit %)( −=
Equation 4
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).
For clarity, let’s use Equation 3 and Equation 4 in a calculation example. Say, for instance, that we are
going to read coil #34. Using Equation 3, we can determine that coil #34 resides in register #3, as
3.0625 = 3 r1 = 3. Then, using Equation 4, 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.
10.1.6 Connection Timeout Options
In the studio’s Project panel, navigate to OPC-PRT3…Ethernet…Modbus/TCP Server. The following
configuration options will determine the actions to be taken if the connection is abnormally terminated or
lost. While this feature provides an additional level of fail-safe functionality for those applications that
require it, there are several ramifications that must be understood prior to enabling this capability. Note
that a certain degree of caution must be exercised when using the timeout feature to avoid “nuisance”
timeouts from occurring.
Enable Supervisory Timer
This timer provides the ability for the driver to monitor timeout occurrences on the overall receive activity
for all connections.
• The timer will start after receiving the first request. Once the timer is started, it cannot be disabled.
• If the driver experiences no receive activity for more than the Timeout time setting, then the driver
assumes that the client or network has experienced some sort of unexpected problem, and will
perform the Timeout Action.
Enable Connection Timer
This timer provides the ability for the driver to monitor timeout occurrences and errors within the scope of
each client connection.
• If a particular open socket experiences no activity for more than the Timeout time setting, then the
driver assumes that the client or network has experienced some sort of unexpected problem, and
will close that socket and perform the Timeout Action.
• If a socket error occurs (regardless of whether the error was due to a communication lapse or
abnormal socket error), the driver will perform the Timeout Action. Specifically, do not perform
inadvisable behavior such as sending a request from the client device, and then closing the socket
prior to successfully receiving the server’s response. The reason for this is because the server will

Table of Contents