Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I trigger an event with the DAQ?


All the LabVIEW examples dealing with events seem to trigger with a mouse action or buttons on the front panel.  These are both easy to find by poping up on the event structure and looking around.  I need to trigger on the change of a simple bit input on my DAQ.  I already know how to do this with polling, but I wanted something that didn't constantly run and waste CPU. 

I wish LabVIEW had a simple tri-state device configurable to peripheral states to manage dataflow instead of another confusing structure type.

0 Kudos
Message 1 of 4
(3,658 Views)

Hi Munch,

You can use the DAQmx event to trigger software off of an input on your DAQ card. Check out the "Gen Event for Ext Signal.vi" from Example Finder under Hardware Input and Output>>DAQmx>>Events. Note that this will not work with USB devices, but will work with the rest of the M-Series line. Also note that you can trigger acquisition by using a start or reference trigger.

Hope this helps, please post back if it doesn't. If you do need more help, including the model of the card, OS, LabVIEW version and driver(DAQmx) version is always helpful for posts.

Cheers,

Andrew S.

National Instruments

Message 2 of 4
(3,644 Views)
Thank you for the help.  I have another problem.  I am using an NI-DAQ 6220 and want to take data triggered by the encoder (angular position).  It looks like I can only trigger data to be taken at one edge of one phase of the encoder.  I need to find a way to check data at every transition on both phases.  I could create four different tasks to read the positive edge, then the negative edge on channel A and channel B, but there should be an easier way to do this.
0 Kudos
Message 3 of 4
(3,626 Views)

Hi Munch,

I'm not sure that I understand your question - Do you mean use the different edges to latch in values for an analog input or using a X4 encoder? The X4 encoder can be achieved by using the Measure Angular Encoder.vi shipping example. Using the rising and falling edges of the encoder signals to drive an AI is not going to be possible without some additional hardware. Our M-Series cards to not support clocking on the rising and falling edges, either on counters or AI. If you could find some external circuitry to turn the transitions into positive or negative edges, then you sould use that signal to clock your AI. If you had 2 cards, you could have one use the rising edge and the other use the falling edge and correlate the data in software. Even then using both phases is going to prove problematic. You will not be able to run different HW timed AI tasks at the same time on the same card, regardless of the edges they are detecting. All AI channels are multiplexed into a single ADC.

Hope this helps,

Andrew S

Message Edited by stilly32 on 01-31-2007 12:58 PM

0 Kudos
Message 4 of 4
(3,603 Views)