Quantcast
Channel: LabVIEW topics
Viewing all articles
Browse latest Browse all 67236

Capture fist occurrence of threshold

$
0
0

I'm trying to find the first occurrence of a passing a threshold using the Threshold 1D Array function.  My labview program is continuously sampling the output of a variable DC power supply.  The supply will start at 0V and I will increase and eventually pass the set threshold.  I'm using a DC power supply to simulate a transducer that will essentially output a step function with a rise time of 50ms and amplitude of 5V.  I don’t have the transducer yet.  What I want to accomplish in labview is to display only the first occurrence of the threshold being passed.  In my attached BD, the threshold function refreshes with every while loop iteration.  The while loop reads 100 samples of data sampled at 1kHz with each iteration.  Because this is much faster than I can turn the knob, the reported index is either 0 or 99 depending if I'm increasing above the threshold or decreasing below the threshold.  If I turn my knob quickly about the threshold point, I can see the index indicator very briefly display an index between 0 and 99.  I'm not sure how to only capture the first occurrence and could use some guidance.

 

Another idea I’ve been toying with is to eliminate the continuous sampling and do a measurement analogous to a single sweep on an oscilloscope.  I could tell labview to capture a finite amount of samples that would capture the whole step function from the transducer.  Then have a for loop function that would store the results into an array.  The entire array would then go into a threshold function.  I’m still new with labview and I’m not sure how to implement that in a BD.


Viewing all articles
Browse latest Browse all 67236

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>