EasyManua.ls Logo

Mitsubishi Electric MELSEC iQ-F Series - Page 54

Mitsubishi Electric MELSEC iQ-F Series
128 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
52
6 ST LANGUAGE
6.1 Configuration
To avoid the deletion of the data during type conversion, only conversion from smaller type to larger type is performed. Of the
elementary data types, type conversion is performed only for the following data types among basic data types are the targets
of a type conversion.
*1 When the data of 16 bits (a word [signed] or a word [unsigned]/bit string [16 bits]) is transferred to an input argument of the data type
ANY_REAL, an automatic conversion is made into a single- precision real.
*2 When the data of a word [unsigned]/bit string [16 bits] is transferred to an input argument of ANY32, an automatic conversion is made
into a double word [unsigned]/bit string [32 bits].
For data types that are not described above, use the type conversion function.
Since type conversion is not performed in the following cases, use the type conversion function.
Type conversion between integer-data types with different signs
Type conversion between the data types by which the data is deleted
For the precautions for assigning the result of an arithmetic operation, refer to the following.
Page 55 When an assigned arithmetic operation is used
Sub-program control statement
Function block call statement
The following table shows the symbols used for arguments in a function block call statement and available formats.
The execution result of the function block is stored by assigning the output variable that is specified by adding "." (period) after
the instance name to the variable.
Data type Description
Word [Signed] In the case of a double word [signed] after conversion, the conversion is automatically made into a value
with a sign extension.
In the case of a single-precision real, an automatic conversion is made into the same value as the integer
before the conversion.
*1
Word [Unsigned]/Bit String [16-bit] In the case of a double word [unsigned]/bit string [32 bits] or a double word [signed] after conversion, an
automatic conversion is made into to a value with a zero extension.
*2
In the case of a single-precision real, an automatic conversion is made into the same value as the integer
before the conversion.
*1
Format Description
Instance name(Input variable1:= Variable1, ... Output
variable1: => Variable2, ...);
Enclose the assignment statement that assigns variables to the input variable and output
variable by "( )" after the instance name.
When using multiple variables, delimit the assignment statement by "," (comma).
Instance name.Input variable1:= Variable1;
:
Instance name();
Variable2:= Instance name.Output variable1;
List the assignment statement that assigns variables to the input variable and output variable
before and after a function block call statement.
Type Description Attribute Symbol Available formats
VAR_INPUT Input variable N/A, or RETAIN := All formats
VAR_OUTPUT Output variable N/A, or RETAIN => Variable only
VAR_IN_OUT Input/Output variable N/A := Variable only
Function block FB definition Example
Calling a function block with one input variable and one
output variable
FB name: FBADD
FB instance name: FBADD1
Input variable1: IN1
Output variable1: OUT1
Calling a function block with three input variables and two
output variables
FB name: FBADD
FB instance name: FBADD1
Input variable1: IN1
Input variable2: IN2
Input variable3: IN3
Output variable1: OUT1
Output variable2: OUT2
FBADD1(IN1:= Input1);
Output1 := FBADD1.OUT1;
FBADD1(IN1:=Input1, IN2:=Input2, IN3:=Input3);
Output1 := FBADD1.OUT1;
Output2 := FBADD1.OUT2;

Other manuals for Mitsubishi Electric MELSEC iQ-F Series

Related product manuals