ANY_TO_UDINT
The ANY_TO_UDINT instruction converts a value to a 32-bit Unsigned Double Integer value.
Languages supported: Function block diagram, ladder diagram, structured text.
This instruction applies to the
Micro810
LC10, Micro820
L20E, Micro850
L50E, and Micro870
L70E controllers.ANY_TO_UDINT

Parameter | Parameter Type | Data Type | Description | |
|---|---|---|---|---|
EN | Input | BOOL | When set to true, the instruction is enabled.
| |
i1 | Input | BOOL SINT USINT BYTE INT UINT WORD DINT DWORD | LINT ULINT LWORD REAL LREAL TIME DATE STRING | Any value other than an Unsigned Double Integer. |
o1 | Output | UDINT | A 32-bit Unsigned Double Integer value. | |
ENO | Output | BOOL | Enables output. Applies to ladder diagram programs. | |
ANY_TO_UDINT structured text example
bres := ANY_TO_UDINT (true); | (* bres is 1 *) |
tres := ANY_TO_UDINT (t#1s46ms); | (* tres is 1046 *) |
mres := ANY_TO_UDINT ('0198'); | (* mres is 198 *) |
Instruction behavior changes starting from firmware revision 23.012
When converting REAL or LREAL values to the UDINT data type, the following rules apply:
- Positive values
- Values from 0 through 2³¹ − 1 can be converted to the UDINT data type.
- Values exceeding 2³¹ − 1 are clamped to 2³¹ − 1.
- Negative values
- Values from −1 through −2³¹ can be converted to the UDINT data type.
- Values smaller than −2³¹ are clamped to 2³¹.
Provide Feedback