×

Subscribe to newsletter

subscribe to our weekly newsletter to get notified with latest story and article Subscribe now!




PLC BLOG | Omron PLC Counter

Share on Facebook Share On Twitter Share on LinkedIn Share on Whatsapp


Omron PLC counter programming instructions CX-Programmer

A Counter That Counts Input Pulses Or Events Count Maybe Up, Down Or Both . It's Depends On Type Of Counter. Counter Track An Events Of How Many Times Has Occurred. For Example Counter Used To Count How Many Products Produced Or Delivered. Counter Count When Input Pulse Change From True To False Or False To True. Than Compare The Result With Preset Value And Current Value. If Both Are Equal To Each Other Than Counter Process Is Completed. In Omron Plc Counter Are Generally Two Type Binary And Bcd Counter And Than Sub Classified As Following

How many types of counter in omron?

omron have following timer

  • CNT: BCD decrementing counter.
  • CNTX: Binary decrementing counter.
  • CNTR: BCD REVERSIBLE COUNTER
  • CNTRX : Binary REVERSIBLE COUNTER


structure of omron counter

following image shows all counter block.

structure of omron counter

  • N: Counter number - The counter number must be between 0000 and 4095 (decimal). for example C0000, C0001 etc. range is same for BCD as well as binary counter.
  • S: Set Value - for BCD counter set value between #0000 to #9999, and binary counter range from &0 to &65535 (decimal) or #0000 to #FFFF (hex) .


CNT- OMRON BCD decrementing counter

CNT is BCD type decrementing counter. this counter decrement by 1 of Set value every time that the count input goes from OFF to ON. when the counter PV value is set to zero than counter operation completed and counter done bit is set to true. PV = SV - 1 every count input change from false to true. range of counter set value 0000 to 9999.

OMRON BCD decrementing counter

above example shows simple example of omron CNT counter. in this example C0005 is counter number and #100 is SV value, P_1s is set every 1 second pulse bit. I:0.03 reset bit of counter. when counter input I:0.02 is set to true counter decrement SV by 1 until it reaches 0. when PV reaches to zero than counter operation stop and counter bit set to 1. Reset bit reset counter.


CNTX- OMRON binary decrementing counter

CNTX is binary type decrementing counter. this counter is also decrement counter and operation is same as BCD decrementing counter. SV value range from &0 to &65535 (decimal) or #0000 to #FFFF (hex).

OMRON binary decrementing counter

Note:- reset bit of counter: if reset bit is true so timer PV value never decrement. Always make reset bit false when not required.


CNTR: OMRON BCD REVERSIBLE COUNTER

CNTR is use as increment and decrement counter. Counter increment by 1 every timer when increment input goes from false to true and decrement by 1 every time when decremented input change from OFF to ON. if both increment and decrement input is set to true than PV value not change, so it work only one case either increment or decrement. reset bit reset counter.

OMRON BCD REVERSIBLE COUNTER

  • I:0.07 incremental input of counter
  • I:0.08 decrement input of counter
  • I:0.09 reset counter
when incremental input(I:0.07) change to true than a pulse bit set true every 1 second and counter increment start from 0., if Increment input set to false and decrement input set to true than counter PV value is decrement by at every 1 second pulse bit. in increment operation counter operation complete if increment bit true and decrement bit false and PV value is equal to Set value.in decrement operation counter operation complete if decrement bit true and increment bit false and PV value is equal to 0. if counter complete it operation in increment case PV value set to zero and in decrement case Pv value is set to set value.


CNTRX: omron binary REVERSIBLE COUNTER

operation is same as BCD REVERSIBLE COUNTER only deference of set value range range is start from &0 to &65535 (decimal) or #0000 to #FFFF (hex).

omron binary REVERSIBLE COUNTER

reset timer and counter in omron

for reset timer and counter have special instructions as following
  • CNR : RESET BCD TIMER and COUNTER
  • CNRX : RESET Binary TIMER and COUNTER


CNR/CNRX : omron RESET TIMER and COUNTER instruction

Resets the timers or counters within the specified range of timer or counter numbers. structure of CNR and CNR/CNRX
  • N1: First Number in Range, N1 must be a timer number between T0000 and T4095 or a counter number between C0000 and C4095
  • N2: Last Number in Range, N2 must be a timer number between T0000 and T4095 or a counter number between C0000 and C4095

omron RESET TIMER and COUNTER instruction

above is sample code for CNR and CNRX in first rung when input is changed from false to true than CNR instructions reset all the counter range from C0 to C10 and set PV value to 9999 for BCD and FFFF for binary, counter's done bit set to false. second rung reset all the timer from T0000 to T0010 and set timer done bit to false.


example of omron PLC counter

example of counter

shows a basic example where counter set value set by move instruction. counter PV value move to D0 for another use.

 
Share on Facebook Share On Twitter Share on LinkedIn Share on Whatsapp


Suggested Post


 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

comment