You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old July 30th, 2021, 09:08 AM   #1
Tim Ganz
Member
United States

Tim Ganz is offline
 
Join Date: Dec 2010
Location: Dallas, Texas
Posts: 623
Timers in AOI Not Working

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?
  Reply With Quote
Old July 30th, 2021, 09:14 AM   #2
Nova5
Member
United States

Nova5 is offline
 
Join Date: May 2013
Location: Northern Snowball
Posts: 365
Post the logic. That's to vague to even take a guess with a shotgun.
__________________
Problems that go away on their own mystically are not solved. They will return.
  Reply With Quote
Old July 30th, 2021, 09:29 AM   #3
JeremyM
Lifetime Supporting Member
United States

JeremyM is offline
 
Join Date: May 2014
Location: Dallas, Texas
Posts: 586
"barely updating"

Are you maintaining a steady run input?
  Reply With Quote
Old July 30th, 2021, 10:31 AM   #4
cardosocea
Member
United Kingdom

cardosocea is offline
 
Join Date: Nov 2016
Location: Fields of corn
Posts: 1,941
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.
  Reply With Quote
Old July 30th, 2021, 10:51 AM   #5
drbitboy
Lifetime Supporting Member
United States

drbitboy is offline
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 3,336
Quote:
Originally Posted by Nova5 View Post
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).
__________________
i) Take care of the bits, and the bytes will take care of themselves.
ii) There is no software problem that cannot be solved with another layer of indirection.
  Reply With Quote
Old July 30th, 2021, 11:10 AM   #6
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
Join Date: Jul 2004
Location: uk
Posts: 5,344
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 ....
Attached Images
File Type: jpg 2021-07-30_160822.jpg (16.6 KB, 103 views)
__________________
___________________________
ControlLogix & SLC Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
Everything works with smoke. Let it out, and it stops working.

Nil Carborundem Illegitimi



  Reply With Quote
Old July 30th, 2021, 11:34 AM   #7
Operaghost
Member
United States

Operaghost is online now
 
Operaghost's Avatar
 
Join Date: Apr 2002
Location: Dallas, TX USA
Posts: 3,323
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 despise when people take random quotes and ascribe them to me - Julius Caesar
  Reply With Quote
Old July 30th, 2021, 11:36 AM   #8
I_Automation
Member
United States

I_Automation is offline
 
I_Automation's Avatar
 
Join Date: Jun 2020
Location: Detroit, Michigan USA
Posts: 618
[QUOTE=Tim Ganz;891482]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.
  Reply With Quote
Old August 2nd, 2021, 05:18 PM   #9
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
Join Date: Jul 2004
Location: uk
Posts: 5,344
Quote:
Originally Posted by Operaghost View Post
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
__________________
___________________________
ControlLogix & SLC Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
Everything works with smoke. Let it out, and it stops working.

Nil Carborundem Illegitimi



  Reply With Quote
Old August 2nd, 2021, 06:01 PM   #10
OkiePC
Lifetime Supporting Member
United States

OkiePC is offline
 
OkiePC's Avatar
 
Join Date: Mar 2005
Location: ENE of Nowhere Oklahoma
Posts: 11,100
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.
__________________
You've been taken, but you don't know it yet.
  Reply With Quote
Old August 2nd, 2021, 07:57 PM   #11
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
Join Date: Jul 2004
Location: uk
Posts: 5,344
Quote:
Originally Posted by OkiePC View Post
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....
__________________
___________________________
ControlLogix & SLC Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
Everything works with smoke. Let it out, and it stops working.

Nil Carborundem Illegitimi



  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Programming Exercise: Sorting Algorithm w/Dynamic AOI Results Paullys50 LIVE PLC Questions And Answers 19 January 29th, 2017 05:32 PM
AB AOI design Inputs, Outputs, or InOuts? abishur LIVE PLC Questions And Answers 5 November 16th, 2016 09:55 AM
MicroLogix 1400 - Modifying timers from the LCD Screen? rustydud LIVE PLC Questions And Answers 11 November 6th, 2015 02:35 PM
logix 5000 stl - calling AOI from AOI italo2008 LIVE PLC Questions And Answers 3 June 29th, 2015 02:22 AM
FX3U timers mechtec LIVE PLC Questions And Answers 4 July 19th, 2013 03:34 PM


All times are GMT -4. The time now is 05:30 PM.


.