EXPORT

Concept Link IconSee also Concept Link IconExample

Run a previously configured (Application Explorer) export.

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 Data Export module is protected by a license option in PcVue's protection key. If you do not have this option then Data Export will only operate in demonstration mode.

Mode

Mnemonic

Syntax

1 GENERATE 1
2 GENERATE_DATES 2
3 GENERATE_PERIOD 3

Common Arguments

Argument

Meaning

ExportName The name of the export to run (as configured in the Application Explorer). Type STR.
ExportPageName The name of the page to be exported. If not specified all pages will be exported. Type STR.
OutputName The output destination for the export. If the output format is Csv then it is the name of the folder in which the output files are generated. If the output format is Excel it is the name of the workbook. If not specified the default output name configured in the Application Explorer will be used. The name of the file to which the result of the export will be sent. If not specified the default file name configured in the Application Explorer will be used. Type STR.
If executed in a WebVue session context this instruction is processed by the computer that hosts the web back end and the output is created on that computer.
ReferenceTime The timestamp used as a reference to calculate the start and end times. If not specified the actual time when the function is run will be used. Type DOUBLE (DateTimeValue format)
StatusVariable The name of a register variable in which the status of the export is reported. If not specified the status variable for the export, as configured in the Application Explorer, will be used. If specified the status variable for the export, as configured in the Application Explorer, is not used. Type STR.

Syntax 1

IntVal = EXPORT (Mode, ExportName, [ExportPageName], [OutputName], [ReferenceTime], [StatusVariable]);

Return type: INTEGER.

Execution

Mode

Mnemonic

Action

1 GENERATE

Generate the export.
Return: 1 if OK, else 0 or negative value (ExportName does not match configured export, ExportPage does not match configured page, invalid OutputName, cannot create output file, invalid timestamps or invalid export configuration).

Syntax 2

IntVal = EXPORT (Mode, ExportName, [ExportPageName], [OutputName], [StartTime], [EndTime], [StatusVariable]);

Return type: INTEGER.

Argument

Meaning

StartTime The timestamp to be used as the start time. Type DOUBLE (DateTimeValue format)
EndTime The timestamp to be used as the end time. Type DOUBLE (DateTimeValue format)

Execution

Mode

Mnemonic

Action

2 GENERATE_DATES

Generate the export using the given start and end timestamps.
Return: 1 if OK, else 0 or negative value (ExportName does not match configured export, ExportPage does not match configured page, invalid OutputName, cannot create output file, invalid timestamps or invalid configuration in export).

Syntax 3

IntVal = EXPORT (Mode, ExportName, [ExportPageName], [OutputName], [ReferenceTime], [PeriodType], [PeriodValue], [PeriodInterval], [StatusVariable]);

Return type: INTEGER.

Argument

Meaning

PeriodType The period type. Completed or current. Type INTEGER.
0 = Current
1 = Completed
-1 = Ignore the argument.
PeriodValue Period value. Type INTEGER.
1 to 65535.
-1 = Ignore the argument.
PeriodInterval Interval type. Year, month, day... Type INTEGER.
0 = Minutes
1 = Hours
2 = Days
3 = Weeks
4 = Months
5 = Years
-1 = Ignore the argument

Execution

Mode

Mnemonic

Action

3 GENERATE_PERIOD

Generate the export using the given start timestamp and the period.
Return: 1 if OK, else 0 or negative value. ExportName does not match configured export, ExportPage does not match configured page, invalid OutputName, cannot create output file, invalid timestamps or invalid configuration in export.