The system variable #L_IOStatus stores error information in the bottom 8 bits.
#L_IOStatus
Major Fault
"1" is set when it detects a malfunction that needs to stop the logic.
30.5.12.1 Error Code (LT Series)