TREND

Concept Link IconSee also Concept Link IconExample

Modify the operation of a Trend Viewer.

Partial WebVue support - See the table with the list of modes below. Not supported modes return an unsuccessful code if used in this context.

If using a project with multiple regions, you must set the region before executing any instructions that interacts with the HMI. For further information, see the REGION topic.

Mode Mnemonic Syntax WebVue support
1 SETTYPE 1 Yes
2 GETTYPE 2 No
3 SETYRANGE 3 Yes
4 GETYMIN 4 No
5 GETYMAX 4 No
6 SETPERIOD 5 No
7 GETPERIOD 6 No
8 SETDATETIME 7 Yes
9 SETDATETIMEPERIOD 8 No
10 SCROLLPERCENT 9 No
11 SCROLLTIME 10 No
12 GETDATETIME 11 No
13 GETCURSORVALUE 4 No
14 SETVAR 12 Yes
15 GETVAR 13 No
16 ADDVARLIST 14 No
17 SETVARLIST 15 No
18 SETVARBUF 16 No
19 RESETVAR 17 No
20 CLEARVAR 17 Yes
21 CHANGEID 18 No
22 SETTIMECAPACITY 5 No
23 SETCOLOR 19 Yes
24 SETSTYLE 1 Yes
25 HARDCOPY 20 No
26 GETSTYLE 22 No
27 SETYMIN 21 Yes
28 SETYMAX 21 Yes
29 GETCOLORRED 22 No
30 GETCOLORGREEN 22 No
31 GETCOLORBLUE 22 No
32 REFRESH 20 No
33 THRESHOLD_SETMODE 23 No
35 THRESHOLD_SETPROP 24 No
36 THRESHOLD_SETVALUE 25 No
37 THRESHOLD_DRAWLINE 26 No
38 DRAW_MINLINE 27 No
39 DRAW_MAXLINE 27 No
40 DISPLAY_MINMAXLINE 30 No
41 SETTIMEORIGIN 28 No
42 SETTIMEOFFSET 29 No
43 EXPORT 20 No
44 SET_VISIBLE 31 No
45 DISPLAY_SCALE 31 No
46 THRESHOLD_GETMODE 4 No
47 THRESHOLD_GETVALUE 32 No
48 THRESHOLD_ISCHECKED 32 No
49 THRESHOLD_ISDRAWLINE 32 No
50 THRESHOLD_GETCOLOR 32 No
51 THRESHOLD_GETSTYLE 32 No
52 SHOW_LEGEND 33 No
54 GETCONFIG 34 No
55 SETCONFIG 35 Yes
56 GETCONFIG_ASYNC 36 Yes
57 SETSAVERUNTIMEPROPS 37 No

All syntaxes

Argument

Meaning

Window The name of the window that contains the Trend Viewer which is to be used. Type STR.
Branch The branch of the window (if any). Using a "*" means the current branch of the program. Type STR.
Identity The identity of the Trend Viewer animation within the specified window. Type STR.
Trace

The number of the trace to modify. Type INTEGER, range 0 to 100.

In general, where a function operates on a single trace, the trace is identified by a number in the range 1 to 100. However, if the trace number is 0 or omitted then all traces of the trend will be affected.

The time parameters are of type DOUBLE, representing the number of milliseconds from the 1st January 1980.

Syntax 1

IntVal = TREND( Mode, Window, Branch, Identity, Trace, SubMode);

Return type: INTEGER.

Argument

Meaning

SubMode The Mode of operation for the selected trace. Type INTEGER.

Execution

Mode

Mnemonic

Action

1

SETTYPE

Change all traces to historic (SubMode= 2) or real-time (SubMode = 1). The Trace parameter is not taken into account and must be set to 0.

24

SETSTYLE

Change the style of the selected trace according to the SubMode:

0 A square wave.

1 A triangular wave.

2 A series of dots.

 

 

Return: 1 if successful, else 0.

