Control Statements - Mitsubishi Electric MELSEC iQ-R Series Programming Manual

Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

Control statements

The following table lists the control statements that can be used in ST programs.
Item
Assignment statement
Subprogram control statement
Select statement
Iteration statement
Write control statements in one-byte characters.
Assignment statement
Format
<Left side>:=<Right
side>;
When using an array type label and structure label, note the data types of the left side and right side of the assignment
statement.
For array type labels, the data type and the number of elements need to be the same between the left and right sides. When
using array type labels, do not specify elements.
Ex.
intAry1:=intAry2;
For structure labels, the data type of the structure needs to be the same between the left and right sides.
Ex.
dutVar1:=dutVar2;
6 STRUCTURED TEXT LANGUAGE
62
6.1 Configuration
Description
Assignment statement
Function block and function call statements
RETURN statement
IF statement (IF THEN, IF ELSE, IF ELSIF)
CASE statement
FOR statement
WHILE statement
REPEAT statement
EXIT statement
Description
This statement assigns the result of the right side expression to the label or device on the left side.
The data types of the result of the right side expression and the left side need to be the same.
Reference
Page 62 Assignment statement
Page 64 Subprogram control statements
Page 65 Select statements
Page 66 Iteration statements
Example
intV1:=0;
intV2:=2;

Advertisement

Table of Contents
loading

Table of Contents