Chapter 7. Programming SRTP Channel Commands
GFK-2224Q
January 2017
131
Caution
In Certain Conditions TCP Connections Can Be Totally Consumed
If the logic for issuing COMMREQs is constructed so it does the following, all available TCP connections can
quickly be used up:
▪
The number of repetitions (Word 9 in an Establish Read or Write Channel COMMREQ) is set to 1,
and
▪
A new COMMREQ is issued repeatedly and immediately upon completion of the prior one.
Use “Channel Re-Tasking” To Avoid Using Up TCP Connections
TCP connections can be used up if each successive COMMREQ is directed to the same target device (same IP
address). In this case, it is better to establish a channel with the target device once, leave it active, then re-task
the channel, even if data transfers take place infrequently. This method will use only one TCP connection.
An additional advantage of re-tasking is that the time and network traffic required to create a channel and its
associated TCP connection are not incurred each time a data transfer is required.
The disadvantages to re-tasking are:
▪
While the TCP connection is open, it is unavailable to the rest of your application, and
▪
The active TCP connection uses up network bandwidth because the active TCP connection generates a
small amount of ongoing periodic network traffic.
How To Re-Task a Channel
1.
For Establish Read/Write Channel Commands, set the number of repetitions (COMMREQ Word 9) to 2
and set the read/write period (COMMREQ Words 10 and 11) to be longer than the expected time
between transfers. For example, if you expect to transfer data about once per minute, set the
read/write period to about two minutes. This will cause a TCP connection to be created and held open
for two minutes.
2.
Set up the ladder program to:
a.
Issue the first COMMREQ and wait for the first transfer to complete, which will be indicated when
the COMMREQ Status (CRS) word is changed to 1.
b.
Then before the read/write period expires (at which time the second and final transfer is sent and
the TCP connection is dropped), issue the next COMMREQ with the same parameters as specified
in step 1. This will “re-task” the channel to use the existing TCP connection instead of opening a
new one, and will send another data transfer restarting the timer for the read/write period.
Repeat step 2B for each successive data transfer desired.
Client Channels TCP Resource Management
There is a period of time that the OS Network stack hangs on to the TCP resources associated with a
connection after it is closed. It applies to the initiator of the close, which is almost always the client side. This
time is referred to as the “TCP Linger Period”. Once the TCP Linger Period expires (60 seconds in the current OS
implementation), the TCP resources are released. Application developers using client channels need to be
aware of this behavior when designing their logic. There are a finite number of TCP resources allocated to
client channels, and if channel connections are brought up and down so fast that these resources are depleted,
then the application may have to wait until a TCP resource frees up in order to establish another client channel
(a COMMREQ Status of 0xA890 is returned if no TCP resources are currently available; application should wait
and retry again).
Содержание PACSystems RX7i
Страница 45: ......
Страница 54: ...Chapter 4 Configuration GFK 2224Q January 2017 41 Figure 18 CPE400 Advanced Ethernet Configuration LAN1 LAN 2 ...
Страница 80: ...Chapter 4 Configuration GFK 2224Q January 2017 67 ...
Страница 81: ......
Страница 122: ...Chapter 6 Programming EGD Commands GFK 2224Q January 2017 109 ...
Страница 142: ...Chapter 7 Programming SRTP Channel Commands GFK 2224Q January 2017 129 Figure 51 Sample Ladder Logic for COMMREQ ...
Страница 147: ......
Страница 193: ...Chapter 10 OPC UA Server 180 PACSystems RX7i RX3i TCP IP Ethernet Communications User Manual GFK 2224Q Example ...
Страница 202: ...Chapter 10 OPC UA Server GFK 2224Q January 2017 189 Figure 73 Machine Edition Online Command to Set Passwords ...
Страница 211: ......
Страница 253: ...Chapter 12 Diagnostics 240 PACSystems RX7i RX3i TCP IP Ethernet Communications User Manual GFK 2224Q ...
Страница 262: ...Chapter 13 Network Administration GFK 2224Q January 2017 249 ...
Страница 263: ......