100BBasic instructions
7.8 Program control
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05
225
ERROR_ID
Hexadecimal
ERROR_ID
Decimal
Program block execution error
2525
9509
Invalid area write error
2528
9512
Data alignment read error (incorrect bit alignment)
2529
9513
Data alignment write error (incorrect bit alignment)
2530
9520
DB write protected
253A
9530
Global DB does not exist
253C
9532
Wrong version or FC does not exist
253D
9533
Instruction does not exist
253E
9534
Wrong version or FB does not exist
253F
9535
Instruction does not exist
2575
9589
Program nesting depth error
2576
9590
Local data allocation error
2942
10562
Physical input point does not exist
2943
10563
Physical output point does not exist
Operation
By default, the CPU responds to a block execution error by logging an error in the
diagnostics buffer. However, if you place one or more GetError or GetErrorID instructions
within a code block, this block is now set to handle errors within the block. In this case, the
CPU does not log an error in the diagnostics buffer. Instead, the error information is reported
in the output of the GetError or GetErrorID instruction. You can read the detailed error
information with the GetError instruction, or read just the error identifier with GetErrorID
instruction. Normally the first error is the most important, with the following errors only
consequences of the first error.
The first execution of a GetError or GetErrorID instruction within a block returns the first error
detected during block execution. This error could have occurred anywhere between the start
of the block and the execution of either GetError or GetErrorID. Subsequent executions of
either GetError or GetErrorID return the first error since the previous execution of GetError or
GetErrorID. The history of errors is not saved, and execution of either instruction will re-arm
the PLC system to catch the next error.
The ErrorStruct data type used by the GetError instruction can be added in the data block
editor and block interface editors, so your program logic can access these values. Select
ErrorStruct from the data type drop-down list to add this structure. You can create multiple
ErrorStruct elements by using unique names. The members of an ErrorStruct cannot be
renamed.
Error condition indicated by ENO
If EN = TRUE and GetError or GetErrorID executes, then:
●
ENO = TRUE indicates a code block execution error occurred and error data is present
●
ENO = FALSE indicates no code block execution error occurred
You can connect error reaction program logic to ENO which activates after an error occurs. If
an error exists, then the output parameter stores the error data where your program has
access to it.