Calling operator, Type conversion functions, Calling operator 4 – Lenze PLC Designer PLC Designer (R3-1) User Manual

Page 1066: Type conversion functions 4, L-force | plc designer

Advertising
background image

L-force | PLC Designer

Programming Reference

1064

DMS 4.1 EN 03/2011 TD29

16.3.8

Calling Operator

CAL
EC Operator: Calling a function block or a program
Use CAL in IL to call up a function block instance. The variables that will serve as the
input variables are placed in parentheses right after the name of the function block
instance.
Example:
Calling up the instance Inst from a function block where input variables Par1 and Par2
are 0 and TRUE respectively.

CAL INST(PAR1 := 0, PAR2 := TRUE)

16.3.9

Type Conversion Functions
Its is forbidden to implicitly convert from a "larger" type to a "smaller" type (for
example from INT to BYTE or from DINT to WORD). Special type conversions are
required if one wants to do this. One can basically convert from any elementary type to
any other elementary type.
Syntax:
<elem.Typ1>_TO_<elem.Typ2>
Please notice that at ...TO_STRING conversions the string is generated left-justified. If it
is defined to short, it will be cut from the right side.

The following type conversions are supported:
• BOOL_TO Conversions
• TO_BOOL Conversions
• Conversion between Integral Number Types
• REAL_TO-/ LREAL_TO Conversions
• TIME_TO/TIME_OF_DAY Conversions
• DATE_TO/DT_TO Conversions
• STRING_TO Conversions
• new in comparison to V2.3:
• TRUNC (conversion to DINT)
• TRUNC_INT
• ANY_NUM_TO_<numeric datatype>
• ANY_TO_<any datatype>

Advertising