Hide thumbs Also See for S7-1200:
Table of Contents
Basic instructions
7.8 Program control operations
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 GET_ERROR or GET_ERROR_ID
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 GET_ERROR or GET_ERROR_ID instruction. You can read
the detailed error information with the GET_ERROR instruction, or read just the error
identifier with GET_ERROR_ID instruction. Normally the first error is the most important, with
the following errors only consequences of the first error.
The first execution of a GET_ERROR or GET_ERROR_ID 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 GET_ERROR or GET_ERROR_ID.
Subsequent executions of either GET_ERROR or GET_ERROR_ID return the first error
since the previous execution of GET_ERROR or GET_ERROR_ID. 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 GET_ERROR 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 GET_ERROR or GET_ERROR_ID 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.
GET_ERROR and GET_ERROR_ID can be used to send error information from the currently
executing block (called block) to a calling block. Place the instruction in the last network of
the called block program to report the final execution status of the called block.
266
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG
Table of Contents
loading

Table of Contents