From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PWM on standard output

Solved!
Go to solution

Hi All

 

I am using a NI USB-6211, and I have already used the two counters to do PWM in my project. I have a need to do one more that does not need tight control.  Does anyone have code to use a standard output, not a counter, for PWM control?

 

Thanks

Bob

0 Kudos
Message 1 of 7
(2,950 Views)
Solution
Accepted by topic author RJGats

Try the "Square Wave PtByPt" VI. I posted an example here that outputs to a chart, which could be easily changed to output to a digital output instead.

Message 2 of 7
(2,943 Views)

You'll want to use analog output (assuming it is still available) rather than digital output since the 6211 only supports software-timed digital I/O.

 

 

Best Regards,

John Passiak
0 Kudos
Message 3 of 7
(2,921 Views)

Sorry both Analog out being used, which is why I am trying to use a digitial out.

0 Kudos
Message 4 of 7
(2,872 Views)

In that case, the closest you could get is to toggle a digital output line with software-timed delays.  It's far from ideal, but I guess depending on what exactly you mean by "does not need tight control", maybe it would be good enough for your application?  I'd be pretty nervous about using this to control anything important though... software timing on Windows isn't terribly consistent (and the added bus latency of USB isn't doing you any favors either).

 

 

Best Regards,

John Passiak
0 Kudos
Message 5 of 7
(2,847 Views)

Hi John

 

I think it will be ok, I just need to control a stirrer in a bath to keep the tempeture constant.  The walls of the bath will be controled, the bath is only about 1/2 foot cube.  The operator will put in an RPM but it does not have to be real close.

 

Thanks

Bob

0 Kudos
Message 6 of 7
(2,826 Views)

Thanks nathand

 

I got the code you gave to work for what I needed.

 

Thanks again!

0 Kudos
Message 7 of 7
(2,785 Views)