openTrendCurves()

Opens a trend with a configuration trendName and replaces the curves that contain a dollar parameter.

Synopsis

void openTrendCurves(string trendName, int trendType, dyn_string Curves, string sModuleAndPanel="");

Parameters

Parameter Description
trendName Name of the trend group
trendType Integer number for characterizing the trend type. Use the following parameters:
-1 Last view
0 Undefined
1 Trend of today open
2 Trend of today closed
3 Trend of the selected day closed
4 Trend of the current week closed
5 Trend of the last week closed
6 Trend of the selected time range closed. A panel for the selection of the time range opens.
7 Trend of the last 24 hours open
8 Trend of the last 3 day open
Curves The return value of makeDynString("$CURVE1:dp1", "$CURVE2:dp2", "$CURVE3:dp3 ".. ,"$CURVE8:dp16). A single display can contain up to 16 curves. The used data points will be dp1 to dp16. You can also use a CNS name instead of a DP. In this case the CNS name is shown unless the DPE linked to a CNS node does not have a description.
sModuleAndPanel A module and a panel in which the trend is opened.

Return value

void

Error

Description

Opens the trend with the configuration trendName and replaces the curves that contain a dollar parameter. For easy working with the Variable Trend, there are 2 curves predefined by default. The function call is according "$CURVE1:[DP].C?+1.MIN" meaning that the compressing level is not fixed. You can also use:

"$CURVE1:[DP].C?-1.MIN"

The function with C? automatically selects the best display for the values.

The function openTrendCurves replaces the dollar parameters of a trend curve. The curve that is open must not contain a data point. The DP is passed with the Curves parameter of the openTrendCurves() function. See also the chapter Trend Configuration Editor Panel.

Example

The trend group "MIN-MAX" opens, for example, a trend display with a black curve of a measured value, a red curve for a maximum value and a green curve for a minimum value. In this case, the function for a compressed data point would be:

main()
{
  openTrendCurves("MIN-MAX", -1, makeDynString("$CURVE1:TEST.C1.AVG", "$CURVE2:TEST.C2.MIN",
                  "$CURVE3:TEST.C2.MAX"));
}

Automatically, the Variable Trend displays in a new module.

Example

In this example, the trend "ExampleTrend2" opens in the type "last view" and the values of the DP "ExampleDP_Result" will be shown.

main()
{
  openTrendCurves("ExampleTrend2", -1,
                   makeDynString("$CURVE1:ExampleDP_Result."));
}       

Example

CNS names can be used for a trend curve:

main(mapping event)
{
  openTrendCurves("VarTrend_0002",1,makeDynString("$CURVE1:System1.Windpark:WindWane.WindDirection.Easterly", "$CURVE2:System1.Windpark:WindWane.WindDirection.TrueNorth"));
}            

Assignment

Dialog functions

Availability

UI