Creating Watchdogs for Ethernet Connections
Products: ACR9000, 9030,9040,9600,9630,9640, Aries Controller (AR-xxCE)
The standard Ethernet communication drivers (ComACRserver for PCs, Acroloop CIP Ethernet for HMI) include built-in mechanisms for guarding the connection and alerting the client or controller that the connection has been lost. The watchdogs in these drivers are initiated automatically.
In applications where the user is designing the Ethernet communication driver, the Management Connection Watchdog function is available. This function and more details about Ethernet communications to the ACR and Aries Controller controller can be found in the Ethernet Spec.
The user application should connect to Port 5002 or Port 5006 as needed. This is the Command Connection. (Port 5002 is an ASCII connection. Use this connection to send any Acrobasic command to the controller similar to the terminal emulator in ACR-View. Port 5006 is a managed binary connection that expects to see commands in a specifc format. 5006 is well suited for PC applications and constructing drivers. )
Then create an additional connection to Port 5004 (Management Connection).After connection to 5004, the client should send Watchdog packets at regular intervals to the controller. The first time the packet is sent the associated Command Connection changes state to Watchdog protected. The controller will then expect to see repeated packets. The watchdog feature is designed both to “re-assure†the client that the controller is alive, and to detect the loss of client activity and respond by closing an ACR command socket and/or fast status socket.
Client Support: In normal operation, the controller responds to a client watchdog packet by echoing the same packet back to the client. The lack of echo tells the client application that the command connection has been lost.
Server: The controller server watchdog will detect the absence of client watchdog packets within a time period that is the product of the most recently specified (Timer * Ticker) and close the connections specified in the watchdog packet.
Watchdog Packet:
Function | Size | Description |
ID word | 4 bytes | A value of 0x01 identifies this packet as a watchdog request |
Watchdog Timer | 4 bytes | Time interval in milliseconds for watchdog. Zero disables the watchdog |
Watchdog Ticker | 4 bytes | Number of retries per time interval before watchdog times out. |
IP address | 4 bytes | The IP address of the client connections to be guarded |
Port | 4 bytes | The port number of the client Command connection to be guarded |
Fast status port | 4 bytes | The port number of the client fast status connection to be guarded |
Example:
The IP address of the PC is 192.168.10.200 and uses Port 1234. Timer value is set to 2secs, ticker/retry is set to 4. Typically the port number of the PC is assigned dynamically when the connection is made.
Packet: 00 00 00 01 00 00 07 D0 00 00 00 04 C0 A8 0A C8 00 00 04 D2 00 00 00 00
Desc | ID word | Watchdog Timer | Watchdog Ticker | IP address | Port | Fast status port |
Value | 1 | 2000 | 4 | 192.168.10.200 | 1234 | 0 |
Byte Value | 00 00 00 01 | 00 00 07 D0 | 00 00 00 04 | C0 A8 0A C8 | 00 00 04 D2 | 00 00 00 00 |
Note: Commands and replies on Port 5004 are high-ordered byte first.