22.2 TIMERS, COUNTERS, FLIP-FLOPS, LATCHES
There are some devices, and concepts that are Temporal. This means that they keep track of events over time, as opposed to conditional logic that decides based on instantaneous conditions.
Controls that have states, or time dependence will require temporal controls (also known as sequential)
Some devices that are temporal are
Flip-Flops - these can be latched on or off.
Latches - Will stay on until reset (Similar to flip-flops)
Counters - Keeps a count of events
Timers - Allows inputs and outputs to be delayed, or prolonged be a known amount.
22.2.1 Latches
Assuming that the PLC is much faster than the fastest event (i.e. no aliasing), then we can approximate the timing diagram above with a simpler form.
As an example consider the ladder logic for a SLC-150,
In most PLCs these will keep their last state even when the PLC is turned off, and back on.
Write a short ladder logic program that will,
22.2.2 Flip-Flops
There are many type, but one of the best known is the SR (Set-Reset) Flip-Flop.
22.2.3 Timers
We use timers to do some or all of,
When using timers (especially retentive) we must reset values when done. The (RES) instruction does this.
The timers also have timer timing bits that indicate when the accumulator value is changing.
Consider the example below, Write out the values for the accumulator, enable, timer timing and the done bits.
Repeat the last example for the timer below.
Consider the example of the SLC timers given below,
As an example,
When more than one event should happen in a sequence, timers can be cascaded. This means that the end of the first timer starts the next.
As an example,
22.2.4 Counters
Count up/count down counters will track input events.
Count down counters are similar but can be used for convenience.
Consider the example below for a SLC-150,
Write a simple program that will,