Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems to Generate PWM with Specify DutyClicle Pattern

Hi everybody.

 

I'm traying to genenrate a 2 PWM Output but, I need to have a specify duty cycle pattern in each pulse of thw pwm 1.

 

for the first output(PWM P0.0) :

the first 3 pulses need to have 50% duty cycle.

then the next 5 pulses need to have 20% duty cycle.

and the last 2 need to have 80 % duty.

 

the second is not a problem: 

is only one pulse. that I have in P0.1

 

 

The problem is in the Sample timing for generate the output in P0. The vi Sample Clock show the error:

Error -200077 occurred at Property Node DAQmx Timing (arg 1) in DAQmx Timing (Sample Clock).vi->PWM to Support.vi

Possible reason(s):

Measurements: Requested value is not a supported value for this property.

Property: SampTimingType
You Have Requested: Sample Clock
You Can Select: On Demand

Task Name: _unnamedTask<18>

 

I'm  Stuck, I tried diferents forms to generate this PWM without success. Could you can help me with this, do you have other way or something that I need to now.

 

 

 

the daq is :  Ni Usb 6216

Labview 7.1

 

 

Thanks I appreciate your response

0 Kudos
Message 1 of 2
(3,518 Views)

Hi,

 

I was taking a look of your VI.

 

I you want to have two different PWMs with different duty cicles you need to start two different tasks or have the same duty cicle in each channel.

 

Try starting one pulse train and then just copy the same code again!

 

I should work.

Luis Elias
NI VeriStand and HIL Product Manager
0 Kudos
Message 2 of 2
(3,501 Views)