Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

PWM with NI 9264 using MATLAB

I am trying to generate a continuous background PWM signal using the analog output NI 9264 module. I am providing the code through MATLAB data acquisition toolbox. 

 

When I provide a vector with a constant value (for example, a vector of length 5000, with all values being 4V), the output is a constant 4V. However, when I pulse the signal (for example, a vector with 5000 values, alternating between high and low in groups of 50), the output shows either the high value or the low value, it does not show the PWM pulse train. 

 

Is there a way to achieve a constant PWM output using MATLAB?

0 Kudos
Message 1 of 2
(2,457 Views)

Hi Bhavi571,

 

I recommend you to have a look at the ANSI C examples of DAQmx, these will show you some ins and outs of this kind of application. Check the link below 

http://digital.ni.com/public.nsf/allkb/FB26BDA52FFFD4EE86257124005C36C3

 

Also, remember this is an analog output device, it's not meant to create a pulse train. If the PWM is fast, the device won't keep up with it, try slow rates first. 

 

I also recommend trying posting this question on the MATLAB forums as both software are implied. 

 

Regards,

PedroR

0 Kudos
Message 2 of 2
(2,387 Views)