08-17-2010 02:43 PM
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.
08-18-2010 10:26 AM
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.
08-18-2010 11:37 AM
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,
08-18-2010 02:55 PM
Looks like what I need...
What determines the timing of the While Loop?
Thanks.
08-18-2010 04:28 PM
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,
08-19-2010 12:57 PM
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
08-19-2010 01:06 PM
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,