Mitsubishi Electric MELSEC Q Series Programming Manual page 78

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

Advertisement

IF THEN conditional syntax
■Format
IF <Boolean expression> THEN
<Syntax ...>;
END_IF;
■Description
The syntax is executed when the value of Boolean expression (conditional expression) is TRUE. The syntax is not executed if
the value of Boolean expression is FALSE.
Any expression that returns TRUE or FALSE as the result of the Boolean operation with a single bit type variable status, or a
complicated expression that includes many variables can be used for the Boolean expression.
■Example
IF bool1 THEN
intV1 := intV1 + 1;
END_IF;
IF ...ELSE conditional syntax
■Format
IF <Boolean expression> THEN
<Syntax 1 ...>;
ELSE
<Syntax 2 ...>;
END_IF;
■Description
Syntax 1 is executed when the value of Boolean expression (conditional expression) is TRUE.
Syntax 2 is executed when the value of Boolean expression is FALSE.
■Example
IF bool1 THEN
intV3 := intV3 + 1;
ELSE
intV4 := intV4 + 1;
END_IF;
5 WRITING PROGRAMS
76
5.1 ST

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec f seriesMelsec l series

Table of Contents