Example (LDI and OUT instructions)
NOTE Double assignment of relays or outputs
The result of an operation should not assigned to the same device in more than one place in
the program!
But there is an exception for every rule! You can take advantage of the top-to-bottom-execution
of a PLC program and place instructions with high priority at the end of the program to inten
-
tionally overwrite previous results. An example is shown in chapter 4.9.1. Here safety facilities
are used to reset internal devices of the PLC and bring a motor to a stop.But the outputs for the
motor are only assigned once in the whole program!
MELSEC System Q Beginners Manual 4 – 15
An Introduction to Programming The Basic Instruction Set
Ladder Diagram
MELSEC Instruction List
LDI X0
OUT Y10
IEC Instruction List
LDI X0
ST Y10
Y10
X0
OFF
ON
OFF
ON
t
(0)
(1)
(0)
(1)
The condition of the LDI instruction (poll for signal state “0”) is no
longer true so the output is reset.
X005
X003
M10
M10
X004
X001
The program is executed
sequentially from top to bot-
tom, so in this example the
second assignment of M10
would simply overwrite the
result of the first assign-
ment.
X005
X003
M10
X004
X001
You can solve this problem
with modification shown on
the right. This takes all the
required input conditions
into account and sets the
result correctly.