From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Acquiring data with NI USB-6008 every time it is triggered

Hello! I'm very new to labVIEW (just started working with it yesterday) and my goal is to acquire data from de DAQ board every time it is externally triggered. I'll have a device connected to my PF10 chn that will send triggers every 1sec, and I need to record data every time it does. What I was able to do so far was wait for my trigger to be first read and only then start to acquire the data, but once the first trigger is in, even if I stop triggering the DAQ it keeps acquiring data. I want it to acquire data only every time it is triggered. Is there a way to do this using labVIEW?

 

Thank you in advance.

0 Kudos
Message 1 of 7
(1,412 Views)

Hi Teresa,

 

the USB6008 only allows for start triggers…

 

(You could start your acquisition upon trigger signal, stop the task after 0.1s, and restart the task to wait for the next trigger. This might work when the trigger signal will only occur every 1s or so…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(1,408 Views)

Oh okay, that sounds like a good option, thanks. I was reading about dynamic and static events, does that have anything to do with this problem, could I use it to fix my problem?

 

Also, I was able to trigger this DAQ board consecutively with matlab, so is it a DAQ problem or a labVIEW problem?

0 Kudos
Message 3 of 7
(1,373 Views)

HI Teresa,

 


@teresacarneiro wrote:

I was reading about dynamic and static events, does that have anything to do with this problem, could I use it to fix my problem?


Events in an event structure have nothing to do with your cheap USB6008 DAQ device…

 


@teresacarneiro wrote:

Also, I was able to trigger this DAQ board consecutively with matlab, so is it a DAQ problem or a labVIEW problem?


How did you "consecutively trigger the USB6008 with MATLAB"?

Again: the USB6008 only supports a start trigger as can be read in the datasheet!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 7
(1,361 Views)

Hello, Teresa.

 

     If you are "very new to LabVIEW", and some LabVIEW code that you are running is not acquiring data from an NI USB-6008 every time it is triggered" (although it acquires properly using Matlab), doesn't it make sense (to you) to show us what you are doing (by attaching the LabVIEW code, preferably the VIs you are using, showing how they are connected)?  Maybe you just left out a "wire" ...

 

Bob Schor

0 Kudos
Message 5 of 7
(1,354 Views)

teresacarneiro_0-1626432172808.png

teresacarneiro_1-1626432281244.png

Yes, you're right, but I only have this, and I'm using arduino to trigger the DAQ board right now, but when I disconnect arduino it keeps acquiring data, and I only want it to acquire data while it's being triggered.

0 Kudos
Message 6 of 7
(1,305 Views)

Hi Teresa,

 

Bob asked you for code and all we got are two images, showing parts of the code…

Please attach code (VIs!), when you are asked for code!

 


@teresacarneiro wrote:

 

I'm using arduino to trigger the DAQ board right now, but when I disconnect arduino it keeps acquiring data, and I only want it to acquire data while it's being triggered.


Again I repeat: the USB6008 only supports a start trigger! After being started it will continue to acquire samples - until you stop the task. Did I mention that already in message #2?

It is even visible in your image: you configured a "start trigger" in the DAQAssistent ExpressVI!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 7
(1,298 Views)