LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Generate and Output a Mixed Signal (Sine + Square Wave) to Control an Attenuator Using USB-6211 in LabVIEW?

Hello NI Community,
I am working on a project where I need to generate a mixed signal (combination of sine and square wave) and output it through the analog output (AO) channel of a USB-6211 DAQ device to control an attenuator. The goal is to vary the intensity of the attenuator using this mixed signal.
Here’s what I have done so far:
  1. Hardware Setup:
    • Connected the USB-6211 DAQ device to my computer.
    • Connected the attenuator to the AO0 channel of the USB-6211.
  2. Software Setup:
    • Installed NI-DAQmx drivers and LabVIEW with the DAQmx library.
    • Signal Details:
      • Sine wave: Frequency = 1 kHz, Amplitude = 6mV.
      • Square wave: Frequency = 500 Hz, Amplitude = 6mV.
  3. Testing:
    • I tested the setup with a simple sine wave, and it works fine. However, I want to ensure that the mixed signal is generated and output correctly to control the attenuator.
Questions:
  1. Is this approach correct for generating and outputting a mixed signal to control an attenuator?
  2. Are there any specific considerations or best practices I should follow to avoid signal distortion or ensure proper operation of the attenuator?
  3. How can I verify that the mixed signal is being output correctly (e.g., using an oscilloscope)?
  4. Are there any example VIs or resources that could help me refine this implementation?
Any guidance, suggestions, or example code would be greatly appreciated!
Thank you in advance for your help!
0 Kudos
Message 1 of 5
(302 Views)

Hi devv,

 


@devv2425 wrote:
3. How can I verify that the mixed signal is being output correctly (e.g., using an oscilloscope)?

You can verify the mixed signal quite easily:

When it comes to "real world" then a scope would be easiest to check the signal…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(292 Views)

Assistance Needed: Error -200802 While Generating Continuous Mixed Signal with USB-6211 

I am encountering Error -200802 while trying to output a continuous signal using the DAQ Assistant. From my understanding, this error is related to buffer configuration or timing settings not being properly set for continuous signal generation. I would greatly appreciate any guidance or example VIs to help resolve this issue.

 

Request:

Could anyone provide:
  1. Example VIs or resources for generating and outputting a mixed signal continuously using the USB-6211?
  2. Guidance on how to properly configure the buffer and timing settings to avoid this error?
0 Kudos
Message 3 of 5
(279 Views)

See Error -200802 While Trying to Output a Continuous Signal with DAQ Assistant

 

But I would recommend you to ditch DAQ Assistant and use DAQmx API instead. See shipping examples at Help >> Find Examples >> Hardware Input and Output >> DAQmx >> Analog Output >> Voltage - Continuous Output

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
-------------------------------------------------------
https://github.com/ZhiYang-Ong
0 Kudos
Message 4 of 5
(224 Views)

@devv2425 wrote:

Request:

Could anyone provide:
  1. Example VIs or resources for generating and outputting a mixed signal continuously using the USB-6211?
  2. Guidance on how to properly configure the buffer and timing settings to avoid this error?

Look at the last two responses.  Gerg suggested that you generate two analog signals and add them.  ZYOng suggested eliminating the Dreaded DAQ Assistant (DDA, for short) and using 3 to 5 simple DAQmx functions.  Do a Web Search for "Learn 10 Functions in NI-DAQmx and Solve 80% of your Data Acquisition Applications".

 

Can you write a VI that generates a sinusoidal signal?  [Look at Gerd's code].  Can you generate a square wave signal?  Can you add the signals?  [Start with Gerd's code, replace the VI that generates a Waveform with one that asks DAQmx code to make a Sinusoid (or a Square Wave).  If you have two voltage signals, do you know how to "add" them?  [Maybe ask a student studying Electrical Engineering how to "add voltages".

 

Bob Schor

Message 5 of 5
(214 Views)