SELECTOR mode HISTORICAL

Concept Link IconSee also Concept Link IconExampleConcept Link IconFurther information

Select the data that appears in a grid control animation. This topic is only for the mode HISTORICAL. For all other modes, see the main SELECTOR topic.

WebVue support - No. Returns 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.

Sub-mode Mnemonic

Syntax

GETCOUNT 1
INSERTTREND 2
REMOVETREND 3
CLEARTRENDS 1
SETTREND 4
GETTRENDBYINDEX 5
GETINDEX 6
RESTOREDEFAULT 1
CANCEL 1
REQUEST 7
EXPORT 1

Arguments common to all modes

Argument

Meaning

Window

The name of the window that contains the grid control 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 grid control within the specified window. Type STR.

Syntax 1

IntVal = SELECTOR("HISTORICAL", Sub-mode, Window, Branch, Identity);

Return type: INTEGER.

Execution

Sub-mode

Action

GETCOUNT

Return the number of trended variables in the list.

CLEARTRENDS

Remove all trended variables in the list.
Return the number of trended variables removed.

RESTOREDEFAULT

Reload the list of trended variables and thresholds as originally configured in the grid control.
Return the quantity of restored trend variables.

CANCEL

Cancel the current historical request.
Return 1 if successful.

EXPORT

Starts the Export Wizard from the specified grid control.
Return 1 if successful, -1 if Grid Control not in historical mode.

  All modes return 0 if unsuccessful (incorrect parameter or executed in WebVue context).

Syntax 2

IntVal = SELECTOR("HISTORICAL", Sub-mode, Window, Branch, Identity, VarName [, Index]);

Return type: INTEGER.

Argument

Meaning

VarName

The name of a variable. Type STR.

Index

The index in the list. 1 = start of the list. Type INTEGER.

Execution

Sub-mode

Action

INSERTTREND

Insert a new trended variable to the list of variables at the Index position. If the Index parameter is omitted the variable is inserted at the start of the list.
Return the position of the variable in the list or 0 if unsuccessful (incorrect parameter or executed in WebVue context).

Syntax 3

IntVal = SELECTOR("HISTORICAL", Sub-mode, Window, Branch, Identity[, Index]);

Return type: INTEGER.

Argument

Meaning

Index

The index in the list. 1 = start of the list. Type INTEGER.

Execution

Sub-mode

Action

REMOVETREND

Remove the trended variable, at the Index position, from the list of variables. If the Index parameter is omitted the variable at the end of the list is removed.
Return the position of the variable in the list or 0 if unsuccessful (incorrect parameter or executed in WebVue context).

Syntax 4

IntVal = SELECTOR("HISTORICAL", Sub-mode, Window, Branch, Identity, Index, VarName[, Thresholds]);

Return type: INTEGER.

Argument

Meaning

VarName

The name of a variable. Type STR.

Index

The index in the list. 1 = start of the list. Type INTEGER.

Thresholds

A flag. Type INTEGER.

0 - Remove the threshold system (default)

1 - Keep the threshold system

Execution

Sub-mode

Action

SETTREND

Change the trended variable at the Index position and keep or remove the threshold system according to Threshold.
Return: 1 if successful or 0 if unsuccessful (incorrect parameter or executed in WebVue context).

Syntax 5

StrVal = SELECTOR("HISTORICAL", Sub-mode, Window, Branch, Identity, Index);

Return type: STR.

Argument

Meaning

Index

The index in the list. 1 = start of the list. Type INTEGER.

Execution

Sub-mode

Action

GETTRENDBYINDEX

Return the name of the trended variable at position of the Index parameter.
Return: The name of the variable if successful, else an empty string (incorrect parameter or executed in WebVue context).

Syntax 6

IntVal = SELECTOR("HISTORICAL", Sub-mode, Window, Branch, Identity, VarName);

Return type: INTEGER.

Argument

Meaning

VarName

The name of a variable. Type STR.

Execution

Sub-mode

Action

GETINDEX

Return the index of the trended variable VarName.
Return: The index of the variable name of the variable if successful, else an empty string (incorrect parameter or executed in WebVue context).

Syntax 7

IntVal = SELECTOR("HISTORICAL", Sub-mode, Window, Branch, Identity, StatusVariable [,StartTime, EndTime[, SamplingRateInterval[, SamplingRateValue[, SynchroSecondValue, SynchroMinuteValue, SynchroHourValue, SynchroDayValue]]]]));

Return type: INTEGER.

Argument

Meaning

StatusVariable

The name of a register variable. Set to 1 while the request is running, else 0. Type STR.

StartTime

Equivalent to the value provided by the Start time variable in the Grid Control configuration dialog, Historical Period tab. Type DOUBLE.

EndTime

Equivalent to the value provided by the End time variable in the grid control configuration, Historical Period tab. Type DOUBLE.

SamplingRateInterval

Equivalent to the sampling rate units in the Grid Control configuration dialog, Historical Sampling tab. Type INTEGER.

0 = milliseconds
1 = seconds
2 = minutes
3 = hours
4 = days
5 = weeks
6 = months

SamplingRateValue

Equivalent to the Sampling Rate property in the Grid Control configuration dialog, Historical Sampling tab. Type INTEGER.

SynchroSecondValue

Equivalent to the Second property in the Grid Control configuration dialog, Historical Sampling tab. Type INTEGER.

SynchroMinuteValue

Equivalent to the Minute property in the Grid Control configuration dialog, Historical Sampling tab. Type INTEGER.

SynchroHourValue

Equivalent to the Hour property in the Grid Control configuration dialog, Historical Sampling tab. Type INTEGER.

SynchroDayValue

Equivalent to the Day property in the Grid Control configuration dialog, Historical Sampling tab. Type INTEGER.

Execution

Sub-mode

Action

REQUEST

Generate a new historical request for the grid using the supplied parameters. See the grid control help for a full explanation of the operation of the parameters.
Return: 1 if successful, -1 if Grid Control not in historical mode, else 0 (incorrect parameter or executed in WebVue context).

Example

For an example, select the Example link above.