LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Recording continuous data above a threshold using the reference trigger vi

Solved!
Go to solution

Hello,

 

I am quite new to LabVIEW, and I'm seeking to create a program that gathers data from an ae sensor connected to an NI 9775 card. This is easy enough, but my current goal is to set a threshold in volts so that only data points above that threshold are written to a measurement file. I started out with using the "Threshold Detector PtByPt" vi to check the data against an input value, and, if the read value exceeds the threshold, a case structure is activated and enables the Write to Measurement File. This program is linked below and is titled "AE Sensor Threshold and Producer Consumer Loop Without Trigger.vi". This program somewhat works, as I get text files that only include values above my threshold (using 0.004), but it's clearly missing most of the actual data that's being read, as I can run the program for a minute and only get a handful of data, even though I know there are a ton more points above 0.004. Attached is a screenshot of the text file containing a few points above 0.004.

 

After a bit of searching, I found the DAQmx Reference Trigger Analog Edge vi, which seems perfect for my uses, as I would ideally like to record the data above the threshold as well as the pretrigger samples, as well as record each "hit" in it's own separate measurement file for later analysis. However, after playing around with it some, I seemingly cannot get the program to record any data at all. Could someone suggest what I might be doing wrong, as well as any tips for using the reference analog edge or any improvements to my code without the trigger? My current code using the DAQmx Reference Trigger vi is linked and titled "AE Sensor Threshold and Producer Consumer Loop With Trigger.vi"

 

Thank you,

Harrison

0 Kudos
Message 1 of 8
(1,140 Views)

Hi Harrison,

 

Would you please save your codes to previous version? I cannot open them.

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Colossians 3:17 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 Kudos
Message 2 of 8
(1,122 Views)

Yes of course! Please let me know if this works, or if I need to send the folder that it gives me when I select "Save for Previous version." This should be for version 17, I believe.

 

Thank you,

Harrison

0 Kudos
Message 3 of 8
(1,110 Views)

Yes, the codes worked. Thanks! What are you expecting to be your threshold? Like is there a specific value or range maybe?

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Proverbs 16: 3 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 Kudos
Message 4 of 8
(1,098 Views)

If I use DAQ Assistant, background noise registers at about 9-13 mV, so I'm expecting a threshold of about 0.014 minimum for picking up anything above background noise. However, I've been sort of arbitrarily using 0.004 because many of the values that show up on the data display are beneath that, and I figured it would be a good indicator for if the measurement file was picking up data quickly. As for the actual application of the sensor, we do not yet have the experimental setup needed to find what level of values we'll be looking for.

0 Kudos
Message 5 of 8
(1,085 Views)
Solution
Accepted by topic author Harrison_Greene

Hi Harrison,

 

what about this to filter only values above your threshold value:

 

  • I don't recommend to manipulate measurement data this way: most often you will later on need to also analyze base level noise. It might be easier to only log data for "real measurement events", but with all samples (even "noise") included…
  • I recommend to stream your data to TDMS files, DAQmx can even do that for you…
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 8
(1,041 Views)

Thank you so much! 

 

This works perfectly for recording the data over the threshold, which is a huge step in the right direction for me, but you are right in that I ideally want to record data besides just the values over that threshold. I would like to instead start recording values once the threshold is triggered and continue until the data drops below that threshold, alongside some amount of pretrigger values.

 

This is why I thought that the DAQmx trigger vi, set to Reference Analog Edge, would be perfect, as it describes doing just that, but I am struggling to get that to work. 

 

The end goal of this project is to be able to read data from my ae sensor, and when a set threshold value is reached, it records pretrigger data and all the data that comes through during the time span in which the threshold is being exceeded. It then spits this "hit" into it's own separate text file (which I think should be as simple as wiring a constant "true" to the reset on Write to Measurement file or TDMS). At the same time, I'd like to have a file that records the highest point and duration of each of these separate "hit" files.

 

Thank you again,

Harrison

0 Kudos
Message 7 of 8
(1,017 Views)

Hi Harrison,

 

Can you please mark GerdW's answer as the best? just as a reference for someone who may be having the same issue in the future. 

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ John 3: 3 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 Kudos
Message 8 of 8
(1,011 Views)