Timers in AOI Not Working

Tim Ganz

Member
Join Date
Dec 2010
Location
Dallas, Texas
Posts
685
I have built an AOI for tracking motor run time and have timers for seconds minutes hours days and years

The motor run is an input parameter to make the timers run and I move the acc of the timer to dint tags in the AOI and those are output parameters mapped to tags outside the AOI but the secondsds are barely updating so not sure why?
 
Perhaps you're overthinking this??
I can't think of an application where runtime seconds or minutes makes a difference. Usually hours is enough although you can be nice and calculate the number of days too.

I usually only use a retentive timer for one minute, although you can do it with one hour as well, thus saving you an awful lot of logic (it'll depend a bit whether this is for the process industry or machines that may be turned off at night regularly).

If you post the logic, we may be able to give some more pointers.
 
Post the logic. That's too vague to even take a guess with a shotgun.

and yet we all take out our shotguns.

there is no easy or polite way to say this: the quickest, best, and perhaps only, way to learn

  1. is to be wrong
  2. and to have someone show you
    1. where you are wrong
    2. the right way,
    3. or at least a better way.

Stated philosophically, the only way to learn is via humility: post your code (PDF is most generally useful).
 
There is a "P_RunTime" Add-On Instruction in the samples folders. See the pic for the full path.

It will accumulate Run Hours, and number of starts for a Pump/Motor.

Perhaps you could just use this "as-is", or use it as the basis of developing your own ....

2021-07-30_160822.jpg
 
Just as a general suggestion...One timer that runs for a longer period of time is usually going to be more accurate than shorter timers that reset frequently. For this instance, accuracy isn't probably all that critical. But it does simplify the logic having a single timer.

For example, I would not create timers for seconds or minutes. I would create a single timer that times to one hour and resets. Each time the timer finishes, add one to a counter and reset. Then use math to calculate the minutes and seconds and make those available as output parameters (along with the hour count).

Use a counter to count up the number of hours. Use math to calculate days, months, and years as needed. As stated above, in most cases hours is sufficient.

My guess is that something in your logic isn't incrementing or resetting properly. We need to see the code to offer any actual help though.

OG
 
I have built an AOI for tracking motor run time and have timers for seconds minutes hours days and years{/QUOTE]


I only use a single Timer - for SECONDS.


When the SECONDS timer reaches 60.000 seconds I SUB 60.000 from the ACC and ADD 1 to a MINUTES DINT. Putting in a RES for the timer will lose one scan count if the time log must be precise, on a SLC I have seen a RES lose up to 15 seconds a month.



When MINUTES = 60 I MOV 0 to MINUTES and ADD 1 to HOURS. 24 hours ADD 1 to DAYS, 365 days (366 if the date is ever FEB 29) ADD 1 YEAR


As for not running what I would do is OTU AOI_Ran BIT right before the AOI call, then in the AOI add XIC Timer.TT OTL AOI_Ran right after the timer rung. If this bit shows TRUE then the timer is running, but something else may be resetting it or overwriting the ACC.
 
Just as a general suggestion...One timer that runs for a longer period of time is usually going to be more accurate than shorter timers that reset frequently. For this instance, accuracy isn't probably all that critical. But it does simplify the logic having a single timer.

....

OG

Just so long as that TIMER's accumulator value is retentive on power or prog to run changes
 
I just always use an RTO driven by the running status set with a preset of 36 seconds and increment a DINT and reset it when done. The DINT represents hundredths of hours so you can display it with an implied decimal point to two places.
 
I just always use an RTO driven by the running status set with a preset of 36 seconds and increment a DINT and reset it when done. The DINT represents hundredths of hours so you can display it with an implied decimal point to two places.

Works for me, no need for anything more, accuracy is ok for "run-hours" and timing is retentive....
 

Similar Topics

I have a problem and can't find an answer anywhere. I have a ladder logic aoi to control motors. In the routine there is an alarm for failure to...
Replies
15
Views
5,705
Hi, I'm quite new to Rockwell PLC and currently trying to implement the following if Sw1 then for i:=1 to 20 by 1 do xEnable := 1...
Replies
4
Views
141
I'm writing some alterations to an FPWin program and need to see the running value of timers so I can set them correctly. It's my first time with...
Replies
0
Views
130
Hi everyone I am using Winproladder software for programming FATEK FBs PLCs and in programming, we often use Timers for activation of the...
Replies
4
Views
561
Hi all, I have what is likely not a complex issue, but I am working in Automation Studio and want an accumulating/retentive timer when a...
Replies
17
Views
1,897
Back
Top Bottom