Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmxRead memory full

Dear all,

I use a PCI board to send a pulse, apply a voltage and adquire a voltage signal.

However my vi crashes after the adquisition of 2-3 data points.

The displaied error comes from the DAQmxRead module and indicates that the buffer memory is full.

 

I've tried to increase the virtual memory of my computer (as indicated in other posts of this forum), and I've tried to reduce the memory usage of my vi with some software adjustments.

The problem isn't solved, and my vi still crashes after few data points adquired:

Note: the vi keep running picking the points comings from the last wave signal adquired, but not this adquisition, nor the pulse and voltage are sent to the hardware.

 

Can it be that the problem is related to some wrong settings of the PCI board ?

 

Each operation (pulse and voltage output, and voltage in) are assigned to different tasks and channels, each started and stoped at each cycle (cycle: voltage out -> pulse out -> voltage in).

 

Thank you for your help.

0 Kudos
Message 1 of 14
(3,587 Views)
Your program is almost certainly at fault but since you food not attach a VI or an image of the block diagram, it's impossible to say what you need to change.
0 Kudos
Message 2 of 14
(3,583 Views)
Stupid Swype. Should be 'you did not attach'.
0 Kudos
Message 3 of 14
(3,580 Views)

Well, it was lunch time, so food is OK too... 🙂

0 Kudos
Message 4 of 14
(3,573 Views)

Hi,

thanks for the reply.

 

I'll be able to post some pictures tomorrow (I'm in europe, now it's late evening).

But, as an idea, I have 2 sequenced steps:

- 1 - create tasks, configure them (task1 set pulses output, task2 voltage out put, task3 set clock and configs of voltage adquisition)

- 2 - a "for" loop in which :

                   - a - apply voltage (start task2)

                   - b - simultaneously send pulse (start task1) and record the voltage (start task3)

                   - c - collect the data and stop all tasks

 

Can this be helpful ?

0 Kudos
Message 5 of 14
(3,569 Views)
No, it does not help. How are you configuring the read? Continuous or finite? You only need to start and stop the tasks once. Typically, you do not place them in s loop.
0 Kudos
Message 6 of 14
(3,565 Views)

Wow, that's quick answer 😄 thank you so much !

 

Well,

I need to apply different voltages, that why I put the loop.

But the problem occurs also in a smaller sub vi that only performs those 3 tasks without loop. (reminder: task1 - apply voltage; task2 - send voltage pulse; task3 - record voltage waveform)

Weird thing to me is that if I close and re-start this small vi often it crashes anyway. To get to the point that I actually adquire some signals I have to restart the computer !

That's why I thought the problem could be in the PCI hardware.

 

The read is set continous.

 

First thing I'm gonna do tomorrow is to post the frames of my vi.

Thank you so much again for your help ! I really appreciate it.

0 Kudos
Message 7 of 14
(3,559 Views)

Hi OresteMadia!

 

What you are experiencing is classical behavior of a memory leak. Do you clear your tasks? If you close and restart your application enough times without clearing the tasks, the calls stack up to allocate a lot of memory without deallocating the previous memory. Also, as mentioned above, in some situations using DAQmx functions in a loop is not adviced.

I encourage you to take a look at these pages. They might give you some information on how to correct your issue:

http://digital.ni.com/public.nsf/allkb/BAF29EE03747EE4B86256E9700541436?OpenDocument

http://www.ni.com/white-paper/6831/en/

 

Also, taking a look at your VI would definitely be helpful towards fixing your problem.

Best regards,

Rasmus Pettersson

Application Engineer | National Instruments

0 Kudos
Message 8 of 14
(3,534 Views)

That was very helpful ! Thanks 🙂

 

Althought I still have some problem, but this time I attached the Vis !

 

The Vi "measurement" is the one I will use as subVi for the complete measurement for different voltages.

The Vi "Loop" is just an example of what I need to do.

 

As suggested in this Forum, I added a control to check the available samples in the buffer.

 

Problem:

First time I launch the Vi "measurements" the measurement works fine and the check gives back around 24000 samples available (as you can see the check is BEFORE the actual DAQmxRead).

The Second time I launch the Vi, the measurement still works, but the count of available samples drops to approx 12000.

Finally the third time I see the entire 2GB of buffer available and the error DAQmxRead -50410 "No more space in the buffer when new data was written".

Once the error is received the only way to make it work again is to restart the computer.

 

This description generally applies for the default values in the Vi here attached.

Of course this problem occurs, after the collection of a couple of data points, in the complete and final measurement in which I have to scan for several Voltages.

Download All
0 Kudos
Message 9 of 14
(3,513 Views)

Hi again OresteMadia,

 

I have been looking through your codea bit. Frankly, the code has a lot of inconsistencies. It's also hard to get a grip on what you are actually trying to do with all the for -loops that iterate once and the stacked sequence structure. I would suggest on refining your code to look something similar to this:


DAQmx_ex.JPG

I also noticed that some of the tasks dont get closed properly. This might contribute to your problem. Please make sure that you stop every task and clear the task after creating them. Also, if you start tasks in a loop in your main VI ("loop.vi"), If you run the loop fast or even moderately fast, it might cause some memory problems and irratical behavior since creating DAQmx tasks take a while to load. If you open too many tasks with the same name (or too many tasks in a loop at all) it will cause memory problems.

 

Can I also ask what DAQmx driver version are you using?

 

I hope this helps you towards your solution!

 

Best regards,

Rasmus Pettersson

Application Engineer | National Instruments

0 Kudos
Message 10 of 14
(3,485 Views)