Calling Function Blocks In St Language - Mitsubishi Electric MELSEC Q Series Structured Programming Manual

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

Advertisement

5.1.5

Calling function blocks in ST language

The following description is used to call a function block in the ST language.
Instance name(Input variable1:= Variable1, ... Output variable1: = Variable2, ...);
Enclose the assignment syntax that assigns variables to the input variable and output variable by
'( )' after the instance name.
When using multiple variables, delimit assignment syntax by ',' (comma).
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.
5.1 ST
5-10
5.1.5 Calling function blocks in ST language
1) Calling a function block with one input variable and one output variable
FB definition
FB Name: FBADD
FB instance name: FBADD1
Input variable1: IN1
Output variable1: OUT1
The following is the description to call the function block above.
FBADD1(IN1:=Input1);
Output1:=FBADD1.OUT1;
2) Calling a function block with three input variables and two output variables
FB definition
FB Name: FBADD
FB instance name: FBADD1
Input variable1: IN1
Input variable2: IN2
Input variable3: IN3
Output variable1: OUT1
Output variable2: OUT2
The following is the description to call the function block above.
FBADD1(IN1:=Input1, IN2:=Input2, IN3:= Input3);
Output1:=FBADD1.OUT1;
Output2:=FBADD1.OUT2;
Arguments using at function block call;
VAR_OUTPUT is not appeared on a template if a checkbox in the following option
window is not selected;
[Tools]
 
[Options]

"Convert"
Condition1"

"Allow VAR_OUTPUT at FB call (ST)".
"Structured Ladder/FBD/ST"
"Compile

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l seriesMelsec-f

Table of Contents