Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Independent control of multiple analog outputs...

Using a PCI-6723 and LabView, I want to be able to independently switch any one (or more) of the 32 analog outputs between 0 Vdc and a continuous sinewave. Thanks.

0 Kudos
Message 1 of 7
(3,363 Views)

Hi,

 

One way you can do this is have some way to create a task with selected channels and based on user input, be able to programmatically clear the previous task (with old channel list) and create a new task (with new channel list) so that you can switch between channels that output a continuous sine wave.  The task will run forever until user decides for a new channel to be added to the task that outputs the wave. 

 

There are various ways to do what you want, it just depends on what kind of specifications you are looking for. 

 

Kyle A.
National Instruments
Senior Applications Engineer
0 Kudos
Message 2 of 7
(3,342 Views)

The best option is probably to use non-regeneration, like in this example:

 

Update Multiple Channels of AO On-The-Fly

 

 

Instead of switching between sine/square/triangle wave like in the example, you can modify the program to have a 0V DC option (initialize an array to be the appropriate length of 0s and convert to a waveform).

 

 

Best Regards,

John Passiak
Message 3 of 7
(3,330 Views)

Looks like what I need...

What determines the timing of the While Loop?

 

Thanks.

0 Kudos
Message 4 of 7
(3,318 Views)

DAQmx Write is a blocking call that will wait until all data is written before moving on.  The DAQmx Buffer is a finite length and new data cannot be written to it until more space becomes available.

 

So... if you choose "Size" to be 5k (in this case, this is the DAQmx Buffer size as well as how many samples to write per loop) and a sample rate of 10k, the loop will run at 2x per second.

 

 

 

Best Regards,

John Passiak
Message 5 of 7
(3,306 Views)

Thanks, John...

 

So the DAQmx Write waits for the device buffer to empty before it can write the next waveforms, right?

 

What sets the buffer size?

 

-Rick

0 Kudos
Message 6 of 7
(3,275 Views)

Hi Rick,

 

The buffer size will default to the size of your first write.  Alternatively, you can explicitly set it by using DAQmx Configure Output Buffer.vi. 

 

Data is streamed from this DAQmx Buffer to the on-board FIFO (2047 samples shared for all channels on the 6723).

 

 

While DAQmx Write is blocking, it checks for space to be available in the DAQmx Buffer and will write whatever it possibly can until either 1) all samples are written or 2) the timeout is reached (default of 10 seconds).

 

 

Best Regards,

John Passiak
0 Kudos
Message 7 of 7
(3,271 Views)