Mitsubishi Electric MELSEC Q Series Programming Manual page 68

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

Advertisement

4 ST PROGRAM EXPRESSIONS
4 - 28
(3) Precautions for use of timers and counters
The following explains the precautions to be taken when a program is created
using an IF/CASE conditional statement in an ST program.
In the IF condition statement, the Boolean expression (conditional expression)
differs from the execution condition of the timer/counter instruction.
Example: In the case of timer
[ST program example 1]
IF M0 THEN
TIMER_M (M1, TC0, K10);
END_IF;
(* When M0 = ON and M1 = ON, counting starts.
(* When M0 = ON and M1 = OFF, counting is cleared.
(* When M0 = OFF and M1 = ON, counting is stopped. The counting
(* value is not cleared.
(* When M0 = OFF and M1 = OFF, counting is stopped. The counting
(* value is not cleared.
Example: In the case of counter
[ST program example 2]
IF M0 THEN
COUNTER_M (M1, CC0, K10);
END_IF;
(* When M0 = ON and M1 = ON/OFF, counting is incremented by 1.
(* When M0 = OFF and M1 = ON/OFF, counting is not executed.
(* M0 = ON/OFF and counting incrementing by 1 are not synchronized. *)
The above occurs since the timer/counter-related statement is not executed if
the IF condition statement is not satisfied.
When the AND condition of M0 and M1 is used to operate the timer/counter, do
not use the control syntax but use only the MELSEC function.
[Changed ST program example]
• When timer is used
• When counter is used
Using the new program, the timer/counter can be operated under the AND
condition of M0 and M1.
The above precautions also apply to when the CASE conditional statement is
used.
In the CASE condition statement, the integer expression (conditional expression)
differs from the execution condition of the timer/counter instruction.
TIMER_M (M0 & M1, TC0, K10);
COUNTER_M (M0 & M1, CC0, K10);
*)
*)
*)
*)
*)
*)
*)
*)
4 - 28

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l series

Table of Contents