Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How to output data continuously, using array indexes?

Hello,

I have an application that using MATLAB script, creates two arrays. One 7 channels digital output data, and the second 2 channels of analog data. In general what i need to do is to output those 9 channels synchronously.

The problem is size of generated arrays, sometimes i need arrays of 2-3 millions data points. In order to overcome the problem i need to be able to control the output data.

For example:

Array size 100k points.

1. Output data form 0 to 5000 once -> 

2. Output data from 5001 to 10000 (100 times) ->

3. Output data from 10001 to 50000 once ->

4. Output data from 50001 to 100000 continuously.

 

The very important thing is that transition between 1,2,3 and 4 must be continuous.

 

Now the technical part:

I'm using PXI-6251.

The analog output rate is 1M sample per channel.

 

Thanks in advance.

 

Izia Elman

0 Kudos
Message 1 of 5
(3,320 Views)

Hi Izia,

 

Thanks for the post and I hope your well.

 

What you need to do is write into the DAQmx buffer while the code continous to output data from the buffer.

 

 You can setup a standard AO Voltage DAQmx task and set the samples per channel to 1000 (size of the buffer). Then upon every loop iteration (which is self timed by the DAQmx Write) use the DAQmx Write property node to select where in the user buffer to write new data.

 

 

An example of this can be found here,

DAQmx AO Regeneration - Dynamically Updating User Buffer Data

http://zone.ni.com/devzone/cda/epd/p/id/2148

 

This example edits the user buffer in Regeneration mode - which allows the daq driver to continually iterate through and output the data in the user buffer, which resides in the computers memory (not the buffer on the daq device).

 

Please let me know what you think,

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
Message 2 of 5
(3,311 Views)

Hi James,

 

Thank you for quick reply.

 

I'm not experienced LABview user, for that reason, some points in your solution are unclear to me.

1. Does it mean that for each step in data generation I need a new DAQmx write  and its property node (for my example I will need 5)? 

2. How can I issue step no.2? How can I run only a part of buffer  N times?

3. What about data regeneration? In my case it is prohibited to use data regeneration, each data point must be controlled.

 

Thank you.

 

Izia

0 Kudos
Message 3 of 5
(3,289 Views)

Hi izia,

 

Thanks for your reply and I hope your well today.

 

Your questions are fair,

 

So for data regeneration the idea is if you placed the property node and the DAQmx Write in a case structure, if you didn't send the output any new waveform then it would just continue to output whats in the buffer. If you wish just to output a certain known waveform - and then thats it then you can just use a single write. And build the waveform before the DAQmx code executes. 

 

You could use the waveform build functions to build a waveform, and a for loop to loop and add sections of waveforms together to form your requested waveform.

 

My example's benefit was it was regenerative.

 

Take a look at the example attached - LabVIEW 8.6. Maybe this is more what you require,

 

Hope this helps,  

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
Message 4 of 5
(3,249 Views)

Hi James,

 

Thank you for the reply, it seems that generating final output waveform in LabVIEW could be acceptable solution for this case.

I'll work on it.

 

Thank you

 

Izia Elman

0 Kudos
Message 5 of 5
(3,208 Views)