Error handling and diagnostics
CX20x3
61
Version: 1.0
State variable
In TwinCAT there is a State variable under the Bus Coupler for K-bus diagnostics.
Fig. 28: Status variable for error handling and diagnostics under TwinCAT.
If the value is "0", the K-bus operates synchronous and without error. If the value is <> "0" there may be a
fault, or it may only be an indication that the K-bus cycle is longer than the task. In which case it would no
longer be synchronous with the task. The task time should be faster than 100 ms. We recommend a task
time of less than 50 ms. The K-bus update time typically lies between one and five ms.
Table 34: Description of the State variable values.
Bit
Description
Bit 0
K-bus error.
Bit 1
Terminal configuration has changed since the start.
Bit 2
Process image lengths do not match.
Bit 8
(still) no valid inputs.
Bit 9
K-bus input update not yet complete.
Bit 10
K-bus output update not yet complete.
Bit 11
Watchdog.
Bit 15
Acyclic K-bus function active (e.g. K-bus reset).
If there is a K-bus error, this can be reset via the IOF_DeviceReset function block (in the TcIoFunctions.lib).