Posted 20 Jun 2006 (edited) Hello, What's a good way to count hours within the CLX? I have a pump sequence that I next to rotate every 168 hours. With a SLC I would just use a TON with a 1 second base, preset to 3600, and counter for the total hours. Since the CLX timers only have a mSec base, I'm thinking there must be a better way than using multiple TON instructions. Or can the CLX timer handle a preset greater than 32767? On Edit; I should have read further on the TON instrution help, the preset is a DINT! Thanks, Big_K Edited 20 Jun 2006 by BIG_K Share this post Link to post Share on other sites
Posted 20 Jun 2006 The maximum preset of a timer in Controllogix is 2147483647 2147483647 Milliseconds 2147483 Seconds 35791 Minutes 596 Hours 24 Days I hope my math is right, never needed to time something for that long using this method. I usually use the WallClockTime to do things like this on a hourly, daily or monthly basis. This is probably the easiest for a weekly basis It will do it but I would suggest you put some scaling on your accumulated even if it is only so you can view it in your program so you can keep your sanity Well I see you figured it out before I got done typing but there is some details. It is also possible to calculate the day of the week if you wish to switch it on a certain day Share this post Link to post Share on other sites
Posted 20 Jun 2006 Thanks TWControls, I knew counting seconds may not be the best method, especially with mSeconds. I'll have to do more reading on the WallClockTime, never knew such existed, but I don't usually get to play with CLX either. Regards, Big_K Share this post Link to post Share on other sites
Posted 20 Jun 2006 In RsLogix 5000 at the top go to Help, Vendor Sample Projects. The last one is DayOfWeek.acd. It shows you how to calculate what day it is off of the WallClockTime Share this post Link to post Share on other sites
Posted 20 Jun 2006 (edited) Ditch the timer instruction and wall clock time altogether and use the TOT instruction. Create a tag of type TOT - named RunHours in this example. Fix RunHours.IN at 1.0 RunHours.EnableIn is set when the device is on, clear when the device is off. Fix RunHours.Timebase = 2 for hours. Viola, an hours totalizer that will provide run time as a floating point time at RunHours.Total, including the fractional hours that the device has run. You can also use .Target and .TargetFlag to activate alarms for maintenance or whatever when the accumulated run hours reaches a certain point. For example, I use targets to indicate when it is time to change the oil in a vacuum pump in one application. When the target is reached and the work is completed then resetting the target is done by just adding the needed value for the hours needed until the next maintenenace to the target. Refer to the online help on the TOT instruction. Even though the TOT instruction will have to reside in a FB or ST routine, it can be controlled entirely from a ladder routine by writing to the RunHours tag elements in ladder. EDIT: I attached an example. MotorRunHours.ACD Edited 20 Jun 2006 by Alaric Share this post Link to post Share on other sites
Posted 21 Jun 2006 Cannot comment on Alaric's TOT instruction, but I can say beware of the Wall Clock Variable. The GSV and SSV needed to access the Wall Clock are scan time hogs. They take significantly longer than most other high level instructions. Share this post Link to post Share on other sites
Posted 21 Jun 2006 TOT? Can't see it, don't have the addins. Alaric, can you paint a picture for those of us in the ladder age? Share this post Link to post Share on other sites
Posted 21 Jun 2006 Second that emotion. Maybe someone with Acrobat can post a jpg of the TOT for us "Stone Age Types" LOL Share this post Link to post Share on other sites
Posted 21 Jun 2006 Yes I guess I need break down and purchase the addins Share this post Link to post Share on other sites
Posted 21 Jun 2006 (edited) Here is Alaric's example done in .gif. I have never used this method myself but it does look interesting... Edited 21 Jun 2006 by TechJunki Share this post Link to post Share on other sites
Posted 21 Jun 2006 I have use many of the user defined objects but not a TOT. Looks interesting Ill have to try it. I dont have a high enough version to view the logic. We are not going to upgrade untill 16.0 Junki has an interesting color choice though. Share this post Link to post Share on other sites
Posted 21 Jun 2006 Here it is as a PDF. MotorRunHours.pdf Share this post Link to post Share on other sites
Posted 21 Jun 2006 Interesting. It is very clean. Might be time for me to purchase it Share this post Link to post Share on other sites
Posted 21 Jun 2006 Thanks for the file! Now, how does one get the TOT instruction? I have opened a FB sheet but can't find the TOT block. TWControls mentions purchasing an add-on, what is this add on called for those like me that have yet to learn the CLX as well. Thanks in advance. Share this post Link to post Share on other sites
Posted 21 Jun 2006 If you can open a FB sheet you have everything you need. TOT is under process instructions. I also recommend you also look up the instruction in the documentation so that you understand what it is doing. Share this post Link to post Share on other sites
Posted 21 Jun 2006 Thanks, it helps when you use the arrow over button to see all of the FBs under the Process tab. Share this post Link to post Share on other sites
Posted 22 Jun 2006 (edited) Actually Microsoft Paint changes the color to that greenish tint when I save the picture format as a .gif. I don't have an option for saving as .jpg, must be an old version?? so I am stuck with .gif format for now. Edited 22 Jun 2006 by TechJunki Share this post Link to post Share on other sites
Posted 22 Jun 2006 I must be blind because I still not seeing the greenish tint Share this post Link to post Share on other sites
Posted 22 Jun 2006 I think Techjunki is referring to the navigation bars above the ladder code in his screen shots (as well as the dialog box in one of the earlier captures. Instead of showing the typical gray color, his version of Paint is rendering the color as an interesting shade of green. Your PC resolution and color settings may also be preventing you from seeing this. Rick Share this post Link to post Share on other sites