Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate a multiple retriggerable pulses with a 6602 card and an encoder's A signal as my timesourse.

I need to generate 3 separate pulses on each revolution of an optical encoder. These pulses will each have different raw specs which will all be recalculated and updated occasionally (without stopping the vi). I want to trigger these pulses with the Z channel of the encoder, use raw specs to define the 3 pulses, reset the source counter to 0 every time the Z/Index triggers, and do this without missing any of the 3 pulses when they are updated. This is for an engine control system, so the pulses are driving fuel injection and ignition timing and need to change on the fly without "hiccups" in the timing signals. The Generate Retriggerable Pul
se NI-TIO doesn't seem to let me use my A-channel as my time source. Any help will be greatly appreciated. Thanks!
0 Kudos
Message 1 of 2
(4,473 Views)
To use your channel as the source timebase, you need to add in a VI to set it up. At the low-level, it's the Counter Set Attribute VI, but you can grab one of the subVIs from the Examples which it easier. In the LabVIEW >> Examples >> Daq >> Counter >> ni-tio.llb directory, grab the Counter Source (NI-TIO).vi and place it in the string of VIs before the Set Pulse Specs.vi in your Generate Retriggerable Pulse example. It acts just like the Counter Gate (NI-TIO).vi except it's for the source. Then, on the front panel of the Generate Retriggerable Pulse, you should be able to specify one of the PFI lines to which you are wiring your source signal.

From what I understand from your description of your application, I have a suggestion which I'm not sure if you are
already following. There is an example for a Pulse Width Modulator which shows how you can programmatically change the pulse delay and pulse width of a pulse train. Find this by going to the http://www.ni.com/support page and choosing Example Programs from the Technical Resources pulldown menu. Then, type in "pulse width modulator". You can set up 3 counters to do this PWM and have them act as the sources for each of 3 counters. These 3 counters are set up as the Retriggerable Pulse Generation counters to expect the Z signal as the gate. When you change the pulse specs of the source, you end up changing the pulse specs of the retriggered pulse. The gate triggers the operation. This can be run continuously but will take 6 counters from your 6602. I hope this helps!

Regards,

Geneva L.
Applications Engineering
National Instruments
http://www.ni.com/ask
Message 2 of 2
(4,473 Views)