Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

PWM output using daqcard-700

I am attempting to control standard R/C servos using my daqcard-700, labview 7.0, and NIDAQ 6.9.3. The servo requires a pwm signal at 50 Hz, with the pulse width modulated from 1 ms to 2 ms. I figured this should be relatively easy to do using the "write to digital line" vi, and using the "count events or time" vi in order to determine how much time has passed with my digital line being high or low.

My daq-card is recognized and is working fine according to measurement and automation explorer, but when I try to use the "count events or time" vi I get an error -10403 saying specified device does not support the requested action. I also tried using the "Generate pulse train" vi and couldn't get that to work either. Could you please make some suggestions? I feel like this should be an easy task and I just can't get it working.

Thanks,
Andreas Kellas
0 Kudos
Message 1 of 4
(3,581 Views)
Are you able to communicate with the device in Measurement and Automation Explorer?  If so can you run the test panels in MAX?
0 Kudos
Message 2 of 4
(3,566 Views)
Yeah, actually the card works fine, I realized I was trying to use a VI for the incorect timer. The problem is that I still can't figure out how to create a pwm signal with the 8254/8253 timer VI's. The pulse train VI's for this timer do not allow control of the duty cycle. Can you suggest a way around this? It should be such a simple thing to do, but its so painfully difficult with labview.

Andreas
0 Kudos
Message 3 of 4
(3,564 Views)
Hi Andreas,

Yes you are right the DAQCard-700 uses the SM82C54 timing chip, which is a rather old design.

I definitely understand that trying to get this working in LabVIEW seems like a pain, but it's definitely not LabVIEW's fault and is more a problem of limited abilities of the DAQCard-700.  With our newer boards this wouldn't be a problem at all and I could point you straight to a program.

All of the examples for that chipset can be found here:
C:\Program Files\National Instruments\LabVIEW X.X\examples\daq\counter\8253.llb

If you drill into the first VI in the example (Cont Pulse Train.vi), you will see that the actual frequency and actual duty cycle are changed by using the ICTRControl.vi with a control code set to Setup Mode 3 and then doing some math to determine how many ticks of the timebase mean how long of a pulse.  You could try changing this within the while loop of the example program and see if that works.  Or if you need a product that will definitely allow easy PWM, then check out some of our newer USB DAQ Products.

Regards,
0 Kudos
Message 4 of 4
(3,546 Views)