LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI USB 6000 series Pretriggering

Hello Community, please help me.

 

I am having NI USB 6000 series for my mechanical engineering undergraduate final project (USB 6008, 6001, 6009, etc).

 

I want to capture data from Analog Input Port before the trigger occurred, but as we know that the cheap daq devices do not support pretriggering and reference triggering.

 

If I use Trigger VI for the daq device, the device only capture data after the trigger on PFI0 occured.

 

I found a solution on the internet: using analog software pretriggering (you can find it on NI DAQmx examples, or if you wanna, i will attach here then). 

It is simply checking the data from the Analog Input Port, if the value meets the requirement for trigger, so the trigger will occur and the data recording begin (also some samples of pretriggered data). If the trigger does not happen, so the data in the AI Port will just buffer (FIFO).

If I use that, the problem will be happened if a trigger occurs faster than the NI USB sampling time in AI

 

To solve that, I have an idea like this:

1. Buffer the data in AI port, just like before.

2. While buffering the data, NI USB 6000 series also waiting the PFI0 for trigger signal.

 

Is it possible to buffer data in Analog Input while waiting trigger from PFI0 in NI USB 6008? I need to buffer the data because I want to record also some samples before the trigger in PFI0 really occur.

 

Thanks in advance!

0 Kudos
Message 1 of 15
(2,924 Views)

Hello Community, please help me for this problems.

 

I am having NI USB 6008 and 6009 and 6001 to do data acquistion on my lab as final project on undergraduate program. I am mechanical engineer and it is a little bit hard for me to make new programs because I found no spesific example on the internet.

 

My final project is like this:

As we know that cheap NI USB 6000 series:

- Do not support Analog Trigger.

- Do not support Reference Trigger VIs, so we can not do PRETRIGGERING (acquire some data before the trigger occur).

 

As a solution, actually we can use ANALOG SOFTWARE PRETRIGGER, as mentioned in https://forums.ni.com/t5/Multifunction-DAQ/How-to-use-a-pretrigger-to-obtain-data-on-three-channels-...

or spesifically here in the NIDAQmx Example: Analog Software Trigger with Pretrigger (I attach in Visual C# project, you can read the ReadMe files and .exe files on ContAcqVoltageSamples_IntClk_SWTrigger\CS\bin\Debug.

 

BUT, the program work like this:

The acquired signal or data from Analog Input is checked one by one, if the value is above Trigger Level, so the "trigger will occur" and the data recording begins.

SADLY, those depends on the sampling rate. I mean, if the sampling rate is 1 ms, so it will capture the data in analog input like 1 ms, next one is 1 ms (so capture on 2 ms), next one is 1 ms also (so capture on 3 ms), next on 4 ms, next on the 5 ms, and so on.

WHAT IF THE TRIGGER ACTUALLY OCCURRED in the 1.5 ms time? or 2.5 ms time (not integer of sampling time)? while the data is captured only on 1 ms, 2 ms, 3 ms, 4 ms, and so on.

That is a problem (and of course the main topic for my final project).

 

So, I make an alternative solution:

1. Input the data to Analog Input NI USB 6000 series.

2. The NI USB will wait for PFI0 to get Trigger Signal, while still receiving the data in Analog Input. It a parallel process.

Please keep in note that, in NI USB 6000 series, I should not use Trigger VIs for this case, because it starts the reading, or roughly say, can not read any data before the trigger occured. I want to read and wait the trigger in parallel, right?

3. If the memory of NI USB 6000 series is full, so it will delete the data from the Analog Input (FIFO, Circular Buffer System). 

4. If the PFI0 get trigger signal, it will INTERRUPT the data receiving and say "Okay, now we record the data because our user need the data, capture some pretrigger samples and posttrigger as main data, all from the Analog Input!"

 

So:

Is it possible to buffer data in Analog Input while waiting trigger from PFI0 in NI USB 6008? I need to buffer the data because I want to record also some samples before the trigger in PFI0 really occur.

 

Thanks a lot and so much, greetings from Indonesia 🙂

0 Kudos
Message 2 of 15
(2,932 Views)

Maybe as solution, I can use Counter in PFI0 other than Trigger VI.

 

Is it still possible?

0 Kudos
Message 3 of 15
(2,921 Views)

Maybe as solution, I can use Counter in PFI0 other than Trigger VI.

 

Is it still possible?

0 Kudos
Message 4 of 15
(2,921 Views)

Hello!

 

Is it possible to read or buffer data in Analog Input while waiting trigger from PFI0 in NI USB 6008?

I need to buffer the data because I want to record also some samples before the trigger in PFI0 really occur.

 

Maybe as solution, I can use Counter in PFI0 other than Trigger VI.

 

Is it still possible to read or buffer data in Analog Input while counting PFI0 in NI USB 6008?

 

Is there any example.

 

Is it hard for me to make new programs because my background is mechanical engineering, not that software based.

 

Also, the NI USB 6000 series do not support pretriggering and reference trigger to save data before pretrigger.

Thanks a lot!

0 Kudos
Message 5 of 15
(2,901 Views)

Hi mifta,

 

read your AI signals as fast as possible, then do your "Triggering" in software.

When a trigger event occurs you can keep the data, otherwise you throw it away.

(You may also implement data decimation later on to reduce the sample rate in software, too.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 15
(2,907 Views)

Yep, thanks a lot.

 

But Can I trigger the data saving from PFi0??

0 Kudos
Message 7 of 15
(2,903 Views)

Hi mifta,

 

please stop creating double posts on the same topic: keep things in one place for the same problem!

(And what's the point in using this "NI Product Announcement" tag?)

 

But Can I trigger the data saving from PFi0??

Not with those cheap USB600x devices: they only support StartTrigger for DAQmx tasks…

(AFAIK there is no option to trigger data saving (aka file writing) directly from a DIO/PFI pin.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 15
(2,898 Views)

Thanks for the Reply GerdW!

Sorry, the doubled thread occurred because of connection.

Sorry also not much know about things here.

0 Kudos
Message 9 of 15
(2,883 Views)

But StartTrigger actually start the data saving, right?

Maybe I use different word, but I mean data saving is acquiring data.

0 Kudos
Message 10 of 15
(2,864 Views)