Mitsubishi Electric MELSEC iQ-F Series Programming Manual page 59

Hide thumbs Also See for MELSEC iQ-F Series:
Table of Contents

Advertisement

■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.
When the timer or counter is operated according to the AND condition of bLabel1 and bLabel2, do not use any control
statement, just use a function block only.
Using the program after change operates the timer and counter.
■When the FOR...DO statement is used
• Structure members and array elements cannot be used as repeat variables.
• Match the type used for a repeat variable with the types of <Last value expression> and <Incremental expression>.
• <Incremental expression> can be omitted. When omitted, <Incremental expression> is treated as 1 and executed.
• When 0 is assigned to <Incremental expression>, the statements after the FOR syntax may not be executed or the
processing goes into an infinite loop.
• In the FOR...DO syntax, the counting process of repeat variables is executed after the execution of <Statement⋅⋅⋅> in the
FOR syntax. If the count is greater than the maximum value or smaller than the minimum value of the data type of the
repeat variable, the processing goes into an infinite loop.
*)
*)
*)
6 ST LANGUAGE
6.1 Configuration
6
57

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec iq-f fx5

Table of Contents