LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Thanks for all the great advice!!!


I get data from a daq card display it on a graph, and log it to a spreadsheet.But if i put a time delay in the program, with the aim of reducing the amount of values written to the file, the entire program slows down. I tried putting the delay instead in the subvi's where i do the writng to and reading from the file, but it still slows the wole program down.
0 Kudos
Message 1 of 5
(3,003 Views)
This is going to be the behavior you will see whenever you put a delay in a loop. The loop will wait for everything inside to complete (including all delays) before it procedes to the next iteration.

If you want to reduce the amount of data that you write to a file, I would recommend implementing some logic to write only on the Nth iteration. I have attached a simple skeleton VI that demonstrates how to do that. Hope this helps!
0 Kudos
Message 2 of 5
(3,003 Views)
Great, indeed.
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 4 of 5
(3,003 Views)
There is a decimate.vi on the time domain palette that you may want to use to limit the amount of data written to the file. You may also want to separate the write funtion by placing it in its' own separate while loop that will execute independent of the rest of your program.
0 Kudos
Message 3 of 5
(3,003 Views)
Typical datalogging application requires the following steps: 1. get data form DAQ board 2. Display data to the user and 3. Log data into the file.
For a long time I did these steps sequentially in a large while loop. I did not experienced any problems because I am using computers with fast chips and lost of RAM (256MB at least). The problems appear with "less powerful" PCs. Recently, I learned a better way of coding after reading on "LabView Design Patterns". I simply create a while loop for each of these tasks with the delay time for the tasks #2 and #3. The performance of the vi has improved. I also configure my DAQ vi's execution as "high priority" and "Preferred execution System" as "data acquisition". The idea here is to utilize the multithreading capabil
ities of LabView. Now, each of the loops runs in its own thread.
Message 5 of 5
(3,003 Views)