186
Basic Ladder Diagrams
Section 4-3
4-3-4
OUTPUT and OUTPUT NOT
The simplest way to output the results of combining execution conditions is to
output it directly with the OUTPUT and OUTPUT NOT. These instructions are
used to control the status of the designated operand bit according to the exe-
cution condition. With the OUTPUT instruction, the operand bit will be turned
ON as long as the execution condition is ON and will be turned OFF as long
as the execution condition is OFF. With the OUTPUT NOT instruction, the
operand bit will be turned ON as long as the execution condition is OFF and
turned OFF as long as the execution condition is ON. These appear as shown
below. In mnemonic code, each of these instructions requires one line.
In the above examples, IR 10000 will be ON as long as IR 00000 is ON and IR
10001 will be OFF as long as IR 00001 is ON. Here, IR 00000 and IR 00001
would be input bits and IR 10000 and IR 10001 output bits assigned to the
Units controlled by the PC, i.e., the signals coming in through the input points
assigned IR 00000 and IR 00001 are controlling the output points assigned IR
10000 and IR 10001, respectively.
The length of time that a bit is ON or OFF can be controlled by combining the
OUTPUT or OUTPUT NOT instruction with Timer instructions. Refer to Exam-
ples under
5-16-1 TIMER – TIM
for details.
4-3-5
The END Instruction
The last instruction required to complete a simple program is the END instruc-
tion. When the CPU Unit scans the program, it executes all instructions up to
the first END instruction before returning to the beginning of the program and
beginning execution again. Although an END instruction can be placed at any
point in a program, which is sometimes done when debugging, no instructions
past the first END instruction will be executed until it is removed. The number
following the END instruction in the mnemonic code is its function code, which
is used when inputting most instruction into the PC. These are described later.
The END instruction requires no operands and no conditions can be placed
on the same instruction line with it.
If there is no END instruction anywhere in the program, the program will not
be executed at all.
00000
10001
10000
00001
Address Instruction
Operands
00000 LD
00001 OUT
Address Instruction
Operands
00000 LD
00001 OUT NOT
00000
10000
00001
10001
Instruction
00000
00001
END(01)
Program execution
ends here.
Address Instruction
Operands
00500 LD
00501 AND NOT
00502 Instruction
00503 END(01)
00000
00001
---