Syntax 2

IntVal = TREND(Mode, Window, Branch, Identity, Trace);

Return type: INTEGER.

Execution

Mode

Mnemonic

Action

2

GETTYPE

Return the Mode of operation for all traces. The Trace parameter is not taken into account and must be set to 0.

Return:

1 for real time.

2 for historic.

0 if unsuccessful.

Syntax 3

IntVal = TREND(Mode, Window, Branch, Identity, Trace [, Ymin, YMax]);

Return type: INTEGER.

Argument

Meaning

Ymin, YMax

The range for the selected trace. Type DOUBLE.

Execution

Mode

Mnemonic

Action

3

SETYRANGE

Change the Y axis range for the selected trace.

If the Ymin and Ymax are omitted the range is reset to that of the trend viewer's original configuration.

If Trace is 0, then all traces are affected, else the specified trace is affected.

 

 

Return: 1 if successful, else 0.

Syntax 4

DblVal = TREND(Mode, Window, Branch, Identity, Trace);

Return type: DOUBLE.

Execution

Mode

Mnemonic

Action

4

GETYMIN

Return the ordinate scale minimum value for the selected trace.

5

GETYMAX

Return the ordinate scale maximum value for the selected trace.

13

GETCURSORVALUE

Return the value of the selected trace at the current cursor position.

46 THRESHOLD_GETMODE

Return the threshold system associated to the selected trace.

-1 No threshold

0 Automatic (e.g. according to the variable configuration)

1 ppphi/pphi/phi/hi

2 pphi/phi/hi/lo

3 phi/hi/lo/plo

4 hi/lo/plo/pplo

5 lo/plo/pplo/ppplo

    Return DBL_MIN if unsuccessful.

Syntax 5

IntVal = TREND(Mode, Window, Branch, Identity, Duration[, ForceHistoricalRequest]);

Return type: INTEGER.

Argument

Meaning

Duration

A time period expressed in milliseconds. Type DOUBLE.

ForceHistoricalRequest A flag to force a request to historical data, set it to 0 if you do not need to force a request (default), set it to 1 if you need to. Type INTEGER.
Under certain circumstances, depending on how the trend viewer is configured and used, the application designer may wish to force such an historical request.
For example, if a trend viewer is designed to remain open for a long time, traces will be drawn based on an historical request when opening the mimic, but after some time, most of the points displayed will come from real time values. If the user then changes the time period, typically spanning a short period of time in the recent past, there may be no point coming from the historical data to display. In such a case, you want to set this parameter to 1 to make sure the trend viewer will have points to display.

Execution

Mode

Mnemonic

Action

6

SETPERIOD

Change the X axis period for the Trend Viewer.

22

SETTIMECAPACITY

Change the period of the Trend Viewer internal buffer.

 

 

Return: 1 if successful, else 0.

Syntax 6

DblVal = TREND(Mode, Window, Branch, Identity);

Return type: DOUBLE.

Execution

Mode

Mnemonic

Action

7

GETPERIOD

Return the period of the X axis expressed in milliseconds.

Return DBL_MIN if unsuccessful.

Syntax 7

IntVal = TREND(Mode, Window, Branch, Identity, StartTime, EndTime]);

Return type: INTEGER.

Argument

Meaning

StartTime

The earliest date and time, expressed as the number of milliseconds since 1980. See the instruction DateTimeValue. Type DOUBLE.

EndTime

The latest date and time, expressed as the number of milliseconds since 1980. See the instruction DateTimeValue. Type DOUBLE.

Execution

Mode

Mnemonic

Action

8

SETDATETIME

Modify the start and end time of the Trend Viewer. If End Time is omitted, only the start time is changed and the period will remain the same.

Return: 1 if successful, else 0.

Syntax 8

IntVal = TREND(Mode, Window, Branch, Identity, StartTime, Duration);

Return type: INTEGER.

Argument

Meaning

StartTime

