LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

data acquisistion slowing down

Hi,

 

I am using two different while loops to collect data from a capacitance bridge and a temperature readout. I am using PCIe-GPIB for the capacitance bridge and a PCI card for the temperature readout. Then, i am using local variables to transfer the data to a third while loop. Here , i merge the signals and then write the data to a measurement file. I need one data point every second. When I run the vi, initially i get the speed that i want. But, with time, the data acquisition gets slower for both the devices. The write to measurement file data indicates such. I have attached a snapshot of the vi i am running. Need your help with this ...

 

Thanks

Sakib

0 Kudos
Message 1 of 5
(3,170 Views)

Writing to the measurement file is the most likely cause of the problem here every time that you are running that loop you will need to open the file, locate your position and save it to the file. As the file size increases it will take longer to load the data file. If you move the write file outside of the while loop or find a way to open the file once and pass a reference through into the while loop you shold be able to only open the file once. This is going to involve moving away from the express VI however.

 

Also when passing the information between the while loops you would be better off using a queue to pass the information, how are you controlling the timing for the two information gathering loops?

Message 2 of 5
(3,148 Views)

Constantly opening and closing a file makes things SLOW.  So you will want to get away from using that Express VI.  Learn the File IO palette and also the String palette.  Between those two, you should have everything you need  to log your data.  Be sure to create/open your file before your loop and close it after the loop.  You can then write as much as you want inside of the loop.


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
Message 3 of 5
(3,115 Views)

Hi ogk.nz and crossrulz,

 

Thank you both for the ideas. I have started to write the code without using the express VIs. I have one more query, are the local variables playing a part in the slowing down process? I mean, if I replace these with queues, would that be helpful regarding the speed of the code? Actually, I am not that good with queues and sparingly used it in my codes before. Will be glad to have your syggestions on this ...

 

Thank you again. I will update you both when I am able to run the modified code.

Sakib

0 Kudos
Message 4 of 5
(3,089 Views)

The local variables will not be causing your program to slow down.  However, you have no idea when that value was written nor if there were other values that you missed.  If you need to log every value, then you need to use 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 5 of 5
(3,076 Views)