Type
| Function |
Description
| Negates the operand connected to IN1. |
Notes
|
- The input and output parameters must be of the same data type (larger output data type is allowed).
- Only signed data types and REAL/LREAL data types are allowed.
- The function provides implicit data type conversion at its input and output parameters according to the rules defined by the IEC 61131 standard.
|
Parameters
| Input
IN1
Data type: | ANY_NUM (see the notes above) |
Description: | Input value. |
Output
NEG
Data type: | ANY_NUM (see the notes above) |
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. As described, the value returned by the function in the error case depends on the value of the input (for example, if the input value is not a legal number (NaN), the function returns NaN).
Error case | Output value |
Input value = SINT_MIN (for SINT input), INT_MIN (INT input), DINT_MIN (DINT input) or
LINT_MIN (LINT input) | Overflow value |
Real: NaN | NaN |
Real: Inf+ | Inf- |
Real: Inf- | Inf+ |
|
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.
If any of the errors listed under "Error behavior" occurs while executing the function, ENO is set to FALSE.
|