LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

time totalizer \ elapsed time

Solved!
Go to solution

for all who can answer: Is there a way that an elapsed time "totalizer" can be constructed? Im trying to implement a program that will measure elapsed time a particular heating element will be on. Since the heating element will come on multiple times, the elapsed time needs to start where it stopped and continue counting until the next cycle, etc. if the heating element is tested over the course of a couple of months, the totalizer function will come in very handy for FMEA (failure mode effects analysis) to see the total time the element was on . Im using a case structure to control wether the timer is active (true case) and a compare function for the voltage to output a true or false (0 volts = false, 120 volts = true). the timer\totalizer would need to operate only in the true case.

0 Kudos
Message 1 of 13
(3,904 Views)
Solution
Accepted by topic author Myke

Here is an easy way to do it with shift registers.

Message 2 of 13
(3,884 Views)

@MStewart wrote:

Here is an easy way to do it with shift registers.


You could take it one step further and turn that VI in to a functional global variable, and simply call if from anywhere in your code to start or stop the time.

Message 3 of 13
(3,880 Views)

MStewart: that's pretty cool. I think I was on the same track as you but the train on the brain stopped before it got to what you posted. I had shift registers and the date and time to seconds in a case structure. I can duplicate that for the 15 heating elements that I have in a single while loop.

Thank you.

 

BowenM: how could you turn it into a global? Saw something like this already as a global but it didn't work like I wanted. It kept resetting. 🙂

 

0 Kudos
Message 4 of 13
(3,876 Views)

True.  You could add lots of potentually useful states (Pause, Reset, Set Start Time, etc.), if it was made into a functional global.  I was just trying to keep it simple.

0 Kudos
Message 5 of 13
(3,873 Views)

ya know you guys..... I wouldn't mind seeing that.Cat Very Happy

0 Kudos
Message 6 of 13
(3,868 Views)

This is a modification of something I have used before.  I'm sure you can figure out what you need from here and add states as required. Do a search for "LabVIEW functional global variables" to see more of how to implement and control it.

 

Edit: File is now in 2012. It looks like some of the code I cut out destroyed the "Resume" function. It still should be enough to get the general idea...

Message 7 of 13
(3,861 Views)

BowenM, anyway you could save that for LV 2012? I haven't gotten the upgrade yet. I will certainly look that up though. I gave you and MStewart kudos , but you guys are awesome!!!

 

 

0 Kudos
Message 8 of 13
(3,854 Views)

Myke,

 

Here is a version of the timer as a functional global.  I made an example vi to show how you might use it in your test cycle; alongside other test functionality.

Download All
Message 9 of 13
(3,836 Views)

MStewart,

Thanks for doing that. I decided to do a little something like that and just reworked it a bit. Dropped the pause on a case structure and put the timer inside. seemed easier to do it that way for what I wanted to accomplish. The pause is going to be a good thing to have in the event that the heater needs to be turnd off and worked on for any reason, and it won't accrue time or cycles. Used a "in range and coerce" to compare minutes and seconds and then wired a 4 to 15 mA simulated signal to to the timer. All I got to do now is duplicate it 14 more times and then to work on the cDaq part of it to control relays through dig out signals, and sequence the whole thing to write a file for the analog in. Thanks alot for your help and BowenM too. like I said: you guys are awesome. Got me to thinking in other directions.

 

 

Download All
0 Kudos
Message 10 of 13
(3,727 Views)