Mitsubishi Electric MELSEC iQ-F FX5 Programming Manual page 43

Program design
Hide thumbs Also See for MELSEC iQ-F FX5:
Table of Contents

Advertisement

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.
Data type
Word [Signed]
Word [Unsigned]/Bit String [16-bit]
*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 44 When an assigned arithmetic operation is used
Sub-program control statement
■Function block call statement
Format
Instance name(Input variable1:= Variable1, ... Output
variable1: => Variable2, ...);
Instance name.Input variable1:= Variable1;
:
Instance name();
Variable2:= Instance name.Output variable1;
The following table shows the symbols used for arguments in a function block call statement and available formats.
Type
Description
VAR_INPUT
Input variable
VAR_OUTPUT
Output variable
VAR_IN_OUT
Input/Output variable
VAR_PUBLIC
External variable
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.
Function block
Calling a function block with one input variable and one
output variable
Calling a function block with three input variables and two
output variables
Description
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
*1
before the conversion.
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.
In the case of a single-precision real, an automatic conversion is made into the same value as the integer
*1
before the conversion.
Description
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).
List the assignment statement that assigns variables to the input variable and output variable
before and after a function block call statement.
Attribute
N/A, or RETAIN
N/A, or RETAIN
N/A
N/A, or RETAIN
FB definition
FB name: FBADD
FB instance name: FBADD1
Input variable1: IN1
Output variable1: OUT1
FB name: FBADD
FB instance name: FBADD1
Input variable1: IN1
Input variable2: IN2
Input variable3: IN3
Output variable1: OUT1
Output variable2: OUT2
*2
Symbol
Available formats
:=
All formats
=>
Variable only
:=
All formats
Cannot be specified
Example
FBADD1(IN1:=Input1);
Output1:=FBADD1_OUT1;
FBADD1(IN1:=Input1, IN2:=Input2, IN3:=Input3);
Output1:=FBADD1_OUT1;
Output2:=FBADD1_OUT2;
6 ST LANGUAGE
6
41
6.1 Configuration

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents