LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to save limited data sample when saving data using write to measurement file ?

Solved!
Go to solution

Hi All,

I am trying to save data in labview using save button for which i followed some tutorials and made it. Now my problem is i need the data to be stopped at 2048 samples even though the save button is pressed for long time. Can somebody help me 

0 Kudos
Message 1 of 4
(2,968 Views)

Can you save your sample to an earlier Version of Labview so that more people can read your VI? That would be great.

 

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

Hi sai321,

 

When you say you need the data stopped at 2048 samples, do you mean that you want your data acquisition to stop at 2048 samples? Or are you only looking to save 2048 samples total? Also I'm a bit unclear on what you mean when you say "even though the save button is pressed for a long time". Looking at your code, you would probably benefit from a producer/consumer architecture. You can read more about that here: http://www.ni.com/white-paper/3023/en/

You could have your acquisition data push to a queue, and then a separate loop that handles your write to measurement file. This would ultimately result in whatever you're trying to do to be easier to implement while also following recommended practices. Plus you learn something new!

 

Also, I saved your VI in LabVIEW 2013 for you so that more people will be able to open your VI.

Mark M.
Applications Engineering
National Instruments
0 Kudos
Message 3 of 4
(2,910 Views)
Solution
Accepted by topic author sai321

I didn't run your VI but here would be my thoughts based on what I see.

 

So, a few things. In the DAQ Assistant Express VI, you have the VI acquiring 25k samples on 4 channels. And your save button has a switch when released. So when you press the button, it'll switch and each loop, it'll save 25k samples. Alternatively, you can change the mechanical action of the switch to latch from switch. When you change it, labview will only read true with the button once then reset it. So it'll only save the data once. However, you still will get too much data, since you are reading 25k samples. To get less data, you have two options. Change the number of samples in the DAQ Assistant for each channel to 2048 instead of 25k. Alternative, you can use another express VI called Extract Portion of Signal to crop it. You could also downsample the the signals using Align and Resample. So lots of options.

Message 4 of 4
(2,905 Views)