From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

how to save data in a way like queue or stack?

Hi everyone,

I have problem finding the suitable function to save data into txt or TDMS like queue or stack. Could anybody show me some sample to save data like that?

The data is generated in a while loop and the data is saved outside of the loop. In the past, I used "build table" VI to add data generated in each loop into the table and save them all in the file after the while loop is over. However, the "build table" VI is time consuming and it is executed for every loop thus slowing down the speed of the program.

To increase the efficiency of the program, I am now using a shift register and stack structure to add all the data into a stack and save them all in the file after the while loop is over. This method is still consuming some time.

I hope I can use a function to save file in a way like stack so that it can save data generated from each loop outside the while loop, and it can add the new data to the end of former data without overwriting the former data. Is there such function to do so?

Thanks

best

0 Kudos
Message 1 of 6
(4,504 Views)

Producer/Consumer


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 6
(4,497 Views)

Dear 

I know the structure of producer/consumer. Actually I want to find a data saving VI that will add the new data behind the former data without overwrite it. The "build table" VI is actually doing such thing but it is time consuming and it needs to work inside the loop. Is there any VI can save the data outside the while loop? Do you have any suggestion?

Thanks

best

0 Kudos
Message 3 of 6
(4,488 Views)

Take a look at this quick example

 

 

Randall Pursley
0 Kudos
Message 4 of 6
(4,476 Views)

Dear

Can you save the file in early version of Labview? I am using Labview11 and I can not open this file.

Thanks very much!

best

0 Kudos
Message 5 of 6
(4,459 Views)

OK.

Randall Pursley
0 Kudos
Message 6 of 6
(4,419 Views)