5.4.5.1 Status of the CAN bus
The CAN bus status can be read out bit by bit by the application from the variable CAN_STATE. The meaning
of the individual bits is shown in the table.
Bit Mask Status of the CAN bus
7 16#80 CAN-Bus-Off (CAN bus controller has switched off)
6 16#40 Error counter in CAN bus controller above threshold value
5 16#20 Overflow of the receive buffer in the CAN bus controller
4 16#10 Overflow of the receive buffer in the operating system
3 16#08 CAN bus address conflict
2 16#04 Controller is in alarm state
1 16#02 -
0 16#01 CAN bus enable has been granted by central control
In CODESYS, the defined variable name and the associated IEC address can be looked up using the following
path:
Controller configuration → GLT3010_V2 → System → System state → CAN_STATE
Example in STRUCTURED TEXT:
ADDR_ERR := EXTRACT(CAN_STATE, 3); (* Query the fourth bit from the bottom in the table *)