Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I output a finite pulse train through multiple counters?

Hello,

 

I have used LabView examples to create a VI to use with my TIO 6602 that generates a finite pulse train with varying duty cycle, frequency, number of pulse, and initial delay.  I can also have it output the pulses through multiple counter channels, but all the channels have the same delay, and are output at the same time.  I need each channel to have a specific delay from the first one.

 

In my VI, I use DAQmx to create a retriggerable finite pulse train by gating a counter with another counter.  I have all the neccessary controls over the pulse train, but I can not seem to find an easy way to just copy this waveform and output delayed versions of it to other channels.  The delay is very important because these signals will be used to drive ultrasound transducers in a linear array, and for the waveforms to focus at one point, the signal driving the transducers with a shorter distance from the focal point need a larger delay, so that the same waveform arrives from each transducer at the same time.

 

Any help with how I might do this would be much appreciated.

 

Thanks!

0 Kudos
Message 1 of 15
(6,668 Views)

Hey Sneaky,

 

To do this you will need to use two counters for each finite pulse train.  Finite pulse train generation requires one counter to generate the pulse train and another counter to generate the pulse that will be used to gate or pause the first counter.  This means you will only be able to generate 4 finite pulse trains per 6602, unless you use an external source to gate each counter.

-John Sullivan
Problem Solver
0 Kudos
Message 2 of 15
(6,655 Views)

Thank you for your response John.  Sorry it took me a while to respond.

 

So, knowing that I need 2 counters for each output, I am still unsure how to add more finite pulse generations to my VI.  I basically used the example VI Gen Dig Pulse Train-Finite-Retriggerable, and I tried basically copy-pasting the block diagram multiple times within the VI with the same parameters but using different counters and delays.  That however would not work. 

 

I need a VI that I can specify the finite pulse train I want, set the delay for each output, press the run button, and have it output that pulse train to all 4 counter outputs with the specified delays from each other.  Right now, I can make multiple VI's that create finite pulse trains on different counters, but the delay means nothing if all the VI's arent started at the exact same time.  Also, it is a pain to have to input the same exact pulse train parameters to all 4 VI's.  I need to have one VI with one set of parameters and one run button that will precisely delay the output of the same finite pulse train to each of 4 counters.

 

Thanks again! 

0 Kudos
Message 3 of 15
(6,479 Views)

Sneaky,

 

I don't have any hardware to test this right now but I'm pretty sure this will work.  I'll use the Gen Dig Pulse Train-Finite-Retriggerable.vi example as a reference.  On the front panel in the Channel Parameters , set the Counter(s) input as Dev1/ctr0:3  This sets the task up to use 4 counters with the same settings.  Now set your trigger source up to be one of the remaining counters.

Message 4 of 15
(6,467 Views)

Hey Sneaky,

 

Centerbolt's concept is correct, but since we use paired counters for this acquisition the correct channel list is "Dev9/ctr0,Dev9/ctr2, Dev9/ctr4, Dev9/ctr6"

-John Sullivan
Problem Solver
0 Kudos
Message 5 of 15
(6,463 Views)

I have tried that, and it will output my pulse train to multiple counters, but each output needs to be slighty delayed from each other by an amount specified by the user.  Is there a way to specify individual delays for each counter output?

 

 

0 Kudos
Message 6 of 15
(6,453 Views)

Sneaky,

 

Sorry, I missed that part of your problem.   Instead of using one instance of DAQmx Create Channel to add all the counter  channels to the task at one time, use 4 instances and add the channels to the task individually.

Message Edited by centerbolt on 02-02-2009 10:13 AM
0 Kudos
Message 7 of 15
(6,437 Views)

Hey Sneaky,

 

Here's a screenshot of the code I put together on how to use multiple counters.  Also, take a look here for more information on how to sync multiple counters. 

Message Edited by Knights Who Say NI on 02-02-2009 10:36 AM
Message Edited by Knights Who Say NI on 02-02-2009 10:36 AM
Message Edited by Knights Who Say NI on 02-02-2009 10:38 AM
-John Sullivan
Problem Solver
Message 8 of 15
(6,433 Views)

Thanks for your response Knights, it helped a lot.

 

I noticed that you use one trigger source for all 4 of the "Start Digital Edge" block.  Does this mean that I can use one counter as that trigger source and have potentially the last 7 counters as outputs?

 

Thanks again.

0 Kudos
Message 9 of 15
(6,405 Views)

Hey Sneaky,

 

The finite pulse train requires two counters, as discussed before, so we will not be able to have 7 counters output, just 4.  For the digital inputfor the trigger will be from one of your PFI lines on port 0.

-John Sullivan
Problem Solver
0 Kudos
Message 10 of 15
(6,372 Views)