Specifications

5-4
5.1 ST
5.1.3 Syntax in ST language
5.1.3 Syntax in ST language
The following table shows the syntax that can be used in the ST program.
Table 5.1.3-1 Syntax in the ST language
(1) Assignment syntax
(a) Format
(b) 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.
(c) Example
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;
Type of syntax Description
Assignment syntax Assignment syntax
Conditional syntax
IF THEN conditional syntax, IF ELSE conditional syntax, and IF ELSIF conditional syntax
CASE conditional syntax
Iteration syntax
FOR DO syntax
WHILE DO syntax
REPEAT UNTIL syntax
Other control syntax
RETURN syntax
EXIT syntax
<Left side> := <Right side>;