SVTREND
Retrieve the historic values of a group of variables between two given dates.
WebVue support - Yes.
The use of the verbs EXPORT, EXPORT_LOG and EXPORT_TREND is preferred to verbs SVLOG and SVTREND. The latter are kept for compatibility only.
The variables must be configured for trend recording.
Mode | Mnemonic | Syntax |
1 | GETTREND | 1 |
2 | GETNEXTBUFFER | 2 |
Syntax 1
IntVal = SVTREND (Mode, ListVar, Branch, StartDate, EndDate, Period, [DisplayMode, Handle_Result, Parameters]);
Return type: INTEGER.
Argument |
Meaning |
ListVar | EITHER The handle of a buffer containing a list of variable names (separated by commas) involved in the extraction. Type LONG. OR A list of variable names (separated by commas) involved in the extraction. Type STR. |
Branch | The branch of the list of variables. Type STR. |
StartDate | The earliest date for extraction, in milliseconds since 1980. Type DOUBLE. |
EndDate | The latest date for extraction, in milliseconds since 1980. Type DOUBLE. |
Period | The sampling period in seconds. Type DOUBLE. |
DisplayMode |
The output format for the list of variables. DisplayMode= 1 - The data is extracted using the list of variables in the buffer
Handle_Listvar to the format
defined by Format. See the example for further details. |
Handle_Result | The handle of the buffer in which the result will be placed. Type LONG. |
Parameters |
EITHER See below for more information on how to format this argument. |
Execution
Mode | Mnemonic | Action |
1 | GETTREND |
Extract trend (Historic) data for the list of trended variables, between two dates. Return: 1 Parameters are correct. |
Format of the Parameters argument
The argument Parameters comprises the following items separated by a comma: Format, Filter, LogVar, NameVar
It passed either as a handle of a buffer, or directly as a string.
Item |
Meaning |
Format |
The format of the time and date. Type STR. #D for the day Any other characters are interpreted literally. |
Filter | The filter applied in the extraction. See the topic Native Filter Expressions. Type STR. |
LogVar | The name of a bit variable that will be set to 1 when the instruction is complete. Type STR. |
NameVar | The name of a register variable which value is the numeric Id of the variable currently being processed. Type STR. |
Syntax 2
IntVal = SVTREND (Mode, Handle_Result);
Return type: INTEGER.
Argument |
Meaning |
Handle_Result |
The handle of the buffer in which the data will be placed. Type LONG. |
Execution
Mode | Mnemonic | Action |
2 | GETNEXTBUFFER | Continues filling the buffer from the point previously
reached. This mode is synchronous, e.g. the buffer is available for the execution of the next instruction. Return: 0 No more data in the buffer. |
When SVTREND fills the buffer to its limit before all the data have been extracted, the mode GETNEXTBUFFER allows the process of extraction to be continued automatically.
Example
For an example, select the Example link above.