ACC-72EX User Manual
Software setup
83
Watchdog Function
The host Watchdog and the device Watchdog cells in the control block of each of the communication
channels allow the operating system running on the netX to supervise the host or UMAC application and
vice versa. There is no Watchdog function for the system block or for the handshake channel. The
Watchdog for the channels is located in the control block of the status block of each communication
channel.
The netX firmware reads the contents of the device Watchdog cell, increments the value by one, and
copies it back into the host Watchdog location. Then, the application has to copy the new value from the
host Watchdog location into the device Watchdog location. Copying the host Watchdog cell to the device
Watchdog cell has to happen in the configured Watchdog time. When the overflow occurs, the firmware
starts over and “1” appears in the host Watchdog cell. A zero turns off the Watchdog and therefore never
appears in the host Watchdog cell in the regular process.
The minimum Watchdog time is 20 ms. The application can start the Watchdog function by copying any
value unequal to zero into device Watchdog cell. A zero in the device Watchdog location stops the
Watchdog function. The Watchdog timeout is configurable in SYCON.net and can be downloaded to the
netX firmware.
If the application fails to copy the value from the host Watchdog location to the device Watchdog location
within the configured Watchdog time, the protocol stack will interrupt all network connections
immediately, regardless of their current state. If the Watchdog tripped, then power cycling, channel reset,
or channel initialization will allow the communication channel to open network connections again.
Here is sample code for copying the host Watchdog location to the device Watchdog location:
CLOSE
END GAT
DEL GAT
#include "M-VariableDefinition_$6C000.pmc"
#include "M-VariableDefinition_$74000.pmc"
OPEN PLC 28 CLEAR
CC0_ulDeviceWatchdog = CC0_ulHostWatchdog
// copies the host Watchdog content
// to device Watchdog cell
// for the 1st ACC-72EX
S_CC0_ulDeviceWatchdog = S_CC0_ulHostWatchdog
// copies the host Watchdog content
// to device Watchdog cell
// for the 2nd ACC-72EX
CLOSE
Enabling the Communication Bus
Using the Bus On flag (CCx_RCX_APP_COS_BUS_ON, where x is the communication channel
number), the host or UMAC application allows or disallows the netX firmware to open network
connections. This flag is used together with the Bus On Enable flag
(CCx_RCX_APP_COS_BUS_ON_ENABLE, where x is the communication channel number). If set, the
netX firmware tries to open network connections; if cleared, no connections are allowed, and open
connections are closed. If the Bus On Enable flag is set, it enables the execution of the Bus On command
in the netX firmware:
CC0_RCX_APP_COS_BUS_ON=1
// Setting the Bus On flag for 1st ACC-72EX
CC0_RCX_APP_COS_BUS_ON_ENABLE=1
// Enabling the execution of Bus On Flag for 1st ACC-72EX
S_CC0_RCX_APP_COS_BUS_ON=1
// Setting the Bus On flag for 2nd ACC-72EX
S_CC0_RCX_APP_COS_BUS_ON_ENABLE=1
// Enabling the execution of Bus On Flag for 2nd ACC-72EX