Promotic
WikipediaLinkedInYoutubeTwitterFacebook

SetValidityFce - method of the tvGraph object

Description:
Sets text as validity function for the tvGraph object.

Data points of the trend (see the tvPoints object) are checked by each object of the tvGraph type (there can be created more objects in the tvTrend object, see the tvTrend.AddGraph method) and the time range where data points satisfy the validity function of one in graphs, is drawn just by the tvGraph object.

The SetValidityFce function needn't be called in most cases because the validity function is set also on creating the tvGraph object while calling the tvTrend.AddGraph method where it is possible to enter as a parameter.

Syntax:
Long SetValidityFce(String sValidityFce)
Parameters:
sValidityFce(String) Text definition of the condition for when to use the tvGraph object.

In the following text the real number is set into val and the xx has the following meanings:

gt=greater than, ge=greater or equal, eq=equal to, le=less or equal, lt=less than.

"LimitVal(xx;val)" - The tvGraph object is used if values of data points in the tvPoints object exceed (equal, under pass, see xx) the real value val.

Example: "LimitVal(gt;100)"

"LimitTrend(xx;t1)" - The tvGraph object is used if values of data points in the tvPoints object exceed (equal, under pass, see xx) values of data points of another trend whose tvTrend.ID is equal to t1.

Example: "LimitTrend(gt;t1)"

"LimitTrendCompare(xx;t1;val)" - The tvGraph object is used if values of data points of another trend (tvTrend.ID is equal to t1) exceed (equal, under pass, see xx) the real value val.

Example: "LimitTrendCompare(gt;t1;100)"

"AlwaysTrue" - The tvGraph object is used always.
"AlwaysFalse" - The tvGraph object is never used with this setting.

This setting can be used e.g. to block the tvGraph object. This way it is possible to prepare multiple tvGraph objects, each with setting "AlwaysFalse" and the enable one dynamicaly with setting e.g. "AlwaysTrue".

Return values:
0 - Syntax error. The validity function was not set.
1 - The validity function "AlwaysFalse" was set correctly.
2 - The other validity function was set correctly.
Note:
Preset values of the validity function can be found in the "Style > Validity" configurator.
See also:
Example1:
JavaScriptVBScriptSelect and copy to clipboard

var oTView = pMe.Items("../TrendView");
var oTrend = oTView.Trends("t1");
var oGraph = oTrend.AddGraph(1, 0, "");
var nRet = oGraph.SetValidityFce("LimitVal(gt;100)");

if (nRet > 0)
//OK
Example2:
JavaScriptVBScriptSelect and copy to clipboard

oGraph.SetValidityFce("LimitTrend(gt;t1)");
Example3:
JavaScriptVBScriptSelect and copy to clipboard

oGraph.SetValidityFce("LimitTrendCompare(gt;t1;0)");
PROMOTIC 9.0.15 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice