Error handling and diagnostics
CX9000 / CX901040 Version: 2.6
In the case of some errors, rectification does not cause the power supply to leave the blink sequence. The
power supply can only be restarted by switching its supply voltage off and on again.
5.1.3 Terminal Bus Analysis in PLC-Program
To analyze the terminal bus (K-Bus) the programmer can access the registers described in the architecture.
The access to the PLC-program is realized via TwinCAT. The registers are described in the architecture of
the terminal bus connectors (CX1100-000x).
For analysis four signals / variables are used:
• BusState (describes the state of the bus: 0 -> no error, 1 -> bus error)
• ErrorCode (same error code as the LED blink code)
• ErrorArg (same argument code LED blink code)
• Request[0] (output to request error codes / reset bus)
In the PLC program some external variables must be defined :
VAR
k_bus_request AT %QX0.0 : BOOL;
k_bus_err_code AT %IB0 : USINT;
k_bus_err_arg AT %IB1 : USINT;
k_bus_state AT %IB2 : USINT;
END_VAR
In the PLC program the analysis can be done as follows: (this is only pseudo code)
....
IF k_bus_state = 1 THEN (* an error occured on K-Bus*)
k_bus_request := TRUE; (* request vaules for ErrCode and ErrArg *)
CASE k_bus_err_code OF
0 : return;(* should not happen, though an error occured *)
1 : CASE k_bus_arg OF
0 : report error; (* EEPROM checksum error *)
1 : report error; (* overflow in code buffer *)
2 : report error; (* unknown datatype *)
END_CASE;
2 : CASE k_bus_arg OF
0 : report error; (* programmed configuration, wrong table entry *)
ELSE report error; (* wrong table entry *)
END_CASE;
3 : report error (* K-Bus command error *)
4 : CASE k_bus_arg OF
0 : report error; (* break after power supply *)
ELSE report error; (* break after terminal 'k_bus_arg' *)
END_CASE;
5 : report error (* K-Bus-error during register-communication with terminal 'k_bus_arg' *)
9 : CASE k_bus_arg OF
0 : report error; (* checksum error in program flash *)
ELSE report error; (* terminal 'k_bus_arg' does not exist in boot configuration *)
END_CASE;
14 : report error (* 'k_bus_arg'-th terminal has wrong format *)
15 : report error (* wrong number of bus terminals *)
16 : report error (* length of K-Bus data is invalid *)
END_CASE
k_bus_request := TRUE; (* reset bus, if reason for error is removed, bus starts again *)
....
To make the control work, the register and the program must be linked in System Manager. If the PLC
program is attached in System Manager the following signals are available: