You could set bits in the OBs listed below.
But since these OBs will prevent the CPU from stopping on serious errors, you will have to consider to call the stop function.
I think I have seen a survey of the RS area, and that the LED status is somwhere in there. Perhaps some of the other members have got the docu and can help.
This is cut out from the 'List of operations':
OB 19 Call of a block not programmed (LZF) Stop
OB 23 Timeout in the case of direct access to the I/O module(QVZ) none
OB 24 Timeout when updating the process image and
transferring interprocessor communication flags none
OB 25 Addressing error (ADF) Stop
OB 26 Scan time exceeded (ZYK-FE) Stop
OB 27 Substitution error (BCF) Stop
OB 28 Stop by PG function/Stop switch/S5-BUS (ABBR) Stop1)
OB 29 Operation error (BCF) Stop
OB 30 Parameter assignment error (BCF) Stop
OB 31 Other execution time errors (LZF)Stop
Kalle