FB_CheckWatchdog
Monitoring of a watchdog signal, which is transmitted with the function block FB_WriteWatchdog.
The device to be monitored regularly sends a changing counter value to the device that is to monitor the transmission. The function block FB_CheckWatchdog is used there to monitor the counter value. If this does not change within a specific period, the output bWatchdog is set to TRUE. If a value of 0 s 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.
Inputs
VAR_INPUT
bEnable : BOOL := FALSE;
tWatchdogTime : TIME := t#0s;
nCnt : UDINT;
END_VAR
Name | Type | Description |
---|---|---|
bEnable | BOOL | Enable function block. |
tWatchdogTime | TIME | Duration during which nCnt has to change. |
nCnt | UDINT | Current counter value of the watchdog signal. |
Outputs
VAR_OUTPUT
bWatchdog : BOOL := FALSE;
nLastCnt : UDINT;
END_VAR
Name | Type | Description |
---|---|---|
bWatchdog | BOOL | FALSE indicates a valid monitoring signal. The output will become TRUE if no change is detected in nCnt during the period of time specified by tWatchdogTime. |
nLastCnt | UDINT | Most recent successfully transmitted counter value of the monitoring signal. |
Requirements
Development environment | required TC3 PLC library |
---|---|
TwinCAT v3.0.0 | Tc2_DataExchange |