LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital Output with DAQmx - Large Arrays

I'm developing a program in LabVIEW to feed a (long) string of commands to some Analog Devices DDS hardware. We're looking at updates  of 32 bits at a time at rates on the order of 3.5 MHz. I've got everything working for short times, and have just begun trying to expand to long (1 second +) sets of output data, and I'm encountering a few problems. I've read the NI application note on improving speed and performance and I've searched here - that's resolved some problems, but I'm still left with this big one.

   At the moment, we're storing each set of 32 bit output data as a U32 integer for most of the program, then converting to digital waveform to be passed to the DAQmx strobed output routine. I can't find a way to do this step without requiring huge amounts of memory - ~350 MB for a 1 second sequence. I think the high memory usage is due to a large number of seemingly inevitable buffer duplications. The process goes something like: (VI is attached - the following description is included because it's not yet documented).
    - Input array of U32 [~3 million entries]
    - Initialize 2D array of I8 [0...3M][0..31]
    - Use the input array of U32 as indexed input to a FOR loop; 2D array is put into a shift register
    - For [0...3M] convert U32 -> Array[0..31] of Boolean {buffer}
    - Use a second for loop and a selector to convert T -> 1 and F -> 0, with numbers in I8 (instead of the I16 used by LabVIEW's default conversion routine) {buffer}
    - Store the array[0..31] of I8 as row n of the 2d array
    - Use 2D array to build digital table
    - Use digital table to build digital waveform {buffer}
    - Use build array to make digital waveform into the only element of an array of digital waveforms (as required by the DAQmx output routine) {buffer}

  So - any ideas on how I can cleverly get rid of some of the buffering? Or am I doomed to have to change the data structures? Digital tables don't look like a very convenient data type to work in, but if I must I will.
0 Kudos
Message 1 of 8
(4,942 Views)
Is there a reason you need to use the digital waveform datatype?  Why not select the instance of DAQmx Write
that uses the original U32 array?   See attached pic...

-Kevin P.


ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 2 of 8
(4,905 Views)
Well. I don't know whether to shout for joy (because it now works very quickly) or lock myself in a dark cupboard for not having noticed that option earlier. Many thanks - both for your help and for being kind about my drama over something with such a simple solution!
0 Kudos
Message 3 of 8
(4,894 Views)

Hi 

I have the exact same problem.

I record 32bit digital 2d array with digital read daq mx.

Then I wanna read that recorded data back. But when I try to use the 32 bit digital 2d write I only get output from the first channel and the other channels doesnt give anything out.

 

Can anyone here help me?

 

Regard Carl Zandén 

  

0 Kudos
Message 4 of 8
(4,522 Views)

It is hard to tell what is going on from your screen shot.  Where are you doing the reading?  I see a TDMS read near the middle left, but the green digital waveform wires hits the boundary of the sequence frame and doesn't seem to go anywhere.

 

Please post your VI and provide a little more description as to where in the VI your problem is occurring.

0 Kudos
Message 5 of 8
(4,508 Views)

Hi.

 

The reading of the digital data is done elsewhere and stored as 32bit 2d array in a TDMS file. When I check the data with TDMS file viewer everythings seems to be in order. All the channels have data.

 

 The problem:

When I use the Digital 2D U32 Nchan Nsamp to write the 32bit 2d array and measure (on the actual output pins), I only see the outcoming data from the first line (pin). The other pins don't give out anything.

 

However when I convert the 32bit 2d array into a digital waveform and write it with "Digital 1dWFM 1Chan NSamp", there is outcoming data on all the pins. The problem is the recordings are huge and the conversion to digital waveform takes too much memory.

 

To sum up:

The problem is really simple. I need to solve this issue: Record 11 digital lines with 32bit data (2d array), store it in tdms, and play it back up. 

 

I would be extremly grateful. I have tried everything and it just doesn't seem to be working. 

 

ps. Im using an NI USB 6229  DAQ.

 

I can't attach VIs. I keep getting unexpected error.

 

Regards 

Carl Zandén 

 

Message Edited by Carlz on 05-07-2009 02:31 AM
0 Kudos
Message 6 of 8
(4,494 Views)
Here are two screenshots that focus better on the problem.
Download All
0 Kudos
Message 7 of 8
(4,490 Views)

This is the VI. Just change the ending from .jpg to .vi

 

 

0 Kudos
Message 8 of 8
(4,488 Views)