Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

pwm

hello
How do you generate PWM whith NI PCI 6221?
Thanks.
0 Kudos
Message 1 of 11
(5,422 Views)
BcGam,

Here's an example to get you started. One note: even if you wish to keep frequency constant and only change the duty cycle, it's still necessary to write both the freq and duty cycle on each update.

-Kevin P.
ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 11
(5,409 Views)
Thanks for your reply.
Have you got a solution whith CVI software and NI DAQ 6221
Tanks
0 Kudos
Message 3 of 11
(5,404 Views)
Sorry BcGam, I haven't done any CVI. All I can help with is to say it should be possible -- I *have* changed pulse specs on the fly on another M-series board under LabVIEW.

-Kevin P.
ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 4 of 11
(5,395 Views)
thank you for your assistance when same.
0 Kudos
Message 5 of 11
(5,393 Views)
BcGam....you should be able to find an existing shipping example for CVI and with only a few modifications get the same behavior. Look at the Digital Pulse Train-continuous example. You should then only need to make a few modifications by calling the counter write VI (in DAQmx 7.3 you no longer need the property node)in you loop to update the duty cycle.

StuartG
0 Kudos
Message 6 of 11
(5,386 Views)
Hi, using the example provided in reply #2, I receive this error periodically:

Error -200301 occurred at Property Node DAQmx Channel (arg 1) in Pulse Width Modulator-daqmxb.vi

Possible reason(s):
Cannot update the pulse generation property.
The pulse generation with previous property settings must complete a full cycle before the property can be updated.
Task Name: _unnamedTask

It seems that the program is trying to overwrite a counter property before a single cycle has completed. However this error occurs even when i'm not changing the frequency or duty cycle inputs. When I use the cpu for other tasks such as using a browser, this problem seems to occur more frequently. Is there a way to fix this?
0 Kudos
Message 7 of 11
(5,297 Views)
Hi, using the example provided in reply #2, I receive this error periodically:

Error -200301 occurred at Property Node DAQmx Channel (arg 1) in Pulse Width Modulator-daqmxb.vi

Possible reason(s):
Cannot update the pulse generation property.
The pulse generation with previous property settings must complete a full cycle before the property can be updated.
Task Name: _unnamedTask

It seems that the program is trying to overwrite a counter property before a single cycle has completed. However this error occurs even when i'm not changing the frequency or duty cycle inputs. When I use the cpu for other tasks such as using a browser, this problem seems to occur more frequently. Is there a way to fix this?
0 Kudos
Message 8 of 11
(5,295 Views)
Hi, using the example provided in reply #2, I receive this error periodically:

Error -200301 occurred at Property Node DAQmx Channel (arg 1) in Pulse Width Modulator-daqmxb.vi

Possible reason(s):
Cannot update the pulse generation property.
The pulse generation with previous property settings must complete a full cycle before the property can be updated.
Task Name: _unnamedTask

It seems that the program is trying to overwrite a counter property before a single cycle has completed. However this error occurs even when i'm not changing the frequency or duty cycle inputs. When I use the cpu for other tasks such as using a browser, this problem seems to occur more frequently. Is there a way to fix this?
0 Kudos
Message 9 of 11
(5,285 Views)
Hi himesh,

Please consider the following article:

Error -200301 When Using Property Node to Update Counter Pulse Output

Thanks,
Lesley Y.
0 Kudos
Message 10 of 11
(5,183 Views)