Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx - Continuous and finite analog output running at the same time

Hello, 

 

Setup

Software - LABVIEW 2018 version 18.0.1 (64-bit) 

DAQ - USB-6211


I’ve been currently working on a rather large VI which includes machine vision and quite a number of digital and analog input and outputs to control external lights, cameras and speakers in an experimental set up. So far, Everything has gone very well but I have ran into a problem where I cannot seem to independently control two ultrasonic speakers (attached to analog outputs AO0 and AO1). The intention is to have one speaker continuously generating white noise while another speaker will play one of three different wav files when triggered by the digital falling edge of PFI5 (this trigger able activation need to respond every time the falling edge is detected and be able to change which file is played depending on the other loops in the VI). I have tried to accomplish this by creating two separate DAQmx “create channel” functions and running two loops parallel but this does not seem possible (the VI listed as “cut down VI Auditory Out” below is an example of one of many ways I have tried to do this). Each output seems to work perfectly when the other output isn’t present. I have also tried condensing everything by using a single “create channel” VI and a single loop but I cannot seem to independently control either output channel to allow for one to generate samples continuously and the other one on demand (at the same time). 

I’ve included a cut down version of my VI for simplicity sake so that the keyboard strike ‘F’ triggers PFI5 to activate Audio Loop 1. I cannot attach the .wav file apparently due to file type restrictions if you have any suggestions please let me know. 

 

Thank you,

J

 

 

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

Your DAQ can only handle 1 AO task at a time.  So if you have one task running a channel, another task cannot be ran.  You should get a resource conflict error.

 

If you want them completely independent, then you need to use another DAQ.  Another option might be to use your computer audio output for the noise and then the DAQ just for the waveform outputs.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 3
(1,746 Views)

This is what I suspected unfortunately. I have been exploring alternatives by initiating a single task for both outputs as many other VI examples show... this works if both channels require finite or continuous samples but I haven't been able to find a way to independently control each channel. Is this really the dead end? It seams super counterintuitive to have two AO channels but only be able to operate the same mode of output on both... full stop...  Are there any work-arounds that do not require me to spend an enormous amount of money or buying a completely separate DAQ (audio output from a PC will not work due to the ultrasonic nature of the output up to 70khz)?


Thank you for your quick reply,

J

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