Type
| FunctionAvailable as standard (non-safety-related) and safety-related type (*_S). For the safety-related type, the safety-related data types (SAFE*) are expected at the formal parameters. |
Description
| Selects the value connected to the input IN0 or IN1 and writes it to the output depending on the value connected to the input G.
- If G = FALSE, the value of input IN0 is written to OUT.
- If G = TRUE, the value of input IN1 is written to OUT.
|
Notes
|
- IN0, IN1 and OUT must have the same data type.
- The function is an overloaded function. It can operate on various input data types.
- The input G can be negated.Note: The negation of formal parameters is not supported in safety-related code (SNOLD).
|
Parameters
| Inputs
G
Data type: | (SAFE)BOOL |
Description: | Selection input. |
IN0
Data type: | ANY(_SAFEELEMENTARY) |
Description: | Input value. |
IN1
Data type: | ANY(_SAFEELEMENTARY) |
Description: | Input value. |
Output
OUT
Data type: | ANY(_SAFEELEMENTARY) |
Description: | Output value. |
|
Error behavior | Error behavior
The following table shows the errors which may occur while executing the function and the value returned by the function in the corresponding error case.
Error case | Output value |
Any input (IN1, IN2) = NaN
Note: ENO stays true in the error case. | NaN |
Any input (IN1, IN2) = Inf+
Note: ENO stays true in the error case. | Inf+ |
Any input (IN1, IN2) = Inf-
Note: ENO stays true in the error case. | Inf- |
Resulted string too short | Empty string |
Note
String comparison: In case of a string error, the function returns the empty string ''. Furthermore, the controller runtime logs the error in its error catalog and a corresponding error message is shown in the Error List. |
Note
Controller stop on string error: The controller can be automatically stopped when a string error occurs. This allows you to locate the error in your project. To enable the automatic stop of the controller in case of a string error, activate the button in the Cockpit toolbar of the controller. |
|
Additional information
| EN/ENO behavior
The POU is only executed if TRUE is applied to the EN input. If EN = FALSE, the POU is not executed and ENO = FALSE indicates the inactivity.
ENO is set to FALSE if the resulted string is too short (see "Error behavior" above).
Invalid real values are passed to the output without setting ENO to FALSE because the function does not interpret values.
|