The earliest date and time, expressed as the number of milliseconds since 1980. See the instruction DateTimeValue. Type DOUBLE.

Duration

A time period expressed in milliseconds. Type DOUBLE.

Execution

Mode

Mnemonic

Action

9

SETDATETIMEPERIOD

Modify the start time and period for the Trend Viewer.

Result: 1 if successful, else 0.

Syntax 9

IntVal = TREND(Mode, Window, Branch, Identity, PScroll);

Return type: INTEGER.

Argument

Meaning

Pscroll

The percentage by which the trend X axis will be scrolled. Type INTEGER, range -100 to +100.

Execution

Mode

Mnemonic

Action

10

SCROLLPERCENT

The X axis of the trend is scrolled by a percentage of its current period.

A negative value will cause the trend to scroll back in time, a positive value forward.

A percentage of 0 fit the trend on current time.

Return: 1 if successful, else 0.

Syntax 10

IntVal = TREND(Mode, Window, Branch, Identity, TScroll);

Return type: INTEGER.

Argument

Meaning

Tscroll

The time period by which the trend X axis will be scrolled expressed in milliseconds. Type DOUBLE.

Execution

Mode

Mnemonic

Action

11

SCROLLTIME

The X axis of the trend is scrolled by the supplied period. A negative value will cause the trend to scroll back in time, a positive value forward.

Return: 1 if successful, else 0.

Syntax 11

DblVal = TREND(Mode, Window, Branch, Identity, Trace, Function);

Return type: DOUBLE.

Argument

Meaning

Function

A flag indicating which operation to perform. Type INTEGER, range 1 to 3.

Execution

Mode

Mnemonic

Action

12

GETDATETIME

Return the time for the trend expressed as milliseconds since 1980, according to Function:

1 Start time

2 End time

3 Cursor time

Return: DBL_MIN if unsuccessful.

Syntax 12

IntVal = TREND(Mode, Window, Branch, Identity, ClearFlag, Trace, VarName[, Label[ Type]]);

Return type: INTEGER.

Argument

Meaning

ClearFlag

A flag indicating how to treat the current trace. Type INTEGER, range 0 or 1.

VarName

The name of the variable to display. Type STR.

Label

The label that is displayed on the trend left border. Type STR.

Type

A flag indicating the Mode of operation of the trace. Type INTEGER, range 0 to 2.

Execution

Mode

Mnemonic

Action

14

 

SETVAR

Change the name of the variable for the specified trace, according to ClearFlag:

0 The current trace is preserved

1 The trace is erased

The mode of operation is set by the Type argument:

0 leaves it unchanged

1 forces a real-time trace

2 forces a historic trace

 

Return: 1 if successful, else 0.

Syntax 13

StrVal = TREND(Mode, Window, Branch, Identity, Trace);

Return type: STR.

Execution

Mode

Mnemonic

Action

15

GETVAR

Return the name of the variable for the trace.

Return: An empty string if unsuccessful.

Syntax 14

IntVal = TREND(Mode, Window, Branch, Identity, Trace, Varname[, Label [ Type]]);

Return type: INTEGER.

Argument

Meaning

VarName

The name of the variable to display. Type STR.

Label

The label that is displayed on the trend left border. Type STR.

Type

A flag indicating the Mode of operation of the trace. Type INTEGER, range 0 to 2.

Execution

Mode

Mnemonic

Action

16

ADDVARLIST

Prepare a modification of the list of traces for a trend viewer. Successive calls to AddVarList allow creating the list of traces to be modified and a call to SetVarList applies the change.

The change only takes place when followed by a mode 17 instruction.

A number of mode 16 instructions are usually followed by a mode 17 instruction to enable a number of traces on the same Trend display to be changed simultaneously.

The mode of operation is set by the Type argument:

0 leaves it unchanged

1 forces a real-time trace

2 forces a historic trace

 

Return: 1 if successful, else 0.

