LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use a trigger on NI 9218?

Solved!
Go to solution

Goodmorning, i'd like to acquire IEPE acceleration data with a NI 9218 module. I wish i could start acquiring data when acceleration signal crosses a certain value. To perform that i tried to add a trigger in my labview program, in start analog edge mode. Every time i run the program it notifies me of an error, Error -200265. Could the problem be that my Ni module doesn't support analog triggering?

So i tried with start digital edge mode, selecting cDaqmx/ai/StartTrigger as reference terminal from which to acquire digital signal. 

Sometimes acquisition starts immediately when i run the program, sometimes it doesn't acquire anything.. why? how can i see how the digital signal provided by the terminal is?

Is there a way to start acquiring data when signal crosses a value i can assign?

Thank you 

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

Hi federicolozer,

 

The first approach you took seems to be the most suitable for this case-- In order to start acquiring data after the signal crosses a certain value, you need analog triggering

afort_1-1662764498882.png

 

I recommend you take a look at the following link, section D (Analog Hardware Triggering): NI-DAQmx Data Acquisition Triggering Techniques

If that does not solve the issue, please attach your code so that we can provide further support.

 

Best,

 

Fort

Message 2 of 7
(1,788 Views)

Thank you Fort, but i've alredy seen that page.

I tried to run this program:

program.png

I selected an analog edge trigger to start the acquisition when signal reaches value 0.1.

As source i selected the same of the physical channel.

When i run the program, the error is:

error1.pngerror2.png

Maybe should i try some other inputs as source, slope or level?

Accelerometer signal is really noisy, could it be a problem?

The fact that the valid choises are none, seems to be that it is not possible to use an analog trigger.

So searching on the net, i found this page: Supported Trigger Types for DAQ Devices - NI

My NI 9218 module (C series board) does not support analog triggers.

So how can i start the acquisition at a certain signal value if analog trigger is not supported? 

Is there a way to use it anyway?

Thank you 

0 Kudos
Message 3 of 7
(1,757 Views)
Solution
Accepted by topic author federicolozer

Since your hardware does not support analog-level triggers, you have to do something in software that behaves like a trigger.

 

For instance, continuously capture the waveform and monitor if any of the samples are above the threshold, once you find a sample above the threshold, start storing the subsequent samples in the location of your choice.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
Message 4 of 7
(1,734 Views)

[Edit: second time today I queued up a thread for subsequent reply, stepped away for a while, and found the question already answered by the time I posted my reply.  Ah well, here it is anyway.   Note that my remarks about pre-trigger samples are probably not relevant for your immediate app, since a Start Trigger would give you 0 of them.]

 

A workaround is to do continuous acquisition and monitoring so you can detect the trigger condition in software, and retain the desired amount of pre- and post-trigger data.

 

A good headstart is the function "Basic Level Trigger Detection.vi" found in the Waveform Monitoring sub-palette.  There's a shipping example called "Basic Level Triggering of Waveforms" that illustrates how it works on a pair of sine waves.

 

You'll still have a little work to do to integrate it into your app (such as retaining data from prior iterations to be sure you have at least enough pre-trigger samples to draw from), but that function will do the bulk of the "heavy lifting" for you.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 5 of 7
(1,722 Views)

As mentioned earlier your device does not directly support Analog triggering.

 

If you don't have access to the manual or the internet, you can always use a property node to see if it is supported along with what modes are supported.

 

mcduff_1-1663004700564.png

 

Message 6 of 7
(1,706 Views)

Thank you all! I will follow your advices and i'll create a software trigger to emulate the analog one.

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