Question on timers

Discuss issues and ideas you have to configuring displays with PowerVision
sgibsonhmc
Posts: 8
Joined: Wed Nov 13, 2013 9:14 am

Question on timers

Post by sgibsonhmc » Wed May 21, 2014 3:09 pm

I need some information on how the timer system works so I can accomplish the following:

A variable from the can bus turns on to indicate that a feature is active. The timer needs to count, in seconds, and store the result and display it on the screen in hours, formatted as XXXX.XX. This is to track the total time that this option is used. I need to track seconds, but store hours so I can maintain a 16 bit data size over a few hundreds of hours of operation.

I know storing seconds in the displayed variable will result in huge numbers. Is a good way to do this through a second counter that increments an hour variable?

Do the counters store values remaining like a stopwatch or do they auto reset when turned off with CCM action Cancel Timer action? I assume they reset back to zero.

Is a series of state machines that jump down the sequence at each unit increment even the best way to do this?

Many devices with timers that I'm used to seeing have system variables that can be called for time remaining, setpoint, start, stop, and reset. Is there any of that, particularly time remaining, that I can use?
stalley
Enovation Controls Development
Enovation Controls Development
Posts: 618
Joined: Tue Mar 18, 2014 12:57 pm

Re: Question on timers

Post by stalley » Wed May 21, 2014 4:41 pm

Hi!

It seems you are on the right track!

I think you will need a small state machine so you know when to start counting the seconds and when to save to the hour variable.

Is this on a monochrome display or color? Why are you limiting the hour variable size? What do you expect the maximum hours to be?

If I understand your question about the timer counters, you really don't have access to what the timers use in a configuration. You have to create and manage your own.

We sometimes do something similar to keep track of the number of hours a mechanical engine is in operation but we just update an hour variable accurate to 6 minutes (0.1 hour).

Hope this helps some.
Sara Talley
Software Engineer
Enovation Controls
sgibsonhmc
Posts: 8
Joined: Wed Nov 13, 2013 9:14 am

Re: Question on timers

Post by sgibsonhmc » Thu May 22, 2014 6:52 am

Thanks for the prompt reply.

The display is a PV780. I am limited on the size of the variable to lessen the number of PGNs required to hold all of the timer data to send to a controller. I need to track sixteen different selectable options, each with a non-resetting lifetime timer and a resetable timer to use for service timers. The max hours for each should could get up into the thousands for the lifetime timers, I think. This is a prototype and the lifespan is unknown to me so I'm planning for more than I may need just to be safe.

The controller sends me data to let me know what option is being used and if its running every 100 ms over the CAN bus.

I really need to track seconds though on this because the option could be used for 5-10 sec at a time. Its not much, but thousands of on/offs do add up and should be tracked for maintenance purposes.

My background is in ladder and function block programming more than structured text, so I've used the activity programming to increment the correct timers based on the the option running.

The activity programming seems very straight forward. I think its a nice addition to the software.
stalley
Enovation Controls Development
Enovation Controls Development
Posts: 618
Joined: Tue Mar 18, 2014 12:57 pm

Re: Question on timers

Post by stalley » Thu May 22, 2014 7:20 am

Thanks for letting us know how you are using the timers. It is good to hear about the activity programming also. I too have started using the activity programming. I find it much simpler than the state machines for many of the processes we usually do with state machines.

Good luck with your project!
Sara Talley
Software Engineer
Enovation Controls