LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time delay of writing data into file affects the speed of data acquisition

Hello, I got a problem with time delay of the data writing into file. It also delays the data acquisition which I don't want. As you can see in my VI, I put the time delay only in the sub VI of writing data into file. However, it also retards the whole program. I want my DAQ to run at the normal speed but the data to be saved every 1s. If I remove the time delay of saving data, there will be too much data in the file. What should I change the time function? It might be the consequence of the position of the time block function.

 

Thank youlabview 9.jpg

Download All
0 Kudos
Message 1 of 10
(3,572 Views)

It is because the file save subVI is dertermining the loop speed.  Look into the Producer-Consumer architecture.  Basicly, your acquire and log need to be in separate loops.  Send your acquired data to the log code using a queue.


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 10
(3,563 Views)

as crossrulz said, Ive used the producer/consumer architecture for this purpose very successfully, One loop getting data then one displaying then saving to tdms. Working like a dream.

Please remember to accept any solutions and give kudos, Thanks


LV 8.6.1, LV2010,LV2011SP1, FPGA, Win7
0 Kudos
Message 3 of 10
(3,559 Views)

could you please show me how to use these functions, like creating a simple example?

 

0 Kudos
Message 4 of 10
(3,557 Views)

@Bombbooo wrote:

could you please show me how to use these functions, like creating a simple example?

 


Search the forums for "producer/consumer architecture" and look for nuggets and/or highly kudoed threads.

 

Here is just one...

 

http://forums.ni.com/t5/LabVIEW/Community-Nugget-22-08-2010-Advanced-Producer-Consumer-design/m-p/12...

 

0 Kudos
Message 5 of 10
(3,553 Views)

Have you read the link supplied earlier? also search the examples shipped with labvieq and this website. You should be able to modify one of the examples to fit your purpose.

 

let me know if you need further help tho 

Please remember to accept any solutions and give kudos, Thanks


LV 8.6.1, LV2010,LV2011SP1, FPGA, Win7
0 Kudos
Message 6 of 10
(3,552 Views)

According to the link, I am supposed to move only the sub VI of data logging into a new while loop using queues? I am still confused of the process of queuing.

0 Kudos
Message 7 of 10
(3,547 Views)

what should happen is you create a queue. Set up 2  independant while loops one above the other on the screen. In the top loop have your data capture, put the data on the queue. then in bottom loop put your save to file (or whatever you want to do with the data. (dequeue data, process). The loops will run independantly of each other ad infinitum so you will need a stop mechanism of some sort. Best bet is look at examples and work out how they work.

 

 

Please remember to accept any solutions and give kudos, Thanks


LV 8.6.1, LV2010,LV2011SP1, FPGA, Win7
0 Kudos
Message 8 of 10
(3,543 Views)

My question is that my data output from the main data stream is cluster, but the input of enqueue element is string. Do I need to extract it before plugging into it? There are also more than one outputs to be wired to the SubVI "Write to file" but there is only one input of an enqueue block function.

0 Kudos
Message 9 of 10
(3,539 Views)

here is the modified version with using queuing process (not sure if it's correct but I already followed the instructions). The problems now are the data acquisition is so delayed, and only the first value is saved in the file. Are there anything wrong with my modified VI?

 

Thank you for helping 🙂

Download All
0 Kudos
Message 10 of 10
(3,529 Views)