Syntax In St Language - Mitsubishi Electric MELSEC Q Series Programming Manual

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

Advertisement

Syntax in ST language

The following table shows the syntax that can be used in the ST program.
Type of syntax
Assignment syntax
Conditional syntax
Iteration syntax
Other control syntax
Assignment syntax
■Format
<Left side> := <Right side>;
■Description
The assignment syntax assigns the result of the right side expression to the label or device of the left side. The result of the
right side expression and data type of the left side need to obtain the same data when using the assignment syntax.
■Example
intV1 := 0;
intV2 := 2;
Array type labels and structure labels can be used for the assignment syntax.
Note the data types of left side and right side.
• Array type labels
The data type and the number of elements need to be the same for left side and right side.
When using array type labels, do not specify elements.
< Example >
intAry1 := intAry2;
• Structure labels
The data type (structured data type) needs to be the same for left side and right side.
< Example >
dutVar1 := dutVar2;
Description
Assignment syntax
IF conditional syntax
CASE conditional syntax
FOR DO syntax
WHILE DO syntax
REPEAT UNTIL syntax
RETURN syntax
EXIT syntax
IF THEN conditional syntax
IF ELSE conditional syntax
IF ELSIF conditional syntax
Assignment syntax
Page 75 Assignment syntax
Page 76 IF THEN conditional syntax
Page 76 IF ...ELSE conditional syntax
Page 77 IF ...ELSIF conditional syntax
Page 77 CASE conditional syntax
Page 78 FOR...DO syntax
Page 78 WHILE...DO syntax
Page 79 REPEAT...UNTIL syntax
Page 79 RETURN syntax
Page 80 EXIT syntax
5 WRITING PROGRAMS
5.1 ST
5
75

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec f seriesMelsec l series

Table of Contents