LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

High speed variable width pulse generation

I searched NI's website the best I could but could not find anything relating specifically to my question.

I want to produce a pulse of variable width every 10 ms.  It seems the ideal way to do this is to specify a counter to count a certain number of ticks and then go negative when it's reached that number.  It's pretty easy to get the counter to do that, however the speed is an issue.  Is there any way to have the counter generate a different width pulse specified by an input number of ticks that can update every 10 ms.  Any resources to help me figure this out that you can suggest would help greatly.

I have PCI 6229 card and if I can figure this out, I'll submit a real nice stepper motor control VI as an example.

Thanks,
Phil

Message Edited by flip518 on 07-19-2005 12:10 PM

0 Kudos
Message 1 of 4
(2,934 Views)
Phil,
It isn't possible to do deterministic pulse width modulation with you board, however, I can think of a couple ways to try to get close.  If you set your board up to do a continous pulse train generation, you have the ability through a DAQmx Channel Property Node to programmatically set the count registers to a different value.  In the loop that waits for the Stop button, you can set the Wait For Next Millisecond Multiple to be 10, and thus approximately every 10 ms you would change the count register.  You can change the frequency of the pulse three ways, by frequency and duty cycle, actual pulse high time and low time, or actual clock ticks for the high and low parts of the cycle.  The problem with this method is that since Windows isn't deterministic, plus you are writing over the PCI bus to the hardware, you are not guaranteed the accuracy of the 10ms loop.

Attached is a VI that shows this -- it is modified from the Gen Dig Pulse Train-Continuous.vi example that ships with the NI-DAQmx driver.
Doug M
Applications Engineer
National Instruments
For those unfamiliar with NBC's The Office, my icon is NOT a picture of me 🙂
0 Kudos
Message 2 of 4
(2,909 Views)

Thanks Doug,

That helped out a bunch, does everything I need.

Phil

0 Kudos
Message 3 of 4
(2,898 Views)
Phil,
Glad I could be of help.

--Doug
Doug M
Applications Engineer
National Instruments
For those unfamiliar with NBC's The Office, my icon is NOT a picture of me 🙂
0 Kudos
Message 4 of 4
(2,891 Views)