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

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

Advertisement

Calling functions in ST language

The following description is used to call a function in the ST language.
Description of calling functions
Function name (Variable1, Variable2, ...);
Enclose the arguments by '( )' after the function name. When using multiple variables, delimit them by ','.
The execution result of the function is stored by assigning the result to the variables.
Function
Calling a function with one input variable (Example: ABS)
Calling a function with three input variables (Example: MAX)
Calling a function with EN/ENO (Example: MOV)
*1 For a function with EN/ENO, the result of the function execution is ENO, and the first argument (Variable 1) is EN.

Calling function blocks in ST language

The following description is used to call a function block in the ST language.
Description of calling function blocks in 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.
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
• 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"  "Structured Ladder/FBD/ST" "Compile Condition1"  "Allow
VAR_OUTPUT at FB call (ST)".
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
Example
Output1 := ABS(Input1);
Output1 := MAX(Input1, Input2, Input3);
boolENO := MOV(boolEN, Input1, Output1);
Example
FBADD1(IN1:=Input1);
Output1 := FBADD1.OUT1;
FBADD1(IN1:=Input1, IN2:=Input2, IN3:=Input3);
Output1 := FBADD1.OUT1;
Output2 := FBADD1.OUT2;
*1
5 WRITING PROGRAMS
5.1 ST
5
81

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec f seriesMelsec l series

Table of Contents