10-28-2014 07:10 PM
Board: PCIe-6321
LabVIEW: 2013 SP1
OS: Windows 7 professional, 64 bit
Trying to generate a PWM square wave on Port 0, Pin 7.
I downloaded the example code, Mseries_PWM_MultDO_OneCtr_getting_to_4DO.vi (I know m series example, x series card)
It shows how to drive PWM on all pins of Port 0 (DAQmx Write, Digital 1D U8, 1 chan NSamp).
I don't want to override static settings of other pins on Port 0.
The PWM signal needs to be variable so the user can turn up or down the intensity of the light.
I can see how the example does that with the event case, so no problem there.
When I try to modify the example to generate the PWM on a single channel (pass an array to the DAQmx Write (VI)) (DAQmx Write, Digital 1D Bool, 1 chan 1 samp), it thinks I want to write a single value and won't accept an arry.
When I try to modify the example to generate the PWM on 'multiple channels', (DAQmx Write, 1D U8, 1 chan NSamp) it won't let me specify a single pin.
I tried other options on the DAQmx Write VI, but haven't gotten any of them to work.
I do have an oscilloscope tied to the output pin, and can see what it's doing, so have good feedback.
From MAX I can select the pin, tell it to generate a repeating waveform, so it is capable of creating a square wave.
(and the 'scope is working, I have the right pin, etc)
A couple calls to NI support hasn't resolved the issue yet, but they said they'd continue to look at it.
NI Tech support sent me a link to:
http://www.ni.com/white-paper/2991/en/
This white paper talks generically about generating PWM, and that's good.
But it shows the 'task' as one of the counters.
The Pinout for my DAQ doesn't list a counter as making it out to the world, and I don't see how to specify that this 'generated' PWM should appear at Port 0, Pin 7, for example.
Any thoughts?
Thanks,
Jeff
10-28-2014 09:11 PM