Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Need an extra counter/timer

I have a NI 6251 DAQ board and I am trying to program the following using hardware timing in DAQmx (I need ~microsecond time resolution):

Analog pulse output, immediately followed by digital pulse output, immediately followed by analog input.

I use one counter to create the digital pulse and the other for timing. However, when timing I am only using a single output pulse, so I can't trigger the analog input. Right now I have it set so that the outputs are triggered by the rising and falling of a counter pulse. However, I can't create another pulse for the input since one counter is already used by the digital output pulse. Is there any way to do this? The problem really is that the digital pulse needs to go high first then low again for a certain period before the analog input, and stay low when idle. If it didn't have to go low for a while before the analog input, I could trigger off its fall.
0 Kudos
Message 1 of 3
(2,830 Views)
Don't have enough 6251 experience to tell you the best way to do it with this board. But let me explain how to make this work with an E-Series board which should work for the 6251 as well. What this means is that I will use a counter timer for the digital output whereas for the 6251 it might be better to use the hw timed digital I/O lines.

Since I am not perfectly sure as to your definition of immediate let me give you some options on how to solve this.

Solution 1: When you say immediate I assume that the three events you described need to occur simultaneously. If this is the case this is how to set it up.
1. Setup your Analog Output (AO0) to generate your signal using the Anaolg Output clock.
2. Setup a counter to generate a pulse on every rising edge (or whatever you choose)of the Analog Output Clock.
3. Setup your Analog Input to acquire signal using the Analog Output Clock as it's clock.
4. Start your Analog Input Acquisition
5. Start your Counter Timer Operation
6. Start your Analog Output Generation

Solution 2: Makes the assumption that the Analog Output and the Digital Pulse Output can occur simultaneously and that the Analog Input happens a defined period of time after your digital pulse output.
1. Setup your Analog Output (AO0) to generate your signal using the Anaolg Output clock.
2. Setup a counter to generate a pulse on every rising edge (or whatever you choose)of the Analog Output Clock.
3. Setup a second counter to generate a pulse a set delay after the falling edge of the Digital Pulse Output from the first counter
4. Setup your Analog Input to acquire a signal using the second counter output as its clock.
5. Start your Analog Input Acquisition
6. Start your Second Counter Timer Operation
7. Start your First Counter Timer Operation
8. Start your Analog Output Generation

Solution 3: Makes the assumption that the Analog Input needs to occur a defined period of time after the Digital Pulse Output and that the Digital Pulse Output in turn needs to occur a defined time after the Analog Output. Hmmmm actually this turns out to be the same as Solution 2 but that you need to configure the first counter (step 2) to generate a pulse with a time delay.
1. Setup your Analog Output (AO0) to generate your signal using the Anaolg Output clock.
2. Setup a counter to generate a pulse on every rising edge (or whatever you choose)of the Analog Output Clock.
3. Setup a second counter to generate a pulse a set delay after the falling edge of the Digital Pulse Output from the first counter
4. Setup your Analog Input to acquire a signal using the second counter output as its clock.
5. Start your Analog Input Acquisition
6. Start your Second Counter Timer Operation
7. Start your First Counter Timer Operation
8. Start your Analog Output Generation

Hope this is clear and that it gets you going in the right direction.

-Christer

3.
0 Kudos
Message 2 of 3
(2,819 Views)
Thanks. Problem solved!
0 Kudos
Message 3 of 3
(2,798 Views)