Jump to content

track time in operation


Recommended Posts

I have a situation where I need to recall how long my program was in active use each day and be able to recall that to a diagnostic screen for evaluation purposes. I know I need a timer sequence that activates when my program is running, I think i have that concept covered but I need to know how/where to store that information so that I can recall it. I'd like to keep a months data and be able to scroll through it. If I understand correctly, I would use a TA type timer activated when the program is functioning and not in the idle state. Store that to a data table? recall as needed? any suggestions as to the best way to go about this?

thank you for your time.

 

j

 

Link to comment
Share on other sites

  • MVP 2022

Are you using VisiLogic or UniLogic? If VisiLogic, remember that timers can only run for 23 hours, 59 minutes, & 59 seconds. You can either set up some logic to counts days and add that to your data table, or do what I like to do. I like to use SB 13 to Increment an ML. From there you can convert to hours + tenths of an hour, formatted as HHHH.H easily by dividing by 360.

The data can easily be stored to a Data Table at whatever interval you desire. You can do this daily at midnight by turning on a bit when SI 35 = zero. Use a positive transition of that bit to store to a data table row.

Link to comment
Share on other sites

OH, Visilogic. 

The customer runs two shifts, so 23:59:59 is plenty. I need it to store whenever a run is complete and I need it to append if possible for each given day. I do not need the operator powercycling the unit and fudging with the timers. All I need in way of resolution is HH:MM. What I am needing to accomplish here is to verify that the user is actually running the machine during their shift, and documenting the amount that it is in operation. My program is basically a sandblaster controller for an automated system. It may run for 2 minutes or even 2 hours for a given pattern dimension, so I need to determine total run time for each day.

SO, I am thinking a data table that stores date: total hours operated, not necessarily by shift, just total. I'll just activate the timer when the auto routine is active and stop it when it isn't, but the storing, accumulating and appending is my concern especially regarding powercycling. How NOT to lose the data. Then how to display it on a password protected screen (which is no problem for me to do). 

 

Link to comment
Share on other sites

  • MVP 2022

You shouldn't lose any data during a power cycle. I normally have a column for date (String, 10) and time (String, 12) using RTC To ASCII #7 for date and RTC To ASCII #9 for the time. Then at each data store point I Copy Rows from Row #0 to Row #1, number rows = Data Table size minus 1. After the copy,  do a Write Row into Row #0 with the Date, Time, and the Timer value into the 3 columns.

Link to comment
Share on other sites

  • MVP 2022

No, the TA timer will not lose its value when the PLC is power cycled. However, make sure you understand how the TA timer works. It counts DOWN, not up. It also must be RESET by ladder when to reaches zero to allow it to begin to count again.

You can display the Data Table on the screen using the "Data Tables - Copy Row to vector" and then displaying the vector of MIs, breaking them into the appropriate pieces using the HMI variable ASCII String. Sadly, there is no function to just throw the whole Data Table onto the screen - you just have to do row-by-row. You can, however, display as many rows simultaneously as you have room for on the screen using the appropriate logic.

Link to comment
Share on other sites

  • MVP 2022

Now you know why I use incrementing an ML with SB 13.

Another option is to store the Preset and Current TA values in an ML, subtract one from the other and store that value in another timer to save in your Data Table if you simply must have the timer formatting. This would only require a few ladder rungs to accomplish.

This is something I rarely need in my programming so I haven't spent any time exploring alternatives. Maybe someone can offer another suggestion.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...