11-18-2007 11:08 AM
11-18-2007 08:53 PM - edited 11-18-2007 08:54 PM
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
11-19-2007 08:23 AM
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.
11-19-2007 09:22 AM
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
12-07-2007 01:29 PM
01-14-2008 03:23 PM