12-19-2011 03:18 PM
Hi everybody,
I'm new to these forums and I am currently evaluating Labview for a series of lab tests where we measure energy balance in a chemical reaction. I've already
I have a USB 6008 wired to a relay drive (thanks to these forums) and a heating element and I want to measure the total time heating element is 'on' during 24 hours to calculate the energy the system is getting. The heating element switches on and off based on the signal of a thermocouple. Is there an easy way to measure the seconds that the output port wire to the heating element is active? Device-independent would be preferable (like measuring the signal uptime of the input of the digital output of the USB6008)
I tried a lot of options today, like while loops, sequences, case structures following several postings here but all of them failed miserably - while the problem sounds so easy. I could easily do it in the hardware by wiring the output of the relay drive to a bauser timer, but that would be giving up too soon 🙂
Any help would be appreciated.
Best regards,
Dimitri
12-20-2011 11:36 AM - edited 12-20-2011 11:37 AM
Hi Dimitri,
Welcome to the NI Forums! It's good to hear that you've already received some help here.
Q: Is there an easy way to measure the seconds that the output port wire to the heating element is active?
A: Yes! The method we can use to perform this action depends on the sort of architecture that you're using at the moment, however we can take advantage of the section of your code which defines whether the line should be on or off. When it's on, using a While Loop we can use a Timestamp to keep track of the current System clock; this Timestamp will update on every loop iteration. If we use a reference Timestamp which is created outside of the While Loop when we first begin to drive the line high, we can simply work out the difference between the current Timestamp and the reference Timestamp to get the total time.
This kind of code will also be device independant because it relies only on the computer it is used on.
I hope this helps!
12-20-2011 04:39 PM
Thanks, after a couple of hours of puzzling the attached setup seems to work. Going to test a little more and then post the vi.