LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error -50352 at DAQmx analog write

Solved!
Go to solution

Hi,

 

I get the following error when trying to write out about 20 million data points to a PXI-6713 board:

 

Error -50352 occurred at DAQmx Write (Analog Wfm 1Chan NSamp).vi:1

Possible reason(s):

The requested memory could not be allocated.

Task Name: _unnamedTask<1>

 

 

 

I do not understand the memory error. When this happens, LabVIEW is using, according to Windows Task Manager, only 750MB of memory, maybe 950MB max, and I've run things successfully when LV was using 1.6GB of memory.  I've increased my virtual memory settings to 3GB for Windows Vista 32-bit. I have 4GB of total memory, and I have a duo core 1.8Mhz CPU. 

 

Attached is my VI. I read in a waveform of singles, do a conversion to doubles, and try to write it to the board. I use DAQmx Timing Sample Clock instead of "Use Waveform" because using the sample clock results in one less copy of the data. I read the data in as singles because that's how I'm writing it out beforehand, and it's much faster to read in singles than it is doubles. 

 

Is this something that will have to be split up into multiple writes? If so, how does that affect performance? I have a very limited timeframe (<1s) to write this data out. 

 

Thanks for any help, and please let me know if I need to provide more details. 

0 Kudos
Message 1 of 3
(3,488 Views)

Hi,

 

I started writing the waveform out in smaller buffers, and this seems to have taken care of the memory issue. I'm writing the data out using a for loop. However, on the last iteration of my for loop, e.g. iteration 7999 out of 8000, I get the following error:

 

Error -200429 occurred at DAQmx Write (Analog Wfm 1Chan NSamp).vi:1

Possible reason(s):

Measurements: Value passed to the Task/Channels In control is an empty string (or I/O control).

The value must refer to a valid task or valid channels.

 

 

 

I don't understand where this comes from. I'm passing the task straight in to the loop; does the task suddenly go null on the last iteration? 

 

Attached is my VI. Sorry that it's messy; the mess just comes from converting to and from the waveform datatype. Everything else is a straightforward TDMS read, then a write with DAQmx with the write VI in a for loop. 

 

Any advice is greatly appreciated. I feel this is a simple problem of me not fully understanding where to place different subVIs relative to the for loop. 

0 Kudos
Message 2 of 3
(3,466 Views)
Solution
Accepted by topic author Djaunl

Hi Djaunl,

 

I ran your program with a TDMS file that I created and got the same error your were seeing.  I then ran the program with highlight execution on - the little lightbulb  it the top of the block diagram. I found that the error was happening on the second loop.  This lead me to believe that it was something to do with setting up the task.  When I replaced the DAQmx clear with a DAQmx stop and this solved the issue.  The reason this solved the issue is the DAQmx clear clears out the task each time the loop runs, thus clearing your timing information.  Whe you switch to a DAQmx stop, the task setup info is not totally cleared and the error is resolved. 

Regards,
Jim Schwartz
Message 3 of 3
(3,444 Views)