FB_CheckWatchdog
Monitoring a watchdog signal transmitted by the FB_WriteWatchdog() block.
The device to be monitored regularly transmits a changing counter state to the device that is to check the transmission. The function block FB_CheckWatchdog() is used there to monitor the state of the counter. If this does not change within a specific period, the bWatchdog output is set to TRUE. If a value of 0 seconds is specified for tWatchdogTime, the bWatchdog signal is set to FALSE. The period specified by tWachtdogTime should be a multiple (5-10 times) of the time in which the monitoring signal is transmitted.
VAR_INPUT
bEnable : BOOL := FALSE;
tWatchdogTime : TIME := t#0s;
nCnt : UDINT;
bEnable: Enable block. | tWatchdogTime: Period within which nCnt should change. | nCnt: Current counter state of the watchdog signal |
VAR_OUTPUT
bWatchdog : BOOL;
nLastCnt : UDINT;
bWatchdog: FALSE indicates a valid monitoring signal. The output will become TRUE if no change is detected in nCnt during the period specified by tWatchdogTime. | nLastCnt: Most recent successfully transmitted counter state of the monitoring signal. |
Requirements
Development environment | Target system | Required libraries |
---|---|---|
TwinCAT 2.11 R3/x64 | PC/CX, BX or BC | TcDataExchange-Bibliothek from V1.0.0 |