LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW stores data to disk without being told to

I am using LabVIEW 7.0 with a SCXI 1000 chassi which has an 1100 module for thermocouple measurements and an 1180 direct feed through. The DA card is a PCI-6024E.

I have developed an application that is acquiring a total of 25 channels at a rate of 5000 hz using Daqmx. I am using continuous data acquisition and then a gate/trigger to sort the data out and process/chart it. I use the daqmx buffer configure to set the input buffer to 400 000 since I noticed without this the system misses some data since it is monitoring a cyclical system that cycles once every 3.0 seconds. I then read the data using a 1D waveform read, N channels N samples daqmx subvi.

The computer is a pentium IV 2.4 GHz with 500 MB of ram. I
t isn't connected to a network and is dedicated soley to running this program.

The problem I am seeing is that if I reboot the computer, the first two or three times I run the program it seems to store the data to disk and cause extremely long processing times of up to 100 seconds for one process cycle of monitoring - 3.0 seconds. The reason I think it is storing to disk is that I see the hard drive light come on and stay on while this happens.

Once I have stopped and started the program two or three times, it works flawlessly without any indication it is reading or writing to disk.

Can anyone help me eliminate this? Thanks.
0 Kudos
Message 1 of 6
(3,022 Views)
Is it possible that the OS is increasing the swap file size (What is you OS?) due to increasing memory demands? Try setting a minimum swap file size in the OS configuration. You should pick a value for the minimum size slightly above the size after a few runs of the program.

You might also want to carefully inspect your code to eliminate unnecessary extra data copies.
Message 2 of 6
(3,022 Views)
mhtl wrote:

> I am using LabVIEW 7.0 with a SCXI 1000 chassi which has an 1100
> module for thermocouple measurements and an 1180 direct feed through.
> The DA card is a PCI-6024E.
>
> I have developed an application that is acquiring a total of 25
> channels at a rate of 5000 hz using Daqmx. I am using continuous data
> acquisition and then a gate/trigger to sort the data out and
> process/chart it. I use the daqmx buffer configure to set the input
> buffer to 400 000 since I noticed without this the system misses some
> data since it is monitoring a cyclical system that cycles once every
> 3.0 seconds. I then read the data using a 1D waveform read, N
> channels N samples daqmx subvi.
>
> The computer is a pentium IV 2.4 GHz with 500 MB of ram. It isn't
> connected to a network and is dedicated soley to running this program.
>
> The problem I am seeing is that if I reboot the computer, the first
> two or three times I run the program it seems to store the data to
> disk and cause extremely long processing times of up to 100 seconds
> for one process cycle of monitoring - 3.0 seconds. The reason I think
> it is storing to disk is that I see the hard drive light come on and
> stay on while this happens.
>
> Once I have stopped and started the program two or three times, it
> works flawlessly without any indication it is reading or writing to
> disk.

That is not LabVIEW but the Windows memory swapping. As you start the
data acquisition you tell NI-DAQ to allocate an intermediate buffer of
about 25 * 400000 * 2 bytes = 20'000'000 bytes. Then in LabVIEW you read
that data in 3 second intervals = 3 * 5000 * 25 * 4 bytes = 1.5MB and
this data gets several times allocated for the display graph and
possibly several more copies for your diagram wiring depending on how
you did it. So LabVIEW requests a lot of memory from Windows at startup
and Windows will start to swap out some if its own less used libraries.
After the first few iterations the memory situation has settled down and
as long as you don't make another memory intense application to come in
the foreground, this will stay like that.

Expect trying to reduce the different buffers and possibly review your
diagram for some inefficient wiring, the only other solution is to
install even more RAM into your computer if you can.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 3 of 6
(3,022 Views)
Rolf, that seems to be the problem... I can see from the system monitor that Labview starts up with something like 14 or 15 MB assigned and then climbs up to around 400 MB when I start running the program. Once it gets to around 400 MB it seems to run fine.

Do you have any quick hints for what you mean by inefficient wiring. The program is quite large and I am asking it to do a lot. Since I am not a programmer by trade I may have caused some problems there.

As well, is there any way in Windows to assign a program a certain memory usage allotment. I looked around on the web but couldn't find anything. Since I am only running this program, If I can get it to allocate the amount of memory up front then I might as well try it?
0 Kudos
Message 4 of 6
(3,022 Views)
Swapping memory is relatively fast unless the OS needs to constantly incremetally grow the swap file. Above, I have mentioned to make sure the swapfile does not need to be dynamically resized.

Here is a relevant aplication note:

http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/9c654bf862c049c786256cc4005ea4ad?O...

An excellent writeup on issues related to dealing with large data sets is the following document:

Managing Large Data Sets in LabVIEW.

This is certainly something you should read.
0 Kudos
Message 5 of 6
(3,022 Views)
Thanks for the information.

I was able to reduce the memory usage of the program quite simply by, as you recommended, reducing the number of data copies.

I used the VI memory profiler tool to find out that I had created 25 memory copies by converting each channel being acquired(25 channels) from waveform to dbl type. By acquiring the data in the first place in dbl type I was able to avoid this step and save around 250 MB of memory.

I also got rid of the Trigger and Gate function that I was using and used a much simpler triggering method of my own. As a result I was able to reduce the memory requirements down to about 127 MB from around 405 MB! As an added bonus the program execution time went from 1.5 seconds down to less than
0.1 seconds.

Thanks again. Very helpful.
0 Kudos
Message 6 of 6
(3,022 Views)