Type
| Function |
Description
| Cuts the decimal places of the ANY_REAL value connected to input IN after the point to form an integer value. The function returns the integer value as SINT, INT, DINT, or LINT value (depending on the selected function). |
Notes
| The last valid output value is kept
if the input value (real value) exceeds the data type range of the output value (see also the error behavior below). |
Parameters
| Input
IN1
Data type: | ANY_REAL |
Description: | Value to truncate. |
Output
OUT
Data type: | TRUNC_SINT: SINT TRUNC_INT: INT TRUNC_DINT: DINT TRUNC_LINT: LINT |
|
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 real number (NaN), the function keeps the last valid value).
Error case | Output value |
Overflow | Last valid value is kept |
NaN | Last valid value is kept |
Inf+ | Last valid value is kept |
Inf- | Last valid value is kept |
|
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.
|