Technical data

Table Of Contents
System Software for S7-300/400 System and Standard Functions - Volume 1/2
A5E00709327-01
2-1
2 Common Parameters for SFCs
2.1 Evaluating Errors with Output Parameter RET_VAL
Types of Error Information
A system function (SFC) executed in your user program indicates whether or not
the CPU was able to execute the function of the SFC successfully.
You can obtain information about any errors that occurred in two ways:
In the BR bit of the status word
In the output parameter RET_VAL (return value)
Note
Before evaluating the output parameters specific to an SFC, you should always
follow the steps below:
First, evaluate the BR bit of the status word.
Then check the output parameter RET_VAL.
If the BR bit indicates that an error has occurred or if RET_VAL contains a general
error code, you must not evaluate the SFC output parameter!
Error Information in the Return Value
A system function (SFC) indicates that an error occurred during its execution by
entering the value "0" in the binary result bit (BR) of the status word. Some system
functions provide an additional error code at an output known as the return value
(RET_VAL) output. If a general error is entered in the output parameter RET_VAL
(see below for explanation), this is only indicated by the value "0" in the BR bit of
the status word.
The return value is of the data type integer (INT). The relationship of the return
value to the value "0" indicates whether or not an error occurred during execution
of the function.
CPU Execution of the SFC BR Return Value Sign of the Integer
With error(s) 0 less than "0" negative
(sign bit is "1")
Without error 1 greater than or
equal to "0"
positive
(sign bit is "0")