TrnIsValidValue
- Last UpdatedJul 18, 2023
- 1 minute read
Determines whether a logged trend value is:
-
<VALID> - an actual trend value;
-
<GATED> - if a periodic trend has a trigger condition, and that condition is FALSE, a standard substitute (or GATED) value is logged instead of the actual value; or
-
<INVALID> - for some reason, no value was logged.
Syntax
TrnIsValidValue(TrendValue)
TrendValue:
A trend value (of type REAL).
Return Value
0 for <VALID>
1 for <GATED>
2 for <INVALID>
Related Functions
TrnGetGatedValue, TrnGetInvalidValue
Example
INT
FUNCTION
DoubleArray()
INT i;
FOR i = 0 TO 99 DO
IF TrnIsValidValue(oldArray[i]) = 1 OR trigger = 0 THEN
newArray[i] = TrnGetGatedValue();
Prompt ("This value is <GATED>");
ELSE
IF i >= 90 OR TrnIsValidValue(oldArray[i]) = 2 THEN
newArray[i] = TrnGetInvalidValue();
ELSE
newArray[i] = oldArray[i] * 2;
Prompt ("This value is <TRN_NO_VALUES>");
END
END
END
RETURN i;
END