Ladder Logic Latch / Unlatch Instructions

KronoTech

PLC

Ladder Logic

Basic

XIC

XIO

OTE

ONS

OTL

OTU

Basic Motors

Counters

Timer

Arithmetic

Comparison

Functions

Trig Functions

RSLogix 5000

Structured Text

HMI

Instruments

OTL - Latch /

OTU - Unlatch

  • Turns a bit on when the rung is executed, and this bit retains its state when the rung is not executed or a power cycle power occurs.
  • OTL is a retentive output instruction. OTL can only turn on a bit. This instruction is usually used with OTU with both OTL and OTU addressing the same bit.
  • Ladder logic can examine a bit controlled by OTL as often as necessary.
  • When you assign an address to the OTL instruction that corresponds to the address of a physical output, the output device wired to the screw terminal is energized when the bit is set. When rung conditions become false, the bit remains set and the corresponding output device remains energized.
  • Actuating the latch input turns the function on or causes it to change state. The function then stays on even if the latch input is turned off. To turn the function off, another input must unlatch which turns the function off.

Example 1

In this example we need to start/stop the motor. When the start button is pushed we want to start the motor, and when the stop button is pushed we want to stop the motor. Mind you when you the push buttons is pushed the input will go on as long as the button is pushed otherwise it will go off.

Input / Output

  • Start Button I:1.0/1
  • Stop Button I:1.0/2
  • Motor O:2.0/1

Ladder Logic Solution A

The important part in this example is to keep the signal on even when the operator releases his finger from the push button. What we really need to do is to latch the input signal for both start and stop. This is not a usual way to start a motor. This is only to demonstrate the use of the Latch/Unlatch instructions.

By pressing the start push button the input I:0/1 will be on and hence bit B3:0/0 will be On too. Once the operator release the start button. The start button input signal will go Off but B3:0/0 will stay on because of the OTL (Latch) instruction that we have used. This bit will stay on as long as the Stop button is not pushed.

otl SLC 500 Beginners Guide

Once the stop button is pushed the rung will evaluate to true and hence the OTU (unlatch) instruction will kick in and release the bit B3:0/0.

otu SLC 500 Beginners Guide

When bit B3:0/0 is on or off; the motor will be energized or de-energized

otl SLC 500 Beginners Guide

Ladder Logic Solution B

This problem could also be solved with another technique. The rung below will result to the same solution as the previous method. How does this work?

Rung0: When we press on the start button the rung will evaluate to true hence the motor will be energize.

Once the start button is release it's input will go off but the motor will stay on since we have the motor as a by pass to the start button. Therefore the motor will keep running. Now, once we press the stop button. The rung will evaluate to false, and that is how we stop the motor.

otu SLC 500 Beginners Guide

Example 2

This example is about a bi-directional motor (Forward/ Reverse). Each direction has its own button and only one button to stop the motor. We also need to stop the motor before we change its direction.

Input / Output

  • Forward Button I:1.0/3
  • Reverse Button I:1.0/4
  • Stop Button I:1.0/5
  • Motor Forward O:2.0/3
  • Motor Reverse O:2.0/4

This resembles a lot to the previous example the only difference is REV_MOTOR since we had a condition that says we should stop before we change direction. What we did here is, put the stop button on both directions of the motor and then we check to see if the direction that we want to run is clear, we do that by checking if the opposite direction is not running.

Test 1:
  • Stop button is off
  • Forward button is pushed
  • Motor is not running in any direction
  • Motor will run in forward direction.
Test 2:
  • Stop button is off
  • Reverse button is pushed
  • Motor is running in forward direction
  • Motor will NOT run in Reverse direction
Test 3:
  • Stop button is pushed
  • Motor is not running
  • Reverse button is pressed
  • Motor will run in reverse direction
Test 4:
  • Stop button is off
  • Forward button is pushed
  • Motor is running in reverse direction
  • Motor will NOT run in forward direction

When the stop button is not pushed and the motor is not running in reverse direction. If we push the forward button the motor forward output will be energized, and it will also be latched in forward.

otl SLC 500 Beginners Guide

When the stop button is not pushed and the motor is not running is forward direction. If we push the reverse button the motor reverse output will be energized, and it will also be latched in reverse.

otu SLC 500 Beginners Guide

Note

This means that we cannot switch direction unless we stop the motor from running, that is only when we can change the direction of the motor. To stop the motor we have to press the stop button.

Quick Links

PLC Languages

Ladder Logic
Function Block
Structure Text
SFC
Mnemonic

Ladder Logic

Basic
Counters
Timer
Arithmetic
Comparison
Functions
Trig Functions

Instruments

Switches

HMI

Advantages
Alarms
Trends

Other

Bottle Application