Mitsubishi Electric MELSEC iQ-F FX5 Programming Manual page 47

Program design
Hide thumbs Also See for MELSEC iQ-F FX5:
Table of Contents

Advertisement

■When a bit type label is used
Once the Boolean expression (conditional expression) is satisfied in a conditional statement or an iteration statement, the bit
type label that is turned ON in <Statement> is always set to ON.
Program whose bit type label is always set to on
Ex.
ST program
Ladder program equivalent to ST program
bLabel1
IF
bLabel1
THEN
bLabel2
:= TRUE;
END_IF;
To avoid the bit device to be always set to ON, add a program to turn OFF the bit type label as shown below.
Program to avoid the bit type label to be always set to ON
Ex.
*1
ST program
Ladder program equivalent to ST program
IF
bLabel1
THEN
bLabel1
bLabel2
:= TRUE;
ELSE
bLabel2
:= FALSE;
END_IF;
*1 The above program can also be described as follows.
bLabel2 := bLabel1;
or
OUT(bLabel1,bLabel2);
However, when the OUT instruction is used in <Statement>, the program status becomes the same as the program whose bit type label
is always set to on.
■When a timer function block or counter function block is used
Boolean expression (conditional expression) in a conditional statement differs for the execution conditions of the timer
function block or counter function block.
Ex.
When a timer function block is used
Program before change
IF
bLabel1
THEN
TIMER_100_FB_M_1(Coil:=bLabel2,Preset:=wLabel3,ValueIn:=wLabel4,ValueOut=>wLabel5,Status=>bLabel6);
END_IF;
(* When bLabel1 = on and bLabel2 = on, counting starts.
(* When bLabel1 = on and bLabel2 = off, the counted value is cleared.
(* When bLabel1 = off and bLabel2 = on, counting stops. The counted value is not cleared. *)
(* When bLabel1 = off and bLabel2 = off, counting stops. The counted value is not cleared. *)
Program after change
TIMER_100_FB_M_1(Coil:=(bLabel1&bLabel2),Preset:=wLabel3,ValueIn:=wLabel4,ValueOut=>wLabel5,Status=>bLabel6);
When a counter function block is used
Program before change
IF
bLabel1
THEN
COUNTER_FB_M_1(Coil:=bLabel2,Preset:=wLabel3,ValueIn:=wLabel4,ValueOut=>wLabel5,Status=>bLabel6);
END_IF;
(* When bLabel1 = on and bLabel2 = on/off, the value is incremented by 1. *)
(* When bLabel1 = off and bLabel2 = on/off, the value is not counted.
(* The counting operation does not depend on the on/off status of bLabel1. *)
Program after change
COUNTER_FB_M_1(Coil:=(bLabel1&bLabel2),Preset:=wLabel3,ValueIn:=wLabel4,ValueOut=>wLabel5,Status=>bLabel6);
An error occurs when the program before change is used since the statement related to the timer or counter is not executed
when the selection statement is not satisfied.
SET
*)
*)
*)
6 ST LANGUAGE
6.1 Configuration
bLabel2
bLabel2
6
45

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents