Showing results for 
Search instead for 
Did you mean: 

PWM with USB-6211


Hi.  Is it possible to create a 10V pwm using an analog out channel on the USB-6211 (I actually need 0-12V).


Would I make a for loop and just wait a certain number of milliseconds?


Also, can the USB-6211 output 20mA?  I saw that it is rated for 2mA... this seems really low!



0 Kudos
Message 1 of 9

Hello seascan,


The analog outputs of the USB-6211 are rated at ±10V, so you will not be able to get a signal more than 10V from ground so 0 - 12V isn't possible unless your connected device is completely floating.


The outputs are rated to ±2mA so you will not be able to achieve 20mA with this device.  The analog outputs are intended to generate analog waveforms, not to serve as a power supply.  You'll need an external current amplifier circuit in order to acheive 20mA.

Seth B.
Principal Test Engineer | National Instruments
Certified LabVIEW Architect
Certified TestStand Architect

Engineers like to solve problems. If there are no problems handily available, they will create their own.
0 Kudos
Message 2 of 9

Thanks Seth.  Does NI sell, "external current amplifier circuit in order to acheive 20mA"


Also, what is the best way to make a PWM signal on the output... a for loop with a X ms delay?



0 Kudos
Message 3 of 9

The best way to do a PWM signal with the 6211 is to use the timer/counter digital output.  This will give you accurate high-speed PWM and you don't have to write an algorithm to do it.  You'll be limited by the digital output voltage (5V) but you can use the output to drive a solid-state relay that will switch any voltage you need.  Something like this (the result of a really quick search, you can probably find a better fit for your application) should work for switching 10V DC:

0 Kudos
Message 4 of 9



This problem still persists in current USB-6211 models ? As I also want to generate PWM signal for four devices

0 Kudos
Message 5 of 9

Which "problem"? The 6211 isn't designed to do a 10V PWM signal. That's by design. If that's what you need, you should choose appropriate hardware.


The 6211 will not support 4 independent PWM outputs; it only has 2 timers.

0 Kudos
Message 6 of 9


I am a newbie man. So much so that I am searching what is PFI etc. Yeah, I figured that out that we have to channels (timers for that). Someone suggested that I can use 'pulse out' (DAQmx>Digital Output) generation and use it like PWM.

0 Kudos
Message 7 of 9

Yes, you can do "software-timed" PWM if your frequency is low and you don't care about precision in the duty cycle. That is, you can do a 50% duty cycle at 1hz, but it will sometimes be 45% and sometimes 55% and occasionally 90% or 0% if Windows - I assume you're using Windows - decides to do an update or some computationally intensive task.


To use the hardware PWM channels, look at the examples included with LabVIEW. Find the Example Finder under the Help menu.

0 Kudos
Message 8 of 9



I think the example available at is applicable on USB-6221

Anyway, I receive this error.

The original program needs to be connect with thermocouple and voltage source. I put DAQ and DAQ 2 as simulated analog signals for thermocouple and voltage but still is not working.

0 Kudos
Message 9 of 9