Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Help DAQmx and USB 6009

Solved!
Go to solution
Hello everyone

I do not have experience in programming in labview. The program that in annex, I did with the help of NI forum for a few months.
 
I need to collect for 7 days continuously without interruption, charging a capacitor.

However the program only works well until 7 hours, after that it gets slow. I need two samples per secunds e per channel (I use four channels in differential mode) for 7 days, it is possible? what is wrong?

I have:
  4 channels; 4 capacitoress independently attached;

I need:
obtaining two or more samples per second for seven days.

Note 1: I'm using Arduino to drive the capacitors and the DAQ 6009 to collect the voltage.
Note 2: I'm saving to .txt, because then I will open the file in another software to analyze the data. .txt is the best way?
Note 3: I divided the .txt files porquw thought would fix the problem of slowness, but is still slow after seven hours. 

Could someone help me? why program not meet what I need?
0 Kudos
Message 1 of 3
(4,372 Views)
Solution
Accepted by topic author Saille

I've had a look at your VI and found a few things:

 

Reference leaks - if you have 'Launch EXE' set to true, you are launching an executable every 100ms and creating a .NET Process object every 100ms. You need to close those references otherwise your application will grow in memory.

 

In your Leitor VI, you are constantly reading/writing an entire file from disk - just open the file outside of the loop, write the rows of data inside the loop and then close the file outside of the loop. If you need to start a new file you can close/open a new file when you need to inside the loop. Generally it is better to do file IO outside of your data acquisition loop - you should look at the producer/consumer architecture for how to do this.

 

You are also keeping the whole data array in memory which means the longer your application runs, the more memory it will use and this will cause the slowdown.

 

You are using lots of property nodes for reading/writing booleans and updating your charts - this is generally considered bad practice and you should look at proper methods for communicating between VIs (e.g. events, queues and notifiers).


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 2 of 3
(4,363 Views)

Sam_Sharp wrote:

You are also keeping the whole data array in memory which means the longer your application runs, the more memory it will use and this will cause the slowdown.


If you are trying to run a program for a long time (I'd even say over an hour), you just cannot do this.  Read a bunch and send the data to disk.  I highly recommend using the Producer/Consumer for this.  If you want to show data, use charts with keep a history, but only for X many samples.


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 3
(4,355 Views)