Help - Search - Members - Calendar
Full Version: Long totalizing timer function needed
Forums.MrPLC.com > PLCs and Supporting Devices > Omron > CX-Programmer
DaProgrammer
Using CX-One I need a function to track total time that a specific output is turned on. When the output is off I need the timer to stop but retain its value and reset only on demand. This is a filter change function for an intermittent pump that will need send a flag after say 40 hours of actual pump on-time to instruct the user to change the filter.

The standard timers zero out when the execution condition turns off and the TTIM counter maxes out at 999.9 seconds. Can anyone help with this?
d2b
DA

Have you considered using a (1 minute) timer in conjunction with a CNTR (reversible counter) to accumulate your time? I think it will work. I have done something similar with AB. Everytime the timer times out you can use a one-shot (UP) to increment the counter and a work bit to reset the timer. Does this make sense?

D2B
lostcontrol
QUOTE (d2b @ Nov 18 2009, 12:33 PM) *
DA

Have you considered using a (1 minute) timer in conjunction with a CNTR (reversible counter) to accumulate your time? I think it will work. I have done something similar with AB. Everytime the timer times out you can use a one-shot (UP) to increment the counter and a work bit to reset the timer. Does this make sense?

D2B


Or just increment a register, and only reset the register when required...
DaProgrammer
QUOTE (lostcontrol @ Nov 18 2009, 11:35 AM) *
QUOTE (d2b @ Nov 18 2009, 12:33 PM) *
DA

Have you considered using a (1 minute) timer in conjunction with a CNTR (reversible counter) to accumulate your time? I think it will work. I have done something similar with AB. Everytime the timer times out you can use a one-shot (UP) to increment the counter and a work bit to reset the timer. Does this make sense?

D2B


Or just increment a register, and only reset the register when required...


Thanks, the 1 minute TIM>>CNTR approach should work just fine.
pfort
QUOTE (DaProgrammer @ Nov 18 2009, 11:56 AM) *
QUOTE (lostcontrol @ Nov 18 2009, 11:35 AM) *
QUOTE (d2b @ Nov 18 2009, 12:33 PM) *
DA

Have you considered using a (1 minute) timer in conjunction with a CNTR (reversible counter) to accumulate your time? I think it will work. I have done something similar with AB. Everytime the timer times out you can use a one-shot (UP) to increment the counter and a work bit to reset the timer. Does this make sense?

D2B


Or just increment a register, and only reset the register when required...


Thanks, the 1 minute TIM>>CNTR approach should work just fine.


I think that lostcontrol idea was better because in case of power lost, timer and counter are reseted.
All you need is a 1 min pulse flag and an increment instruction. Comparison and reset to zero when value reached.
DaProgrammer
QUOTE (pfort @ Nov 18 2009, 12:18 PM) *
QUOTE (DaProgrammer @ Nov 18 2009, 11:56 AM) *
QUOTE (lostcontrol @ Nov 18 2009, 11:35 AM) *
QUOTE (d2b @ Nov 18 2009, 12:33 PM) *
DA

Have you considered using a (1 minute) timer in conjunction with a CNTR (reversible counter) to accumulate your time? I think it will work. I have done something similar with AB. Everytime the timer times out you can use a one-shot (UP) to increment the counter and a work bit to reset the timer. Does this make sense?

D2B


Or just increment a register, and only reset the register when required...


Thanks, the 1 minute TIM>>CNTR approach should work just fine.


I think that lostcontrol idea was better because in case of power lost, timer and counter are reseted.
All you need is a 1 min pulse flag and an increment instruction. Comparison and reset to zero when value reached.


Thats actually slightly simlpler but as a rookie programmer I want to clarify this - an Increment instruction retains its value even in the event of a power loss?
BITS N BYTES
As long as you Increment D memory, the value will be retentive.
lostcontrol
QUOTE (BITS N BYTES @ Nov 18 2009, 04:40 PM) *
As long as you Increment D memory, the value will be retentive.


Or H memory... wink.gif

Jay Anthony
CNT and CNTR are data retentive. disgust.gif
pfort
QUOTE (Jay Anthony @ Nov 19 2009, 01:27 PM) *
CNT and CNTR are data retentive. disgust.gif


OOOooooopsss wacko.gif
BobB
With the function @INC or @++ or @++L (depending on the PLC) you can increment either a DM (retentive) or CIO channel (non-retentive) as you wish - ++L is long. To reset just MOV #0000 or MOVL #00000000 into the counting channel.
Use @ or the channel will increment while ever the closk pulse is on giving you 'unexpected' results.
Mr_Ritz
I regularly use the totalising timer funtion for pump minute counters along with a long word increment, incrementing 2 DM words.

The only problem with your 1 minute counters is that the output could run 50 seconds then go off, start again and start counting the timer from the start again, hence losing best part of a minute. Over enough cycles the filter could run miles out of spec.

Use BSET function to reset once the filter has been changed.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.