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,
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!