LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I create a thresholding function for a 2-D waveform, little to no experience is driving me crazy?

Hello All,
 
I could really use some help here. I have very little experience with LabView and I am trying to create a threshold detector that outputs a boolean value once the threshold is crossed. I am getting a 2-d waveform in from my daq, that part was easy, I am trying to do this in real time and point by point. Ultimately once the threshold is crossed I need a true to go to a while loop which will then perform another operation. I am running LabView 8.0 and could really use the help to get this threshold figured out. Thank you very much, if any further information is required please feel free to let me know.
 
 
I really appreciate it,
Clambake
0 Kudos
Message 1 of 6
(2,822 Views)

Pictures are easier than words....  (On a Sunday evening 😉 )

There are many ways of detecting thresholds.  Below are a few examples.  Remember that the data to the graph is often an array of numerics (doubles - usually).  So simply make use of array functions or comparison functions.  Many math functions are polymorphic and work very well with arrays.  So do boolean functions.

Have a look at the three examples below.  Hopefully they will help.

RayR



Message Edited by JoeLabView on 11-18-2007 09:54 PM
Download All
0 Kudos
Message 2 of 6
(2,804 Views)

JoeLabView gave most of the ways of detecting a threshold. All you need is how to fire off the WHILE loop. The easiest way to do this is to have a WHILE loop waiting on a queue in parallel to your data detection loop. When you detect your data has crossed the threshold, send a message via the queue to the WHILE loop. This message can contain a full waveform or just a few control elements, depending on your needs. The WHILE loop will then wake up, process the queue data, and go back to sleep, awaiting the next data. Note that you cannot lose events with this scheme, although you can run out of memory if you don't keep up.

Let us know if you need more help.

0 Kudos
Message 3 of 6
(2,779 Views)

Actually, the examples were one shot detection.  Yes, for multiple, a While Loop is generally the way to go.

Do a search on "Producer Consumer Loops".  There are examples in the example finder under the Help menu in Labview.

RayR

0 Kudos
Message 4 of 6
(2,773 Views)
Thank you guys! I really appreciate your help, I'll see how it works.
0 Kudos
Message 5 of 6
(2,706 Views)
Thank you again for your help. I was able to get things rolling here with the advice that I previously received however things still aren't working quite as I had hoped. I am using the greater than and equal to threshold to initiate a while loop, however, once the the threshold is met it continues to send a True out to the while loop. The previous responses may provide the information that I am looking for but since I'm new I'm not exactly seeing it. What I would like is to activate this while loop which has a case structure built in to run through a series of functions. This works right now but since the while loop is activated at each data sample it constantly incremements the case structure and runs right through each function. The image below shows the basic idea of what I would like to do. I have an input that is basically represented by the sin^2 function. I would like to threshold this input in real-time and sample the data such that when it crosses the threshold on the up side I can perform one operation which will run only during that single sin^2 bump. This sin^2 function repeats and I would like the next function in the case structure to activate during the next rise and then stop after the bump and so on and so forth. I hope that this provides useful information that helps. I'm really inexperienced and at a loss. Any help is greatly appreciated. Thanks again.
0 Kudos
Message 6 of 6
(2,634 Views)