LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Analog Input Triggers TTL Output with PCI-6251

Solved!
Go to solution

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!

0 Kudos
Message 1 of 9
(4,430 Views)

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

Message Edited by JK1 on 05-26-2009 05:37 AM
With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
Message 2 of 9
(4,412 Views)
Hey thank, I will take a look at this.  I just have one more question.  From my understanding, I should connect my analog input to the APFI0 input on the connector block right?  Which BNC output should I connect to for the TTL output?  Thanks again!
0 Kudos
Message 3 of 9
(4,397 Views)

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!

0 Kudos
Message 4 of 9
(4,392 Views)
Solution
Accepted by topic author P00rColl3geBoi

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!

Regards,
Margaret Barrett
National Instruments
Applications Engineer
Digital Multimeters and LCR Meters
0 Kudos
Message 5 of 9
(4,363 Views)

Hi Margaret,

     Thanks for your response, I will give this a try.  I will let you know as soon as I have something.

0 Kudos
Message 6 of 9
(4,353 Views)

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!

 

0 Kudos
Message 7 of 9
(4,344 Views)
Actually, after further testing, it turned out that this VI, with some changes, did the job.
0 Kudos
Message 8 of 9
(4,319 Views)
Then please mark Margaret's post as the solution to your question rather than your own message.  If you go to the options menu to the upper right corner of your message, you will be able to unmark it as a solution.
0 Kudos
Message 9 of 9
(4,309 Views)