Chapter 6 St Language - Mitsubishi Electric MELSEC iQ-F FX5 Programming Manual

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

Advertisement

6
ST LANGUAGE
The ST language is one of the languages supported by IEC 61131-3, the international standard that defines the description
methods for logic. ST language is a text programming language with a grammatical structure similar to C language. ST
language is suitable for programming some complicated processing that cannot be easily described using ladder diagram.
ST language supports control syntaxes, operational expressions, function blocks (FBs), and functions (FUNs). Therefore, the
following description can be made.
Control syntaxes using selective branches with conditional statements and repetition by iteration statements
Ex.
(* Control conveyors of Line A to C. *)
CASE
Line
OF
1:
Start_switch
:= TRUE;
2:
Start_switch
:= FALSE;
3:
Start_switch
:= TRUE;
ELSE
Alarm_lamp
END_CASE;
IF
Start_switch
=
TRUE THEN
FOR
Count
:= 0
TO
100
BY
1
DO
Count_No
:=
END_FOR;
END_IF;
Expressions using operators (such as *, /, +, -, <, >, and =)
Ex.
D0 := D1* D2 + D3 / D4 -D5;
IF
D0 > D10
THEN
D0 := D10;
END_IF;
Calling a defined function block
Ex.
//FB data name
//Input variable
//Output variable
//Input/output variable
//FB label name
FB1(I_Test :=D0,O_Test
Calling a standard function
Ex.
(* Convert BOOL data type to INT/DINT data type. *)
wLabel2
:= BOOL_TO_INT (bLabel1);
(* The conveyor starts. *)
(* The conveyor stops. *)
(* The conveyor stops with an alarm. *)
:= TRUE;
(* The conveyor starts and performs processing 100 times. *)
Count_No
+1;
: LINE1_FB
: I_Test
: O_Test
: IO_Test
: FB1
=>
D1,IO_Test
:= D100);
6
6 ST LANGUAGE
37

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents