LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB-6211 AO channels

Solved!
Go to solution

Hi,

 

I can’t find a clue on how I can use the USB-6211 to generate on both the AO channels simultaneously (following this advices: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019KxoSAE&l=it-IT). I need to generate the same waveform on both channels, but in my vi (here attached) I obtain always the mismatch error in the Channels number in the task (2) from the number of channels in the data (1). I have tried all the possible ways that come to my mind, but I don’t understand how to fix this.

Also because if I try to generate the AO signal on the 2 channels by adding a task in the NImax interface everything works fine without errors, except for a bit distorted on the sine wave.

Can you help me please?

 

Thank you,

Zuc

0 Kudos
Message 1 of 7
(817 Views)
Solution
Accepted by topic author Zuc_Lab

You should configure your Output Array waveform generation to generate two waveforms.

Before:

ZYOng_0-1693837982612.png

After:

ZYOng_1-1693838002151.png

 

-------------------------------------------------------
Control Lead | Intelline Inc
Message 2 of 7
(797 Views)

It took me a little while to notice you are using the example that ships with LabVIEW for AO (I recognized the "look" of the Front Panel icons from @ZYOng's reply, which is the obvious "solution", and which I hope works for you!).

 

Something to note, however, is you have specified Continuous Sampling, which means if you specify 1000 samples at 100 kHz, you will be playing the same 1000 samples over and over again 100 times a second, which sounds a bit problematic to me.  I notice on your Front Panel the "Actual Sample Rate" is shown as 1000 (Hz), which puzzles me.  One of us (almost certainly me) doesn't understand what you are doing (or trying to do) -- it is possible that you are doing something that is not easy to do with the hardware you have (I don't remember if you said what it was).  But anyway, @ZYOng's suggestion should at least get rid of the LabVIEW error so you can see if your output is what you need.

 

Bob Schor

0 Kudos
Message 3 of 7
(761 Views)

Only one doubt, why passing the channels in a for loop give me an error always in mismatch while adding more DAQmx generate Channel in series works fine? So what is the difference between these two code?

Code1.PNG

Code2.PNG

  

0 Kudos
Message 4 of 7
(738 Views)

Hi Bob,

 

even if the vi is one LabView modified example the vi i have added is not the one i using, since my vi is related to a TestStand sequence where i have to generate a tone while i do some other actions for an undefined tme interval. So that's why i have the continous option activated. Moreover this tone must be generated on both the AO channelsof the DAQmx. If you have any advices fell free explain them, i then will try to improve my skills.

 

Best Regards,

Zuc

0 Kudos
Message 5 of 7
(731 Views)

Hi Zuc,

 


@Zuc_Lab wrote:

why passing the channels in a for loop give me an error always in mismatch while adding more DAQmx generate Channel in series works fine? So what is the difference between these two code?


Because your code does NOT THE SAME!

 

In your loop you create a NEW TASK in each iteration, while in the flat version you wire the task from CreateChannel to next CreateChannel.

Solution: use a shift register to hold the DAQmxTask in your loop version… (Or flatten the channel array into one string containing a list of channels and get rid of the loop.)

 

Both options shown in the image:

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 7
(726 Views)

you're right, i was so focused on the vi that i lost the most simple thingt: how data are managed!

 

Thank you very much for the patience!

 

0 Kudos
Message 7 of 7
(683 Views)