02-21-2008 11:30 AM
02-21-2008 12:46 PM
02-21-2008 05:21 PM
Chauhan,
I had to do exactly what you want to do several years ago, and could not find any NI DAQ board that could handle such. I ended up building a very small circuit that consisted of a J-K flip flop (M74HC73) that would set/clear the output when either pulses trigger. I then used this output to gate the A/D sampling clock, and it worked just as I wanted BTW, don't forget to "debounce" your trigger inputs.
02-22-2008 01:16 PM
Hello Chauhan,
There are a couple of different options to implement this type of acquisition depending on what hardware you have.
If you have a card with analog triggering you can use an analog window trigger to do this, but you'd need to modify your triggering signal. The way an analog window trigger works is that the task will only acquire when the voltage input on your analog trigger line is within a range that you set. For instance if you can have a trigger pulse that is 3 volts when you want to acquire and 0 volts otherwise then this would be a good option. This type of trigger does not use rising edges though, so if you need to trigger with rising edges you'll need to use a different option.
If you have a M-Series card or a card that supports stop and reference triggers then you can follow the instructions in this KnowlegeBase article: How Do I Use a Digital Trigger in LabVIEW to Start and Stop Acquiring Data? There is an example program that you can look at as well.
These would be the easiest two methods, but if neither of these are an option for you it'd be helpful to know what hardware you're using so we can see if there's another option.
Have a great weekend!
03-03-2008 06:50 PM
03-04-2008 04:57 PM
Hello Chauhan,
I apologize for my previous advice. I had the wrong impression about the analog window trigger. I've tested it out and I believe that the behavior you're seeing is correct--the analog window trigger is only a start trigger. However, I have done some research and I have a better solution for you (that I've tested out).
I wasn't able to find the PCI-6112, but assuming you meant either the PCI-6221 or PCI-6112 the following solution should work. To implement this solution you need a board with counters and both of these cards have them.
Here are the steps I took:
1. Configure a counter output pulse generation task with a digital pause trigger. This task will output a digital pulse train of a given frequency and whenever the pause trigger goes high/low (TTL high == 5 volts, TTL low == 0 volts) this output will stop/stop. You can select high or low for the pause value.
2. Configure the analog input to use the above pulse generation as a sample clock.
This will allow the analog input task to acquire continuously, but you'll only generate your sample clock when the trigger is high/low thus you can acquire samples at a given rate only when your trigger has a given value.
To set this up I would start with the "Gen Dig Pulse Train-Continuous-Pause Trigger.vi" example located in the Hardware Input and Output>> DAQmx>> Generating Digital Pulses folder in the example finder. (To open the example finder open LabVIEW and go to Help>> Find Examples.) This example will generate the pulses I mentioned then you just need to add in the analog input task and use the counter X internal output of the device as your sample clock.
I’ve tested this out and it works on my PCI-6251 so you should be okay if you have either of the cards I mentioned above.
I hope this helps!
03-04-2008 05:21 PM
Hi Brooks,
Isn't it true that this technique requires that one uses the SAME trigger to start/stop? According to his original post, he wants to use two different triggers: one to start and the other to stop.
03-05-2008 01:05 PM
Hello nantek,
This method uses a digital pause trigger so when the pause trigger is at the specified level (either TTL high or low) it will generate the sample clock, so yes, there is only a single line used for the pause trigger. I may have misunderstood what he wanted, but the way I interpreted his last post this is what he was looking for.
Chauhan, if this isn't what you meant, let me know.