Syntax 15

IntVal = TREND(Mode, Window, Branch, Identity, ClearFlag)

Return type: INTEGER.

Execution

Mode

Mnemonic

Action

17

SETVARLIST

Used with Mode ADDVARLIST to change the variable for a number of traces on the same Trend Viewer simultaneously. The current traces are preserved or erased according to ClearFlag:

0 Preserve

1 Erase

1 if successful, else 0.

Syntax 16

IntVal = TREND(Mode, Window, Branch, Identity, ClearFlag, Handle)

Return type: INTEGER.

Argument

Meaning

Handle

The location of a memory buffer as created by the instruction FILETOBUF. Type LONG.

ClearFlag

See below.

Execution

Mode

Mnemonic

Action

18

SETVARBUF

Used with a memory buffer to simultaneously change a number of traces on the same Trend Viewer, according to ClearFlag:

0 The current traces are preserved

1 The traces are erased

 

 

The syntax for each line of the memory buffer must be as follows:

Trace, VarName, Label, Type

 

 

Return: 1 if successful, else 0.

Syntax 17

IntVal = TREND(Mode, Window, Branch, Identity[, Trace]);

Return type: INTEGER.

Execution

Mode

Mnemonic

Action

19

RESETVAR

The specified trace is reset to its original configuration.

If the trace is not specified, then all traces will be reset.

20

CLEARVAR

The specified trace is erased.

If the trace is not specified, then all traces will be erased.

 

 

Return: 1 if successful, else 0.

Syntax 18

IntVal = TREND(Mode, Window, Branch, Identity, NewIdentity);

Return type: INTEGER.

Argument

Meaning

NewIdentity

A new identity for the Trend Viewer animation. Type STR.

Execution

Mode

Mnemonic

Action

21

CHANGEID

Changes the identity of the trend.

Return: 1 if successful, else 0.

Syntax 19

IntVal = TREND(Mode, Window, Branch, Identity, Trace, Red, Green, Blue);

Return type: INTEGER.

Argument

Meaning

Red

The red component of the color. Type INTEGER, range 0 to 255.

Green

The green component of the color. Type INTEGER, range 0 to 255.

Blue

The blue component of the color. Type INTEGER, range 0 to 255.

Execution

Mode

Mnemonic

Action

23

SETCOLOR

Change the color of the selected trace according to the supplied RGB components.

Also change the color for the invalidity and the scale.

Return: 1 if successful, else 0.

Syntax 20

IntVal = TREND(Mode, Window, Branch, Identity);

Return type: INTEGER.

Execution

Mode

Mnemonic

Action

25

HARDCOPY

Make a (proportional) hard copy of the Trend Viewer window.

32

REFRESH

Re-requests historical data and refreshes the display.

42 EXPORT Initiate a Trend export. Has the same effect as using the Export button of a Trend Viewer.

 

 

Return: 1 if successful, else 0.

The effect of HARDCOPY is similar to that of the Print button on the trend toolbar.

Syntax 21

IntVal = TREND(Mode, Window, Branch, Identity, Trace, dbY);

Return type: INTEGER.

Argument

Meaning

dbY

The minimum or maximum value of the scale for a trace.

Execution

Mode

Mnemonic

Action

27

SETYMIN

Sets the minimum value for the scale of a trace.

28

SETYMAX

Sets the maximum value for the scale of a trace.

 

 

Return: 1 if successful, else 0.

If both Min and Max are 0, the variable's Min and Max values are used instead.

Syntax 22

IntVal = TREND(Mode, Window, Branch, Identity, Trace);

Return type: INTEGER.

Execution

Mode

Mnemonic

Action

26

GETSTYLE

Gives the type of trace.

Return:

0 A square wave.

1 A triangularwave.

2 A series of dots.

29

GETCOLORRED

Return:

0 to 255 The red component of the trace's color.

30

GETCOLORGREEN

Return:

0 to 255 The green component of the trace's color.

