05-22-2014 02:13 PM
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.
Solved! Go to Solution.
05-22-2014 04:06 PM - edited 05-22-2014 04:09 PM
Here is an easy way to do it with shift registers.
05-22-2014 04:09 PM
@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.
05-22-2014 04:15 PM
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. 🙂
05-22-2014 04:16 PM
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.
05-22-2014 04:20 PM
ya know you guys..... I wouldn't mind seeing that.
05-22-2014 04:24 PM - edited 05-22-2014 04:30 PM
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...
05-22-2014 04:28 PM
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!!!
05-22-2014 05:49 PM
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.
05-30-2014 04:17 PM
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.