LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

digital trigger to stop/start analog data acquisition

Solved!
Go to solution

I want to use a signal from a digital line to start and stop analog data acquisition. The signal can change levels multiple times during one run of the VI so I have to start/stop data acquisition multiple times and store the data from each session in a different file.

 I have tried playing around with the following VIs: Digital Pause Trigger, DigitalStartandStopTrigger, and ContAcq_DigTrig. None of them seem to work for my setup. I am also doing continuous data acquisition so I can't use a reference trigger. I'm using PCI 6259 DAQ.

 

0 Kudos
Message 1 of 29
(15,133 Views)

Hi abdel2,

Thanks for posting on the NI Discussion Forums!  I understand you are trying to use a digital signal to start and stop analog data acquisition.  In addition to the discussion forums, a great resource is our KnowledgeBase articles.  If you go to www.ni.com, search for the keywords "digital trigger start and stop".  The very first link is the following KnowledgeBase article.

 

How Do I Use a Digital Trigger in LabVIEW to Start and Stop Acquiring Data?

I know that you mentioned you cannot use a reference trigger.  However, this is the method to start and stop analog data acquisition using our DAQmx driver.  You will configure a finite acquisition to act like a continuous one by continuously reading the buffer.  Post back if you have issues interpreting the article, or implementing the concepts to your application.

Rod T.
Message 2 of 29
(15,098 Views)

Thanks RT4CY.

 

I'll look at the links to do digital start and pause triggering, but for some reason just the start trigger alone is not working. I am running the example "Gen Dig Pulse-Dig Start.vi" which is supposed to generated a pulse when an external trigger is activated. I am using PFI3 as the trigger. I have an input connected to this line and I can even see the LED light up when I change input on another machine. Still the VI does not generated a pulse. Somehow the external digital trigger does not work. If I use an internal clock (ie: 100kHzTimebase) as the digital trigger, it works fine. 

0 Kudos
Message 3 of 29
(15,026 Views)
Never mind. I figured it out.
0 Kudos
Message 4 of 29
(15,017 Views)

Hey abdel2,

 

I'm very happy to hear you got this working!  What ended up being the problem with the external trigger?  If you could post the problem and solution, it may benefit someone else in the community who is having a similar problem.  Thanks!

Rod T.
0 Kudos
Message 5 of 29
(15,000 Views)
Solution
Accepted by abdel2

I was using the "P0" pins rather than PFI pins on the 2090A BNC rack. I know...pretty stupid. 

0 Kudos
Message 6 of 29
(14,996 Views)
Not at all, and thank you for posting back! Smiley Happy
Rod T.
Message 7 of 29
(14,986 Views)

RT:

I have a similar application as abdel.

I am using Labview 8 and USB-6009 DAQ device to measure a cyclic voltage and write data to a file.

 

I am attempting to start data acquisition (start trigger) when voltage is above zero and store the data from each session in a different file and stop data acquisition (stop trigger) when voltage falls to zero.

 

I downloaded "DigitalStartandStopTrigger.vi" as you recommended but I get following error:

Error -200077 occurred at Property Node DAQmx Timing (arg 5) in DAQmx Timing (Sample Clock).vi:1->DigitalStartandStopTrigger.vi.

 

When I run the vi with "Highlight Execution" ON, this Error appears at the output of "Reference Digital" node in the block diagram. I suspect this vi was written for DAQ M Series and may not be compatible with USB-6009. Is there any way I can reconfigure my DAQ device or modify the vi to be able to run the VI?

Please advise. Thanks.

0 Kudos
Message 8 of 29
(13,937 Views)

Hi David,

 

You are correct in thinking the example is not compatible with the USB-6009. The 6009 does not support hardware timed triggering so any triggering done in your application will have to be software timed. Depending on how rapidly your data is being acquired, the trigger may not have time to re-arm itself before the next acquisition. You could try using a software timed analog trigger with a hysterisis window such as the below example.

 

https://decibel.ni.com/content/docs/DOC-11666

 

 

 

  

Jake H | Product Manager
Message 9 of 29
(13,916 Views)

Hello David,

 

You won't be able to use a reference trigger to stop the acquisition with the 6009 as it does not support that feature.  The 6009 does support a hardware start trigger, you can configure the ai start trigger source as PFI0.  For stopping the task, you can do one of two things:

 

1) If you have a free analog channel, connect your trigger signal to that channel.  Stop the while loop on the condition that the value returned exceeds the trigger threshold.

 

2) Create a digital input task in parallel with  your analog task. Monitor the digital line and stop the while loop on the condition that you see a TRUE value returned.

 

trig.png 

Rod T.
0 Kudos
Message 10 of 29
(13,904 Views)