EasyManua.ls Logo

Beckhoff CX2100-0904 - Error Handling and Diagnostics; PLC Diagnostics and K-bus State Analysis

Beckhoff CX2100-0904
87 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Error handling and diagnostics
6 Error handling and diagnostics
6.1 Diagnostics in the PLC program
For the analysis of the terminal bus (K-bus) the State register can be accessed via TwinCAT from a PLC
program.
The error analysis is presented as an example below.
A signal/variable is essentially required for the error analysis:
State (indicates the state of the bus: 0 -> no error)
External variables must similarly be created in the PLC program for this:
VAR
k_bus_state AT %IB2 : USINT;
END_VAR
The error can then be determined in the PLC program as follows (this is pseudo code, which is not directly
executable in this form)
....
IF k_bus_state != 0 THEN (* auf dem K-Bus ist ein Fehler aufgetreten *)
IF k_bus_state.1 = 1 THEN melde Fehler; (* Klemmenzustandsfehler *) END_IF
IF k_bus_state.2 = 1 THEN melde Fehler; (* Prozessdatenlänge ungültig *) END_IF
IF k_bus_state.8 = 1 THEN melde Fehler; (* keine gültigen Eingänge *) END_IF
IF k_bus_state.9 = 1 THEN melde Fehler; (* K_bus Input Update ist aktiv *) END_IF
IF k_bus_state.10 = 1 THEN melde Fehler; (* K_bus Output Update ist aktiv *) END_IF
IF k_bus_state.11 = 1 THEN melde Fehler; (* Watchdog Fehler *) END_IF
IF k_bus_state.15 = 1 THEN melde Fehler; (* Bus ist asynchron *) END_IF
END_CASE
k_bus_request := TRUE; (* Rücksetzen des Busses, wenn Fehler beseitigt, dann startet der Klemm-
bus wieder *)
....
In order for the controller and the registers to co-operate, they must be linked in the System Manager.
CX2100-09x4 77Version: 1.3

Related product manuals