31

GETCOLORBLUE

Return:

0 to 255 The blue component of the trace's color.

   

Return:

-1 if unsuccessful (the trace is not used or the instruction is not supported in this context).

Syntax 23

IntVal = TREND(Mode, Window, Branch, Identity, Trace, ThresholdMode[, ThresholdValue1, DisplayThreshold1[, ThresholdValue2, DisplayThreshold2[, ThresholdValue3, DisplayThreshold3[, ThresholdValue4, DisplayThreshold4]]]]);

Return type: INTEGER.

Argument

Meaning

ThresholdMode The new threshold mode. Type INTEGER, range -1 to 5. See table below.
ThresholdValueN The new value for threshold N. Any numeric type.
DisplayThresholdN

Display mode for threshold N. Type INTEGER.
0 - New threshold not displayed.
1 - New threshold displayed.
2 - No change.

Execution

Mode

Mnemonic

Action

33 THRESHOLD_SETMODE

Change the configuration of the threshold display for the selected trace.

Return: 1 if successful, else 0.

Threshold mode

Mode Threshold system
-1 None
0 From variable configuration
1 ppphigh/pphigh/hihi/high
2 pphigh/hihi/high/low
3 hihi/high/low/lolo
4 high/low/lolo/pplow
5 low/lolo/pplow/ppplow

Syntax 24

IntVal = Trend(Mode, Window, Branch, Identity, Trace, ThresholdNumber, Red, Green, Blue[, PenStyle[, DrawThresholdLine]]);

Return type: INTEGER.

Argument

Meaning

ThresholdNumber A number identifying the threshold. Type INTEGER, range 0 to 3.
Red The red component of the threshold color. Type INTEGER, range -1 to 255.
Blue The blue component of the threshold color. Type INTEGER, range -1 to 255.
Green The green component of the threshold color. Type INTEGER, range -1 to 255.
PenStyle The style of the threshold line. Optional. See table below
DrawThresholdLine A flag indicating if the threshold line is to be drawn. Optional. Type INTEGER. 0 hides the line (default value if parameter is omitted), 1 draws the line.

Execution

Mode

Mnemonic

Action

35 THRESHOLD_SETPROP

Change the properties of the selected threshold. The color is that of the trace when the threshold is passed. If -1 is used for each of the color components the color does not change.

Return: 1 if successful, else 0.

Pen style

Value Style
0 Solid _______ - Default value if parameter is omitted.
1 Dash -------
2 Dot .......
3 Dash Dot _._._._
4 Dash Dot Dot _.._.._

Syntax 25

IntVal = Trend(Mode, Window, Branch, Identity, Trace, ThresholdNumber, ThresholdValue);

Return type: INTEGER.

Argument

Meaning

ThresholdNumber A number identifying the threshold. Type INTEGER, range 0 to 3.
ThresholdValue The new value for the selected threshold. Any numeric type.

Execution

Mode

Mnemonic

Action

36 THRESHOLD_SETVALUE

Change the value of the selected threshold.

Return: 1 if successful, else

0 if unsuccessful (Identity could not be found or the instruction is not supported in this context).

-1 The trace is not used.

-2 The value ThresholdNumber out of range.

-3 No threshold system configured.

-4 The value ThresholdValue does not match the configured threshold system (hihi<hi for example).

Syntax 26

IntVal = Trend(Mode, Window, Branch, Identity, Trace, ThresholdNumber[, DrawThresholdLine]);

Return type: INTEGER.

Argument

Meaning

ThresholdNumber A number identifying the threshold. Type INTEGER, range -1 to 3.
A value of -1 means all thresholds.
DrawThresholdLine A flag indicating if the threshold line is to be drawn. Optional. Type INTEGER. 0 hides the line, 1 draws the line (default value if parameter is omitted).

Execution

Mode

Mnemonic

Action

37 THRESHOLD_DRAWLINE

