LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I selectively write data to a file programmatically?

Hello,

I'm using the LabView 7.1 Student Version.  My VI controls one analog output voltage channel and one digital output voltage channel on the USB-6009.  At the moment I can save this information every time the loop executes, which also stores a timestamp.  My question is - can I somehow program Labview to save the output voltage only when the digital output voltage changes?  I'd also like to program the time it took for the digital output voltage to change, perhaps by subtracting the last timestamp from the current timestamp.  Is  this possible?  Or do I need to process the data after it is written using another computer language?

Thanks a lot!

-S
0 Kudos
Message 1 of 3
(2,590 Views)
Hi somasudra,
i´m not sure if the student version has the event structure, but when than i recommend to use it. If the digital value changes, then you can write your value. You don´t need to create the channel everytime in the loop. Create them ones before the while loop and clear it after. To get the duration you can simply subtract one timestamp from the other.
 
Hope it helps.
Mike
0 Kudos
Message 2 of 3
(2,571 Views)
If you don't have access to the event structure you could use a case statement instead. Place the code that saves the data to file, and calculates the time difference inside the 'True' case. Use a shift register to store the digital voltage on each loop iteration. Compare the new digital voltage with the stored value and if it has changed run the True case.

Dave
0 Kudos
Message 3 of 3
(2,566 Views)