LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

external trigger for internal event

Hello,

I would like to use an external trigger on a PFI-line to trigger an internal event, e.g. the switch of an indicator on the front panel from "1" to "2".
How do I do that?

0 Kudos
Message 1 of 3
(2,884 Views)

You need a way of capturing the external trigger and reporting it to software.  One method is the use a DIO (digital input line if the trigger is TTL).  If the trigger is not TTL, you can use an Analog Input board.  If you are just wanting to get one line, a DIO or AIO seems like overkill.  However, USB-DIO devices are available for as little as $99.

Another method is to use one of the RS232 lines (DTR is one).  However your trigger would have to be converted to +12/-12 volts for input to an RS232 line.  If TTL, you could also use a data line on the parallel port. 

For using parallel port, search for examples in LV on parallel port.  For using serial port, you can use a property node to get the state of the line.  For DIO or AIO, you can search for examples on those.

Once you have a way to capture the trigger, use whatever method you choose to get the trigger and then you can feed this into a case structure to switch your indicator.  Or you can use the event structure with a value (signaling) method to cause an event.  Inside the event you can wire whatever you want to the indicator.

Choose a method and then post again.  We can then further help you along.  If your trigger is TTL, the USB-DIO method is the easiest to implement, the parallel port is the cheapest (easy also) since it doesn't cost anything (except maybe a cable) as long as your port is not being used by a printer or other device.

- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 3
(2,879 Views)
Thanks for your answer!

The problem was that I wanted to use a PFI-line on a PCI-board (BNC-2110) from NI to trigger the start of a voltage output task. On the other hand, I wanted to use the same trigger event for stopping a while-loop which would otherwise abort the task after some seconds if the trigger didn't come; the data generation itself is rather long, so you have to set the "timeout" terminal of "DAQmx Wait Until Done" to " -1". The problem was that it is not possible (at least on this board) to use a digital in-line for triggering the task and the PFI-line for getting a digital input. So I splitted the signal up: it was weird to both lines and worked as trigger on the PFI and was monitored on a DI-line.

This setup worked, but as there were still some problems, I changed it again. Now I check for some digital in-lines (which provide a stimulus) in a while-loop while waiting for the trigger; if the stimulus changes, the task (which is waiting for the trigger) is aborted. The problem is that if the stimulus doesn't change and the task is triggered as usual and is completed, I can't report that fact to the while loop! So the while-loop goes on and blocks the rest of the diagram. I just wrote another posting concerning that thing, if you would have a look... It can be really a little hard sometimes, can't it...
This thing concerning the event structure and value (signaling) sounds interesting, I'm just trying to figure out the possibilities how to use an event structure; but it's not always really intuitive.

Best regards,
Mitja

Message Edited by Mitja on 11-14-2005 07:09 PM

0 Kudos
Message 3 of 3
(2,861 Views)