Showing results for 
Search instead for 
Did you mean: 

trigger and gate problems - labview 7.1


I'm trying to incorporate the trigger and gate available in Labview 7.1 and am having some problems getting it to work the way I want. 

I am trying to collect data from a PMT in a while loop which is set for 1000 times before stopping collection.  The trigger start is set as threshold  when the signal rises above 0.  The stop trigger is  set for number of samples which is currently set for 100.  By these conditions, I have 10 gates which are providing 10 data points which will be in an array.  These 10 points are only the 100th data point for each gate.  I want to average the 100 points in every gate which then yields the final data point in an array.  Is there any way I can do this or have i interpreted the trigger and gate incorrectly?

Thanks for your help.
0 Kudos
Message 1 of 4

Hello buckeye1,

I am not exactly sure what you are trying to do, or where your problem is.  Correct me if I am wrong, however it seems as if you are trying to read in an analog voltage.  You want to start acquiring 100 points when the voltage goes above 0V.  You want this operation to be retriggerable so you can read in many sets of 100 points.  You then want to average each set of data.

There are several ways of doing this.  The first is to create a task that performs analog window/edge triggering, and set the level to 0V.  Since all analog tasks are not regtriggerable, you will need to start and stop the task inside your loop.  You do not have to worry about a stop trigger if you create a finite sample task.  A finite sample task will acquire 100 points and stop automatically.

The above method is the easiest way to do this.  If you find the start and stop task is too slow, you can use the counter system (on M series boards) to perform retriggerable acquisition.  To do this, you would create a additional counter task and a dummy analog output task.  You would use the counters to generate a finite pulse train (and set the task to retriggerable).  You would then use the dummy analog output task to create a comparison event (TTL) signal which triggers the counters.  The counter will generate a clock that you use for your analog input acquisition.  I have posted an example of this.

For the example I posted, you need to connect your signal to an analog input (i.e. ai0) and to APFI0.  If you are not using Dev1, you will have to update the front panel control accordingly.  Please note that this is just an example, and it has not been fully tested.

Either of these two methods will create an array of samples when you signal goes above 0.  You will need to use a shift register or some other method to store the data.

I hope this helps,

Jesse O.
Applications Engineering
National Instruments

Jesse O. | National Instruments R&D
Message 2 of 4
Thanks for the help!
0 Kudos
Message 3 of 4



I hope this question is pertinent to this thread. I am using Labview 8.5, however I think it still applies.


What we are trying to do is read a square-wave pulse (5V high, 0V low) from an external device and use it to generate another square-wave pulse which would have half the frequency, i.e. would rise and fall with the RISING edges of our input pulse.


These second pulse we need to use to drive another device which needs a square-wave pulse as well (5V high, 0V low). 


I was thinking to use the trigger DAQmx Start Trigger vi; however, it's not been so straightforward at the moment, since I need my output to go HIGH on one rising edge, and LOW on the next rising edge. 


Does anybody have any suggestion?? I'd greatly appreciate it!


- M

0 Kudos
Message 4 of 4