05-26-2009 12:37 AM
Hello, I'm new to LabVIEW and have a question that I hope I can get an answer to on this board. I am currently using a PCI-6251 DAQ board with a BNC 2120 connector block. I would like to trigger an event on an analog input, such as a sine wave which is connected to AI0. I would then like to send out a TTL pulse train through the digital output. What I am describing can be better understood by the images from this link:
http://zone.ni.com/devzone/cda/tut/p/id/3017
From the tutorial page linked above, they didn't mention the PCI-6251 board, but when I read the specs and compared them, the 6251 board also has analog and digital triggering functions, as well as digital I/Os...so I think it should be able to do what I want it to do. Can anyone confirm this? If anyone could help me by providing a VI that could do what I ask, just to get me started, would be greatly appreciated. Thanks!
Solved! Go to Solution.
05-26-2009 05:36 AM - edited 05-26-2009 05:37 AM
Hai,
Look at this example:
C:\Program Files\National Instruments\LabVIEW 8.x\examples\DAQmx\Analog Out\Generate Voltage.llb\Cont Gen Voltage Wfm-Int Clk-Analog Start.vi
This is just exactly matches your requirement.
Post back for queries
05-26-2009 03:40 PM
05-26-2009 04:31 PM
Hi, I tried to look at the example VI that you mentioned earlier, but it doesn't seem to do what I want it to do, or maybe I just don't see it because I'm a little overwhelmed with this project haha. I will try to explain a little more about what I want:
For a given wave, such as a sine wave, I hope to be able to trigger off of the rising edge at a defined level. Everytime I reach that level, I hope a TTL pulse would be generated. This is a little different from the link I provided in my first post, where a TTL pulse is generated every time depending on the high and low values. I would like for a TTL pulse to be generated at each instance in the waveform, instead of just starting a predefined pulse train when the first trigger is reached. I believe this is kind of like a retrigger? So, for each rising edge in a sine wave, I would like to generate a single TTL pulse, independent of the previous TTL pulses, and keeps doing this until I tell it to stop. I don't want it to generate a steady pre-defined pulse train after the first trigger. I hope this makes more sense. Thanks again for helping!
05-27-2009 04:43 PM
Hello!
Thank you for posting on the NI Forums! My suggestion would be to use the Generate Digital Pulse-Retriggerable.vi found in the NI Example Finder. With LabVIEW open, navigate to Help>>Find Examples>>Hardware Input/Ouptut>>DAmx>>Generating Digital Pulses>>Generate Digital Pulse-Retriggerable. Change the trigger type of this vi to Start>>Analog Edge and make the source an APFI line (pin 20 of your card is APFI0). This will generate a pulse based on an analog edge at a level that you specify.
Hope this helps!
05-28-2009 01:10 PM
Hi Margaret,
Thanks for your response, I will give this a try. I will let you know as soon as I have something.
05-28-2009 05:27 PM
Hello Margaret,
I tried to use the Generate Digital Pulse-Retriggerable example VI you suggested, but unfortunately I keep getting an error saying that APFI0 is not a valid input source. Am I suppose to configure that input in MAX? I also looked at this article, and it seem to do what I want. I've also attached the example VI in this post. I think I understand what is being done in the VI, but the part where you input the frequency for the counter output makes me a little hesitant to use this VI for what I wanted to do, mainly because I'm not sure if it's generating TTL pulses at the frequency I specified, or if each pulse is actually being triggered by the input signal independently. I'm not sure what is a good way to test this out. And finally, while using this VI and monitoring the input signal and the TTL pulses, it seem to me that the pulses are being triggered at the falling edge even when I told it to trigger off of the rising edge, and vice versa. Could someone help? Thanks!
05-29-2009 07:21 PM
05-29-2009 11:52 PM