RS Logix 5000 Timer

Just as another option, I've seen a periodic task used to increment an integer every time it's called. There is logic inside to increment either the up-time counter or the down-time counter, depending on whether whatever it's timing is on or off. The counter is reset by simply writing a 0 to it, either manually or with a one-shot when the pump stops (or is restarted).
 
Surely you are only interested in hours run ?

I would use an RTO, driven by the pump running feedback, with a timebase of 1 hour (1000*60*60 = 3600000).

I would then use the timer .DN to (a) reset the timer, and (b) increment a counter, which is "hours run".

I wouldn't be too concerned with getting uber-accurate timings.

A HMI reset should only reset the counter, not the timer as well.
 
rdrast,

Without sounding too demeaning to the OP, if timers are a struggle, then I think the more 'advanced' functions of RSLogix might be a bit of a headache.

I know there are far better ways to do this than using a timer, but nowhere did it state in the post that the time had to be accurate to the degree of using the real time clock.

Mark

My point is (as always, it seems), if you want to calculate a TIME value, then use a real TIME base. Timers are not accurate as a real-time timebase. Periodic tasks are not accurate as a real-time timebase. Even the RTC isn't perfect, but it is orders of magnitude better then any other solution for monitoring things over hours, or days.

Seriously is this so hard?:

BST GSV WALLCLOCKTIME ? LocalDateTime PLC_Time[0] NXB DTR PLC_Time[5] 255 Sys_Old_Seconds OTE SYS_One_Second_OS BND 



And, just assuming accuracy isn't important is opening the door to sloppy programming.

AND it is a decent habit to get into to make a 'Utility' routine, and put all of the things into it that you are likely to need in a program, and then just drop it into every program as you start.
 
RDRast,

I couldn't agree more, all of my PLC code has the same 001_Housekeeping routine at the beginning, but take the following statement from the OP

Sorry I am new to programming,,but What is one shot Falling edge means ?
any example please.
Thanks in Advance

And then think back to how many people on this forum, many novice's like the OP, have asked about the GSV instruction.

I think Daba hit the nail on the head when he said does the OP have to be uber-accurate with hours ran. If he needs to know in seconds or minutes then yes he does need to use the GSV, but from the information that was posted I didn't think he did needed to be that accurate, which is why I gave a quick simple solution.

Mark
 
In the OP he mentioned an external system logging the ON time then, in the PLC, resetting the timer. There was no mention of the PLC calculating or maintaining the total run time. We did not get any idea of what a typical ON time might be - seconds, days, years - so it's difficult to judge the best timing method to use. But it definitely seemed that he was only interested in developing, in the PLC, one particular ON session's time.
 
I'm with rdrast (his solution looks like mine) the use of timers for totaling time is a pain. Using the second or minute pulse with an ADD is much easier.

my 2 cents...

Time.jpg
 
@jac - for the record, the DTR instruction by itself can take the place of the NEQ and the MOV instructions in your example above, for Logix 5000 applications anyway.
 

Similar Topics

If any of you wizards can help in this I would be ever more grateful. We have this device that generates 9 second pulses coming into a DI module...
Replies
31
Views
3,643
Processor: 1769-L30ER; Logix 5000: v32.02 I have an AOI that's been used in previous applications without issue, and have added a TON...
Replies
6
Views
2,777
Hi there, I am accustomed to working with Logix 500 but have a program modification I need to do on a CompactLogix.... I created a timer...no...
Replies
7
Views
2,461
Good Afternoon , I have an older Panelview Plus and do not have the application . I'm in the process of re-doing the HMI application from...
Replies
11
Views
3,921
I have 47 timers that I want to change the .PRE value in with one instruction but different values from a saved "SavedTimers" INT[46] array file...
Replies
7
Views
1,866
Back
Top Bottom