10-14-2011 11:09 AM
Hi there,
I am using NI PCI-6229 and LABVIEW 8.0, and trying to develop a code that can generate a TTL/square function signal as soon as one analog input satisfies following conditions: 1. Crossing a certain value (say, 0 V); 2. Falling edge slope. The time delay between the crossing point and newly generated TTL/square signal will be critical in my measurement, and it should not exceed 1 millisecond. Any suggestion on it? Thank you in advance!
Solved! Go to Solution.
10-17-2011 11:49 AM
Hi Matt11,
If you are using a PCI-6229 you cannot use analog triggering. This means that you will have to use a software start trigger. I can't give you a performance figure on how quickly a software trigger will respond because it depends on your computer and your VI. To create a software trigger set up your two DAQmx tasks (one for the the analog input and one for your pulse generation) and have logic based off of your AI control the start trigger of your pulse output.
Here is an example of how to create a retriggerable software start trigger that outputs a pulses.
https://decibel.ni.com/content/docs/DOC-10682
If this does not meet your performance requirements you will have to use a DAQ card that supports analog triggering.
10-17-2011 03:21 PM
Hi Matt11,
If you don't mind using external ICs, you can use a comparator to accomplish what you are looking for. Some thing like the LM339 will allow you to compare your signal to a known voltage and tell you if you are above or below it. The output of the IC can be routed to a PFI line for the DAQ card to use for detecting the edge. In your case, set the reference voltage to be 0 volts. If your provided signal goes from positive to negative, a falling edge will occur on the LM339 output. If it goes from negative to positive a rising edge will occur. You can then use this signal as a digital trigger for your digital generation.
This method will be faster than the software trigger method since it is hardware. It is unlikely the software trigger method will give 1 millisecond performance, however this hardware method will be able to provide it.
10-17-2011 04:32 PM
Thanks to Mike and Steven for your suggestions! I will try first both options, software triggering and IC methods. I appreciate your time.