DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create sychronized pulse train

Here's what I want to do:

Measure 3-5 analog inputs along with at least one counter input (counting pulses) at (least) at 20kHz. After the counter increments, I want to output several digital pulses that occur at precise times after the increment and for a precise duration. All of these functions should be synchronized in time.

What I currently do:

I establish an A/D conversion with an internal clock, and then a counter that will run off that clock. I start the counter first, then the analog conversion, so that the counter will be synchronized with the analog conversion. The analog signals and counter are read in a WHILE loop, ~7000 samples at a time, and logic/array math are performed, and data spit to the screen. The process then repeats. I need to figure out how to add the precisely timed pulse train to this.

What I'd really like to do:

My counter is really the output of a shaft encoder. I would like to read the shaft position, in degrees, directly, and synchronize my analog conversion and pulse outputs with the degrees. In this scenario, I would not need a counter in.

0 Kudos
Message 1 of 2
(2,832 Views)
Hi patcaton -

The implentation depends entirely on which hardware and driver software you're working with.  If you have an M-series device, you can simply run three tasks off the same timing event:

- Task 1: Analog Input, 80MHz timebase
- Task 2: Buffered Event Counting, AISampleClock
- Task 3: Correlated Digital Output, AISampleClock

This will ensure that every sample of the analog input is synchronized with every pulse counted and every pulse generated.  Unfortunately, E-series and B-series devices don't support correlated digital output, so your pulse train output can't be generated with one of those devices.
David Staab, CLA
Staff Systems Engineer
National Instruments
0 Kudos
Message 2 of 2
(2,814 Views)