The system variable #L_IOStatus stores error information in the bottom 8 bits.
#L_IOStatus
Verifications
When the I/O attribute of the specified unit is the same as that of the actually connected unit, but the points differ, "1" is set.
Settings
When the I/O attribute of the specified unit is different from that of the actually connected unit, "1" is set.
Major Fault
"1" is set when it detects a malfunction that needs to stop the logic.