Jump to content

Recommended Posts

Posted

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

 

  • MVP 2023
Posted

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.

Posted

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). 

 

  • MVP 2023
Posted

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.

Posted

ok, sounds simple enough, I think I can muddle through that, getting it stored, if the timer has NOT written its data to the table, and the user power cycles the machine, will the timer data still be there? OR will it start from the beginning? how do I display the data table information on the screen when I need it?

 

  • MVP 2023
Posted

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.

  • MVP 2023
Posted

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.

  • MVP 2023
Posted
26 minutes ago, prairiecreek said:

I understood that TA was an accumulated timer, ie counting up

The Help file, especially with timers, is extremely, er, helpful. Also, don't hesitate to try stuff then go online with the PLC to see what happens.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.