Hysteresis added to Formula tab
int[] HysNum = new int[1];
bool[] Hys = new bool[1];
public double Hysteresis(double inCnl, double low, double high)
{
bool q = Val(CnlNum) > 0;
int res = Array.IndexOf(HysNum, CnlNum);
if (res == -1)
{
res = HysNum.Length;
Array.Resize(ref HysNum, res+1);
Array.Resize(ref Hys, res+1);
HysNum[res] = CnlNum;
Hys[res] = q;
}
if (inCnl < low) Hys[res] = true;
if (inCnl > high) Hys[res] = false;
return Convert.ToDouble(Hys[res]);
}
In the channel, use the formula Hysteresis(Val(X), 32.5, 33.5))
Where Val(X) is your measurement channel. Enabling and disabling the output is already configured for the channel in which you use the Hysteresis formula