LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW Unstable Digital PWM Output to DAQ

Highlighted

I am using the attached VI in attempt to output a variable/controllable digital PWM wave from a NI USB-6356,6366 DAQ. However, my oscilloscope reading is quite unstable compared to using the DAQ Assistant's test output. As seen below to the left, the code generated square wave's duty cycle seems to be oscillating rapidly. It is set to 100 Hz and 50% duty cycle on the front panel. To the right is the stable signal from the DAQ Assistant.

 

Code Generated.jpgLabview Code GeneratedDAQAssistant Generated.jpgDAQ Assistant Generated

The bulk of the code was taken from: https://forums.ni.com/t5/Example-Programs/Software-Timed-Pulse-Width-Modulation/ta-p/3507768

 

Please advise. Thank you.

 

 

0 Kudos
Message 1 of 2
(131 Views)

Yup.

 

You picked an example that uses *software* timing.  It is well-known to be orders of magnitude more variable than hardware timing.

 

Use either MAX or a LabVIEW shipping example for counter output and you'll get highly consistent hardware timing.

 

 

-Kevin P

0 Kudos
Message 2 of 2
(116 Views)