When bit 21.02 turns on, it will allow the 0.1 sec pulse bit to trigger the input for counter 1. We can make a memory retentive timer using a counter and a clock bit flag. Memory Retentive Timer (Using Counter) – Omron CP1H Counters
When power is cycled on the PLC or the mode of the PLC changes from run to program, the PV of the counter is remembered. The output will remain on until the reset signal from input 21.01 is activated. Once the present value (PV) reaches 0, the counter 0 output bit will be turned on which will turn the output on. This will start to count down from the set value (SV) of 30. When bit 21.00 turns on it will enable the pulses from our magnetic pick-up sensor. Memory Retentive Counter – Omron CP1H Counters This will serve to demonstrate the counter functions. We have wired into input 0.08 a magnetic pick up that will provide pulses into the PLC. You can apply all of the following examples to the basic counter instructions. There are several ways in which we can use the counter instructions. Let’s take a look at some sample programs. You would use binary if you would like a higher count value. If you put an ‘X’ behind each of the above instructions you will indicate the same operation with values in binary. We will be covering the following basic instructions:ĬNT – Counter – This is a decrementing counterĬNTR – Reversible Counter – This will increment or decrement depending on the input.ĬNR – Reset Counter / Timer – This instruction will reset a range of timers or counters.Īll of the above instructions use BCD (Binary Coded Decimal). It is a good place to understand how timing charts can assist you in programming counters. The secret to using counters is a post that will go over timing charts. Setting, Forcing and Online Editing – Video Previously in this CP1H series, we have discussed: We will be looking at the basic Counter instructions in the CP1H along with some programming examples. The memory area for counters has separate areas for the Counter PVs (Present values) and the Counter Completion Flags.
Each of the basic instructions can be either binary or BCD. There are two basic counter instructions in the PLC.
The Omron CP1H series of programmable logic controllers are capable of having 4096 basic counters.