About This File
The Threshold Hysteresis VI allows an input (for example, a sensor) to drift out of an inner limit without generating an invalid flag, but if it drifts outside an outer limit it then becomes invalid. For the reverse, when the input crosses back into the outer limit it remains invalid until the value falls inside the inner limit.
For simplicity, only one input parameter is provided for both the inner & outer limits, and is negated for the lower limit, as generally tolerance limits are equidistant from the nominal.
What's New in Version 2.0 See changelog
Released
Probably the most elementary hysteresis detector ever coded in LabVIEW, this program uses an in-range Comparator to determine whether the input parameter falls within a range specified by the inner and outer limits.
The data valid output is only True when the measured parameter traverses from within the inner limit to the outer limit but is invalid when traversing from outside the outer limit until it is back within the inner limit.
Single upper limits are provided as a Negator to used to supply an equivalent negative lower limit to the in-range comparator, as this sub-routine was used to check sensor drift on a referenced (zeroed) alignment device. The simplicity and beauty of this software routine is that the output of the Comparator is used to determine whether the inner or outer limits are active at any one time.
The code can of course be modified to provide both positive or negative limits as required.
https://www.linkedin.com/pulse/threshold-hysteresis-detector-deon-bester/