Mitsubishi MELSEC-q Programming Manual page 67

Melsec q series; melsec l series
Hide thumbs Also See for MELSEC-q:
Table of Contents

Advertisement

4 ST PROGRAM EXPRESSIONS
4 - 27
(2) Precautions for use of bit devices
The following explains the precautions to be taken when a program is created
using an IF/CASE conditional statement in an ST program.
Once the Boolean expression (conditional expression) is satisfied in the IF
condition statement, when a bit device is turned ON in the IF condition statement,
that bit device becomes always ON.
[ST program example 1]
IF M0 THEN
Y0 := TRUE;
END_IF;
The above program is equivalent to the following.
LD M0;
SET Y0;
To avoid the bit device being always ON, change the program as shown below.
[ST program example 2]
IF M0 THEN
Y0 := TRUE;
ELSE
Y0 := FALSE;
END_IF;
The above program is equivalent to the following.
(a) LD M0;
OUT Y0;
(b) Y0 := M0;
(c) OUT_M (M0, Y0);
However, when OUT_M() is used in the IF conditional statement, the condition is
as in [ST program example 1].
The above precautions also apply to when the CASE conditional statement is
used.
Once the integer expression (conditional expression) is satisfied in the CASE
condition statement, when a bit device is turned ON in the CASE condition
statement, that bit device becomes always ON.
4 - 27

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec-l

Table of Contents