Draw or hide the selected thresholds.

Return: 1 if successful, else

0 if unsuccessful (Identity could not be found or the instruction is not supported in this context).

-1 The trace is not used.

-2 The value ThresholdNumber out of range.

-3 No threshold system configured.

Syntax 27

IntVal = Trend(Mode, Window, Branch, Identity, Trace, Red, Green, Blue[, PenStyle]);

Return type: INTEGER.

Argument

Meaning

Red The red component of the trace color. Type INTEGER, range -1 to 255.
Blue The blue component of the trace color. Type INTEGER, range -1 to 255.
Green The green component of the trace color. Type INTEGER, range -1 to 255.
PenStyle

The style of the threshold line. Optional. See table in Syntax 24.

Execution

Mode

Mnemonic

Action

38 DRAW_MINLINE Display the variable's minimum value as a line. The color is that of the trace when the line is crossed. If -1 is used for each of the color components the color does not change.
39 DRAW_MAXLINE Display the variable's maximum value as a line. The color is that of the trace when the line is crossed. If -1 is used for each of the color components the color does not change.
    Return: 1 if successful, else 0.

Syntax 28

IntVal = Trend (MODE, Window, Branch, Identity, Trace, TimeOrigin);

Return type: INTEGER.

Argument

Meaning

TimeOrigin The time of the trace origin (left side of the trace). Type DOUBLE as produced by DATETIMEVALUE.

Execution

Mode

Mnemonic

Action

41 SETTIMEORIGIN

Set the origin (left side) of the trace to a specific time.

Return: 1 if successful, else 0.

Syntax 29

IntVal = Trend (MODE, Window, Branch, Identity, Trace, Time, TimeUnit);

Return type: INTEGER.

Argument

Meaning

Time A period as a number of TimeUnit units. Type INTEGER.
TimeUnit A number representing the time unit to use. See table below. Type INTEGER.

Execution

Mode

Mnemonic

Action

42 SETTIMEOFFSET

Offset the origin (left side) of the trace using the given values.

Return: 1 if successful, else 0.

Time unit

Value Unit
0 Cancel the offset.
1 Seconds
2 Minutes
3 Hours
4 Days

Syntax 30

IntVal = Trend (MODE, Window, Branch, Identity, Trace, MinMax [, Showline]);

Return type: INTEGER.

Argument

Meaning

MinMax

Parameter indicating which line to affect. Type INTEGER.

-1 = Both lines
0 = Maximum line

1 = Minimum line

Showline A flag to select hide or display the lines. Optional. Type INTEGER.
0 = Hide
1 = Show - Default value if parameter is omitted.

Execution

Mode

Mnemonic

Action

40 DISPLAY_MINMAXLINE

Show/hide the variable minimum or maximum horizontal lines.

Return: 1 if successful, else 0.

Syntax 31

IntVal = TREND(Mode, Window, Branch, Identity, Trace, Flag);

Return type: INTEGER.

Argument

Meaning

Flag

A flag indicating which operation to perform. Type INTEGER.

0 = Hide

1 = Show

Execution

Mode

Mnemonic

Action

44

SET_VISIBLE

Hide or show a trace according to the value of Flag.

45 DISPLAY_SCALE

Hide or show the trace scale according to the value of Flag.

    Return: 1 if successful, else 0.

Syntax 32

DblVal = Trend(Mode, Window, Branch, Identity, Trace, ThresholdNumber);

Return type: DOUBLE.

Argument

Meaning

ThresholdNumber A number identifying the threshold. Type INTEGER, range 0 to 3.

Execution

Mode

Mnemonic

Action

47 THRESHOLD_GETVALUE

Return: The value of the threshold ThresholdNumber if successful.

48 THRESHOLD_ISCHECKED

Return: 1 if the threshold ThresholdNumber is used, 0 if it is not used.

49 THRESHOLD_ISDRAWLINE

