Mitsubishi Electric MELSEC iQ-R Series Programming Manual page 72

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

Advertisement

■ When a FOR...DO statement is used
• A structure member or array element cannot be used for the iteration variable.
• Match the type used in the iteration variable with the types of <final value expression> and <increase expression>.
• <Increase expression> can be omitted. If omitted, <increase expression> is assumed to be 1.
• If 0 is assigned to <increase expression>, the portions after the FOR statement may no longer be executed or an infinite
loop may occur.
• In the FOR...DO statement, the iteration variable count processing is performed after execution of <statement>in the FOR
statement. If the count processing is executed in such a way that it exceeds the maximum value of the iteration variable
data type or is below the minimum value, an infinite loop occurs.
■ When instructions executed at the rising edge or falling edge are used
• The following table lists the operations of when instructions executed at the rising edge or falling edge used in the IF or
CASE statement.
Condition
Conditional
formula of IF or
CASE statement
TRUE or CASE match
TRUE or CASE
mismatch
*1 On the falling edge (on to off), the instruction is not executed because the condition of the IF or CASE statement is not satisfied.
Ex.
When the PLS instruction (execution condition: rising edge) is used in the IF statement
IF bLabel0 THEN
PLS(bLabel1, bLabel10);
END_IF;
bLabel0
OFF
bLabel1
OFF
On/off
OFF
determination
result
bLabel10
OFF
(1) When bLabel0 is off (the conditional formula of the IF statement is FALSE), the on/off determination result will be off. The PLS instruction is not executed.
(The bLabel10 remains off.)
(2) When bLabel0 is on (the conditional formula of the IF statement is TRUE) and bLabel1 is off (the instruction execution condition is off), the on/off
determination result will be off. The PLS instruction is not executed. (The bLabel10 remains off.)
(3) When bLabel0 is on (the conditional formula of the IF statement is TRUE) and bLabel1 is also on (the instruction execution condition is on), the on/off
determination result will be off to on (rising edge). The PLS instruction is executed. (The bLabel10 is on for one scan.)
6 STRUCTURED TEXT LANGUAGE
70
6.1 Configuration
Instruction
On/off
execution
determination
condition (EN)
result of the
instruction in the
last scan
TRUE
On
Off
FALSE
On
Off
TRUE
On
Off
FALSE
On
Off
ON
ON
(1)
(2)
Operation result
On/off
determination
result of the
instruction
On
On
Off
Off
Off
Off
Off
Off
ON
ON
(3)
ON
1 scan
Instruction at the
Instruction at the
rising edge
falling edge
Not executed
Not executed
Executed
Not executed
Not executed
Executed
Not executed
Not executed
Not executed
Not executed
Not executed
Not executed
Not executed
Not executed
Not executed
Not executed
*1
*1

Advertisement

Table of Contents
loading

Table of Contents