About Any Type - Mitsubishi Electric MELSEC Q Series Programming Manual

Structured text
Hide thumbs Also See for MELSEC Q Series:
Table of Contents

Advertisement

3 HANDLING OF CHARACTERS AND NUMERIC VALUES IN ST PROGRAMS

3.2.2 About ANY type

3 - 4
Use the ANY type when multiple data types are permitted for the argument, return
value, etc. of a function. The ANY type is a data type that handles any data type and is
available in different types indicated in the following table.
For example, when the argument of a function has been defined as ANY_NUM, any
data type can be specified as an argument from the word type, double word type and
real number type.
[Description example]
REAL EXPT(REAL In1, ANY_NUM In2); (* Function definition of function EXPT *)
• When a word type device is specified
RealLabel := EXPT(E1. 0, D0);
• When a double word type label is specified
RealLabel := EXPT(E1. 0, DWLabel);
• When a real number is specified
RealLabel := EXPT(E1. 0, E1. 0);
The data types and device types corresponding to the ANY types are as indicated below.
Data Type
ANY Type
Type in ladder
ANY
ANY_SIMPLE
ANY_BIT
ANY_NUM
ANY_REAL
ANY_INT
ANY16
ANY32
: Can be specified as corresponding type.
: Cannot be specified.
: Can be used for device, constant and digit specification, but cannot be used for label.
: Can be used for constant and digit specification.
Word type, double word type or real number
type can be specified.
BOOL
INT
Bit
Word
DINT
REAL
STRING
Double
Real
Character
word
number
3 - 4
string

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l series

Table of Contents