LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Periodic waveform saving

Solved!
Go to solution

Hi,

I am working on the attached VI for temperature acquisition. The program displays the acquired data on the two graphs in real time, and save it in a file when the user hit the dedicated button.

 

I want to add a feature that save the data in the file automatically every ### measures (user-defined), and reset the graphs. I tried to do it (see the bottom right condition in the second while loop), but all the previously saved data is erased and replaced. How can I write the new data after the old one ? I don't know if I explained it well, I can give you more details if you need.

 

Thank you !

0 Kudos
Message 1 of 4
(2,620 Views)
Solution
Accepted by simchoots

Your Write to File subVI's have an input called Append?   By default, they are are False and will create a new File when you don't have a constant wired to it.

 

You need to wire a True constant to those inputs so it will append the new data to the file.

 

Is there a reason you have two while loops?  Why are you using so many local variables?  You can have seriouis race conditions going on that could cause you to duplicate data, or lose data.

Message 2 of 4
(2,604 Views)

Ugh, it was just before my eyes I knew it ! 🙂

Thanks a lot for this.

 

Two while loops : the first one manages user/software interactions, and the second one all the acquisition part.

Yes, I know about the local variables... But I don't know how to deal with this problem. In my case it's not very important to have every single point of the graph, I'm mainly worried about "big" variations of temperature in time.

 

I'm a beginner with Labview so if you have any suggestion I would welcome it.

Thanks again.

0 Kudos
Message 3 of 4
(2,593 Views)

Usually you would have two loops, but have them set up as producer/consumer where one will capture the data, and possibly the user interaction.  That is the producer.  It uses queues to pass data to the consumer loop, which would be the one to act on the data such as saving it to a file.

0 Kudos
Message 4 of 4
(2,589 Views)