View Full Version : elapsed time meter

Jerry Moore
May 3rd, 2002, 07:37 PM
How do I create an elapsed time meter to monitor etm of an output using a timer. The output is a motor and I have an aux contact so I know when the output is energized.

If I use an on delay timer it will be retentive so it will acumulate time for me so what do I set my preset value at? Does it matter?

May 3rd, 2002, 08:11 PM
Jerry, I think your question is a little vague. I take it you want to monitor the times a certain output ( motor runs)? The type of plc/software can determine the precise method. If using a plc there is no need for aux contacts, the timer can be initiated when the output is energized. As far as a preset value goes are you wanting it to stop at a certain time value? Or (in the case of a On delay) start after a preset time? Zero if the latter is the case. You have to be careful here because on delay timers (again brand makes a difference) can be retentive to POWER on/off but not necessarily to input on/off...ie once started never stops until its reset.

As I stated earlier depending on the plc its possible to get time from retentive timers or using RTC (real time clocks). You may want to state the plc/software you are using and more details on your code so the more advanced people will be willing to assist.

May 3rd, 2002, 08:11 PM
I sually use a retentive timer for short durations. Are they battery backed? is so you could use them BUT...

I much prefer doing a little math.

-You just add 1 second to a register, using the PLC internal one second pulse Bit. When it reaches 60 you add one minute to another one and reset the first register to zero.

-With this same reset Bit, you add 1 minute to a register. When it reaches 60 you add one hour to another one and reset the second register to zero.

-You now have a 32000 hour metering device, roughly 4 years.

-If you use a double register, you could make it last forever...

Use a Compare function or Greater/Equal... whatever, to make some logic out of this

Jerry Moore
May 3rd, 2002, 08:44 PM
Good point about the aux contact! I'm using a Fanuc 9030 with VersaPro software. You basically answered my Q. So, if I set the preset value to 0, the on delay timer will begin timing immediatly?

I have a reset button to reset the timer. The way I understand it, the only other way to reset an on delay timer in versapro is to take the battery out of the plc. Is that right?

Thanks for the input about the math. I'm a greenhorn and it helps to hear about other ways of doing things.

May 3rd, 2002, 09:23 PM
My laptops have VersaPro on it and they arent here right now, so will be morning before I can offer specifics pertaining to the 90-30. Steve may answer before then, he is the resident GE Fanuc guru.

Tom Jenkins
May 4th, 2002, 01:12 PM
The preset on your initial timer will be 60 seconds. After 60 seconds it will trip the counter and the counter retained value will go up by one. The next scan it will reset itself and drop out. 60 seconds later the timer will trip again, and the off to on transition will make the count go up by one again. And so on and so on. I usually set the first counter preset to 6 (representing six minutes), and then use it to trip another counter that goes up by tenths of an hour. This technique is essentially platform independent.

May 4th, 2002, 02:23 PM
You need to look closely at the options they are suggesting, the On Delay timer will retain accumulated value (CV) until it reaches its limit, which is 32767 or you use the Reset. The bad part to that is that these timers are either, .10s, .01s or .001s, therefore wont make a good time meter.

You may want to look at the Time of Day feature, its possible to read it and use in many ways.

Terry Woods
May 5th, 2002, 11:35 AM
"Trust, But Verify!"

That was a popular phrase not too many years ago.

I have to take exception to the comment that...

If using a plc there is no need for aux contacts, the timer can be initiated when the output is energized.

It is certainly true that a PLC can simply turn ON an Output and then ASSUME that the particular function controlled by that Output is, in fact, operating as expected.

While, in the most strict sense, AUX contacts are not really absolutely required, it is foolish not to use them if they are available.

Building a Control System without the "Trust, But Verify" concept is "Minimalist Engineering". A system designed in the "Minimalist Engineering" style can and will work properly only as long as everything is OK. If anything goes wrong, then this system has the potential to Forkulate itself right up against one of the more unforgiving Laws of Physics... Two (or three, or four,...) bodies CAN NOT occupy the same space at the same time!

In addition to causing bodies to be in particular spaces at particular times, a control system is also supposed to prevent multiple bodies from trying to occupy the same space at the same time.

While I am sure that RS simply meant that, electrically, the AUX contact is not required to run the timer, which is true, I suggest that, logically, the AUX contact is required!

The first reason being that the PLC should KNOW that the particular device is operating as expected. (at least, to the extent that the Mag or Drive is responding to the command). There is always the possibility that the motor is running, but a coupler, chain or whatever, has broken. Other inputs are required to monitor those conditions.

The second reason is that, if the timer is supposed to be measuring the "ON-TIME" of a particular device, then the question becomes...

Are we looking for "COMMANDED ON-TIME" or "ACTUAL ON-TIME"?

If the answer is "COMMANDED ON-TIME", then the AUX contact is not required for the timer - although it is still required (or, at least, HIGHLY recommended) for the process.

If the answer is "ACTUAL ON-TIME", then the AUX contact is required for the timer as well as the process.

Now, with respect to the accumulation of time...

This depends on how your particular PLC works. If you have a 1-sec pulse that is automatically produced by the PLC, then use that pulse, as Pierre suggested, to ADD 1 to a retentive register (memory word or Double-Word).

If you don't have the automatic pulse, then do as Tom suggested to get the pulse (1-sec, 1-min, 1-hour... whatever) and then use that pulse, as Pierre suggested, to ADD 1 to your retentive "time-register".

As I recall, GE timers are "count-down" as are TI timers (S7-200 timers are "count-up"). Also, there are .1-sec, .01-sec and .001-sec timers. Decide which one you need for the particular precision you need. If you are essentially building an Hour-Meter, don't bother with the .01 or .001 timers (save them for other more critical issues); use the .1-sec timer.


.001 1001 Once per Second (+.001/-.000 Sec)

.01 101 Once per Second (+.01/-.00 Sec)

.1 11 Once per Second (+.1/-.0 Sec)

* The extra "1" at the end is to ensure that a full second has passed.

** These timers are also subject to error caused by scan time.

January 26th, 2007, 09:59 AM
I have done this before in a mitsi FX1 by using the M8013 seconds pulse to drive a cascade of retentive counters to give seconds, minutes, hours, 10's hours, 100's hours of time data you could of course go on to 1000's of hours if needed.

let me know if you need a ladder for this - this is a very flexible solution to run time hours as the data can be used for control purposes

the mitsi RTC also has a run hours function