Promotic
WikipediaLinkedInYoutubeTwitterFacebook

SetValidityFce - method of object tvGraph

Description:
Sets text as validity function for tvGraph object.

Data points of the trend (see tvPoints) are checked by each object of the tvGraph type (there can be created more objects in the object of the tvTrend type, see tvTrend.AddGraph) 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 also set on creating the tvGraph object while calling the tvTrend.AddGraph where it is entered as a parameter.

Syntax:
SetValidityFce(sValidityFce As String) As Long
Calling:
oGraph.SetValidityFce 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.Acx;
var oTrend = oTView.Trends("t1");
var oGraph = oTrend.AddGraph(1, 0, "");
var n = oGraph.SetValidityFce("LimitVal(gt;100)");

if (n > 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 8.3.24 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