Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

PCI 6602 PWM GENERATION (Dynamic sine duty cycle)

Dear Sirs, I' triying to generate a pwm with a NI PCI 6602 board to control a motor. I have revised several examples in ni.com but normally in these examples the duty cycle is dinamyc but only change manually (updating the duty cycle value). I have prepared some code attached below. I want to change the duty cycle dynamically following a sine, oscillating around the initial duty cycle (like an offset, to move the motor between the max and min limits around the central position) introduce in the front panel. As I don´t want to get repeated duty cycle values the sine rate also must be 50 Hz (to obtain a smooth movement on the motor0). The code below works fine for low pulse train frequencies but when I increase the frequency of the pulse (to 50 Hz) and also the loop timing to 20 ms, the error -200301 appears. How Can I improve the code to obtain the required rates? Thanks Bye.

0 Kudos
Message 1 of 3
(7,773 Views)

I am working on setting up our NI PCI 6602 to generate a PWM signal. I have used the suggested progamming from https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x1P0CAI&l=en-US.

 

When I try to setupo the Counter I/O input to the DAQmx Create Virtual Channel.vi, it will not configure for a Cntr out for the 6602. It will only let me configure the AI channels of the 6036E card. What am I missing?

 

Sorry for stupid questions. I am new at this.

2016-08-09 10_37_10-NI PCI-6036E _Dev5_ - Measurement & Automation Explorer.png

 

0 Kudos
Message 2 of 3
(4,784 Views)

Did you change the DAQmx Create Virtual Channel.vi instance to CO Pulse Freq?

0 Kudos
Message 3 of 3
(4,418 Views)