Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

detect trigger

Hello, everyone.

I can't figure out how it is possible to detect a trigger (on a PFI-line) for a DAQmx-task to tell when exactly the task starts. Of course I can split the signal up into an addition Digital In signal and create an according task, which would switch a boolean if the line goes high. But is there no other possibility? I didn't find an according property of whichever property node...

0 Kudos
Message 1 of 7
(4,356 Views)

Hi!

Have a look on the examples of LabVIEW...

For DAQmx you can find it here: C:\Programme\National Instruments\LabVIEW 7.1\examples\DAQmx\

An example for a digital trigger is located in this folder: C:\Programme\National Instruments\LabVIEW 7.1\examples\DAQmx\Analog In\Measure Voltage.llb\Acq&Graph Voltage-Int Clk-Dig Start.vi

regards,

ThSa

0 Kudos
Message 2 of 7
(4,342 Views)
Thanks for your answer, though I don't see what the example has to do with my question, as there is still no possibility to >detect< the trigger by making a LED on the front display shine.

0 Kudos
Message 3 of 7
(4,324 Views)

Our E and M Series devices don't have any built-in functionality specifically designed for telling you when a task starts. But there are several options.

1. You can poll the Total Samples Acquired (probably not the exact name) for input or Generated for output. When it starts to increment, the task has started.

2. You can connect the trigger to a digital line and poll that.

3. You can use the trigger as the source of an edge counting task and poll the number of counted edges. When it goes from 0 to 1, you have your trigger.

4. My favorite, you can use the trigger as a timing source for a timed loop. This only works in LabVIEW. When the trigger arrives, any code you have in the timed loop (light your led) will execute.

Message 4 of 7
(4,321 Views)
Thanks!

1. I tried it before, but it did not work, as before the vi 'DAQmx Wait Until Done' no samples are there and after it all the samples are there; I never got anything which >started< to increment (also with local variables).
2. Infortunately, I can't use a PFI-channel on my board for a digital in task and I can't use a digital in line for triggering directly. If I use a digital in task with a while-loop for reading single samples and triggering if the sample is high, the time delay is too big.
3. + 4. I didn't try this, so I will. The timed loop possibility sound really nice, now I just have to figure out how to wire that thing correctly. If you had an example at hand, it sure would be very helpful...

Thanks-

Mitja


0 Kudos
Message 5 of 7
(4,309 Views)
Use the DAQmx Create Timing Source.vi. It's in the Timed Loop sub-palette of the Real Time sub-palette of the DAQmx palette. Choose the Digital Edge (Counter) personality. Set the source to /Dev1/ai/StartTrigger and the edge count to one. Drop a timed loop. Double click on the 'left ear' and select Use Timing Source Terminal. Wire up the timing source out output of the Create Timing Source vi to the Source Name input of the left ear of the timed loop. Now, the loop will execute when your analog input task starts, regardless of what starts the task.
 
<actually, the E and M Series boards do have functionality built in that can be used to notify an application when a task starts. It's just that DAQmx exposes these in an indirect way>
0 Kudos
Message 6 of 7
(4,296 Views)
Thank you very much. It works (almost) as it should, and after all I got the idea.

0 Kudos
Message 7 of 7
(4,283 Views)