Return: 1 if the threshold ThresholdNumber is used and the corresponding horizontal line is drawn, 0 if the corresponding line is not drawn.

50 THRESHOLD_GETCOLOR

Return: The color of the trace when the threshold ThresholdNumber is passed. The color is encoded as the RGB value.

51 THRESHOLD_GETSTYLE

Return: The style of the trace when the threshold ThresholdNumber is passed.

See table in Syntax 24.

   

Return:

0 if unsuccessful (Identity could not be found or the instruction is not supported in this context).

-1 The trace is not used.

-2 The value ThresholdNumber out of range.

-3 No threshold system configured.

Syntax 33

IntVal = Trend(Mode, Window, Branch, Identity, Show);

Return type: INTEGER.

Argument

Meaning

Show

A flag indicating which operation to perform. Type INTEGER.

0 = Hide

1 = Show

Execution

Mode

Mnemonic

Action

52 SHOW_LEGEND

Hide or show the legend according to the value of Flag.

Return: 1 if successful, -1 if Show out of range, else 0.

Syntax 34

IntVal = TREND( Mode, Window, Branch, Identity[, Filename]);

Return type: INTEGER.

Argument

Meaning

Filename Either the the absolute name of a file, or a file name relative to the project's TP folder. Type STR.

Execution

Mode

Mnemonic

Action

54

GETCONFIG

Get the configuration of a trend viewer in an Xml format and load it to a namespace or generate an Xml file if Filename is provided.

The namespace created in memory is: Branch.Window.Identity

 

 

Return: 1 if successful, else 0.

Syntax 35

IntVal = TREND( Mode, Window, Branch, Identity, Handle);

Return type: INTEGER.

Argument

Meaning

Handle The handle of the buffer containing an Xml configuration for the trend viewer. Type LONG.

Execution

Mode

Mnemonic

Action

55

SETCONFIG

Set the configuration of a trend viewer using the Xml configuration stored in the buffer Handle.

 

 

Return: 1 if successful, else 0.

Syntax 36

IntVal = TREND( Mode,Window, Branch,Identity,Filename[, Program[, ProgramBranch [, Function[, Argument]]]] );

Return type: INTEGER.

Argument

Meaning

Filename Either the absolute name of a file, or a file name relative to the project's TP folder. Type STR.
If Filename is undefined, no Xml file is generated, although the callback function can still be executed.
Program Program name for the callback function.
ProgramBranch Program branch for the callback function.
Function Name of the callback function.
Argument Arguments of the callback function.
 

If no callback function is defined the optional callback function will default to:

  • The caller’s program (same program where the GETCONFIG_ASYNC mode is called)

  • The callback function’s name by default is predefined as onTrend_GetConfig

If no callback function is defined by, make sure that the function onTrend_GetConfig is defined even if it’s empty. Otherwise the function can still succeed, but there will be an error message.

Execution

Mode

Mnemonic

Action

56

GETCONFIG_ASYNC

Used to make an asynchronous call (typically from a WebVue client) to retrieve the current configuration of a trend viewer in Xml format, and generate an Xml file if the Filename parameter is passed.
GETCONFIG_ASYNC in WebVue corresponds to the mode GETCONFIG in the PcVue desktop client. This asynchronous mode is used for the WebVue client with an optional callback function.

 

 

Return: 1 if successful. Note that, as the function is asynchronous, 1 will be returned even if there are any issues with the callback function (such as wrong callback function name).

0 is returned if any of the arguments are incorrect or if the function fails.

Syntax 37

IntVal = TREND( Mode, Window, Branch, Identity, Save );

Return type: INTEGER.

Argument

Meaning

Save

A flag to activate (1) or deactivate (0) the option.

Execution

Mode

Mnemonic

Action

57

SETSAVERUNTIMEPROPS

Activate or deactivate the ability to save a trend viewer's run-time properties.

 

 

Return: 1 if successful, else 0.

Example

For an example, select the Example link above.