186
FX
3U
/FX
3UC
Series Programmable Controllers
Programming Manual - Basic & Applied Instruction Edition
7 Basic Instruction
7.12 SET, RST
Explanation of function and operation
SET instruction drives the coil for an output relay (Y), auxiliary relay (M), state relay (S) and bit specification of
data register (D).
1. When using a bit device
SET instructions located in parallel can be used consecutively as many times as necessary.
In the program example shown below, "RST Y000" after "SET Y000" corresponds to this usage.
2. When using a word device (timer or counter)
Use RST instruction to reset a counter or retentive type timer.
1) Program example of an internal counter
C0 up-counts the number of turning ON from OFF at X011.
When the counting result reaches the set value K10, the output
contact C0 is activated. Even if X011 changes from OFF to ON
after that, the current value of the counter remains unchanged
and the output contact remains activated.
For clearing the counter and returning the output contact, X010
is set to ON.
It is necessary to specify a constant K or data register number
for indirect specification after OUT C instruction.
In the case of latched (battery backed) type counters, the
current value and the operation status/reset status of the output
contact are latched even after power failure.
2) Program example of a high speed counter
For 1-phase 1-input counters C235 to C245, use special
auxiliary relays M8235 to M8245 for specifying the counting
direction.
X010 in ON status: Specifies down counting.
X010 in OFF status: Specifies up counting.
When X011 turns ON, the output contact of the counter
C
UUU
is returned and the current value of the counter
C
UUU
is reset to "0".
In counters with reset input (C241, C242 ...), the same situation
is achieved by interrupt operation when the corresponding reset
input turns ON, but any program is not required for this
operation.
When X012 turns ON, turning ON/OFF of a counting input X000
to X005 determined according to the counter number is
counted.
In counters having start input (C244, C245 ...), counting is
started only after the corresponding input turns ON.
When the current value of a counter increases and reaches the
set value (K or contents of D), the output contact is set. When
the current value decreases and reaches the set value, the
output contact is reset.
As a contact driving the counting coil of a high speed counter, program a contact which is normally ON
when high speed counting is executed.
If an input relay (X000 to X005) assigned for high speed counters is used for driving the counting coil,
accurate counting cannot be achieved.
ON
ON
ON
Circuit program
List program
Timing chart
X000
SET
Y000
X001
RST
Y000
X000
X001
Y000
0 LD
X000
1 SET
Y000
2 LD
X001
3 RST
Y000
SET
instruction
RST
instruction
X010
RST
C 0
X011
C 0
Y000
C 0
K10
X010
M8
UUU
Counting direction
X011
RST
C
UUU
Sequence reset
circuit
X012
C
UUU
K or D
C
UUU
Y002
Counting coil