This can be changed through the setup of the PLC. The CP1H PLC has a default of 8msec input filter for the inputs. Bouncing usually occurs when mechanical relays are used in conjunction with the PLC input signal. This filter will prevent the input signal from bouncing when inputs switch. If the scan of our PLC is 1 msec then we can read the input condition 1000 times per second. This instruction is useful for resetting the entire machine timers and counters.įrequency that we can read the inputs are expressed as pulses per second which is hertz. In our example the counter range C0 to C3 is reset with bit 21.08 is turned on. The counter reset instruction can be used to reset a range of counters or timers. This will place the counter back at the SV.ĬNR – Counter Reset – Omron CP1H Counters When decrementing the counter the output will turn on when the counter decrements one past the 0. The output will turn on if the counter PV value increments one past the SV. Here is the timing chart for this instruction: The reversible counter has three inputs increment, decrement and reset. CNTR – Reversible Counter – Omron CP1H Counters Counter 2 output bit will then turn on output 100.02. In our example, when bit 21.04 is turned on it will allow the magnetic pickup pulses to activate counter 2. This means it will reset when power is turned off of the PLC or the PLC mode changes from program to run. Using a first scan flag on the reset of the counter will make the counter non-memory retentive. Non-Memory Retentive Counter – Omron CP1H Counters You can adjust the set time by the SV value or use a different clock bit value. After the counter counts down to 0 the output (100.01) will be turned on via the C0001 bit. The SV valve is set for 100 which is equivalent to 10 seconds. 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.
#TUTORIAL OMRON CX PROGRAMMER SERIES#
The Omron CP1H series of programmable logic controllers are capable of having 4096 basic counters.