ANY_TO_DINT / ANY_TOUDINT

Operator - Converts the input into integer value.

Inputs

IN : ANY  Input value

Outputs

Q : DINT  Value converted to integer

Remarks

For BOOL input data types, the output is 0 or 1. For REAL input data type, the output is the integer part of the input real. For TIME input data types, the result is the number of milliseconds. For STRING inputs, the output is the number represented by the string, or 0 if the string does not represent a valid number. In LD language, the conversion is executed only if the input rung (EN) is TRUE. The output rung (ENO) keeps the same value as the input rung. In IL Language, the ANY_TO_DINT function converts the current result.

ST Language

Q := ANY_TO_DINT (IN);

FBD Language

Any_To_DintFbd.gif (1274 octets)

LD Language

(* The conversion is executed only if EN is TRUE *)
(* ENO keeps the same value as EN *)
Any_To_DintLd.gif (1493 octets)

IL Language:

Op1: LD  IN
     ANY_TO_DINT
     ST  Q

See also

ANY_TO_BOOL   ANY_TO_SINT   ANY_TO_INT   ANY_TO_LINT   ANY_TO_REAL   ANY_TO_LREAL   ANY_TO_TIME   ANY_TO_STRING