FILETRANSFER

Concept Link IconSee also

Control file transfer services for data acquisition drivers.

WebVue support - Yes.

Mode Mnemonic Syntax
1 DOWNLOAD 1
2 DOWNLOAD_FOLDER 2
3 DELETE 3

The verb FILETRANSFER is currently used to support file transfer services for IEC 61850 and DNP3 devices. See M61850 and MDNP3 for more information.

Arguments common to more than one mode

Argument

Meaning

ComObj The full name of the communication object, as configured in the Application Explorer, to which the file transfer applies. For example, Network01.Device01. Type STR.
SourceFile The name of a file in the field device corresponding to the communication object. Type STR.
DestinationFolder

The destination folder is the project's TP folder by default. This will be used if the DestinationFolder parameter is empty. Type STR.

You can also use a full path like "C:\\MyFiles" or a relative path like "..\\..\\MyFiles".

If executed in a WebVue session context this instruction is processed by the computer that hosts the web back end and the destination folder is on that computer.

CurrentPositionVar The name of a register variable that will be regularly updated with the number of bytes downloaded. Type STR.
MaxPositionVar The name of a register variable to represent the total file size. Type STR.
ResultVar

The name of a register variable in which a value, corresponding to the result of the instruction, is placed. See the table below for possible values and their meaning. Type STR.

The expected syntax for the argument SourceFile may vary depending on the field device model, for example, MyFile.txt or \MyFile.txt.
A way to verify the syntax expected by a given device model is to use the File transfer Helper available in the Application Explorer. When browsing files in an online device, the Helper displays file names as transmitted by the device, and therefore how one can expect the SourceFile argument to be passed.

Syntax 1

IntVal = FILETRANSFER(Mode, ComObj, SourceFile, DestinationFolder [, ResultVar[, CurrentPositionVar[, MaxPositionVar]]]);

Return type: INTEGER.

Execution

Mode

Mnemonic

Action

1

DOWNLOAD

Download the named file from the field device corresponding to the communication object.

Return: 0 if successful. A negative value is a parameter error, the value indicating which parameter is incorrect. For example, -3 means that parameter 3 is incorrect.

Syntax 2

IntVal = FILETRANSFER(Mode, Sub-mode, ComObj, SourceFolder, DestinationFolder[, ResultVar[, CurrentFileVar[, MaxFileVar[, CurrentPositionVar[, MaxPositionVar]]]]]);

Return type: INTEGER.

Argument

Meaning

Sub-mode

Sets the download behavior for the call. Type STR.

Possible values:

  • DOWNLOAD - Download all files from the folder SourceFolder and store them in the DestinationFolder. Any file already present in the DestinationFolder is overwritten.

  • UPDATE - Download from the folder SourceFolder any file not yet in the DestinationFolder.

  • SYNC - Download from the folder SourceFolder any file already present in DestinationFolder but updated in the IED since the download.

  • MIRROR - Download from the folder SourceFolder any file already present in DestinationFolder but updated in the IED since the download (same as SYNC), and delete from the DestinationFolder any file no longer available in the SourceFolder (.bak files are not deleted).

SourceFolder The name of a folder in the field device corresponding to the communication object. Type STR.

Execution

Mode

Mnemonic

Action

2

DOWNLOAD_FOLDER

Download all files from the specified folder of the field device corresponding to the communication object.

Return: 0 if successful. A negative value is a parameter error, the value indicating which parameter is incorrect. For example, -3 means that parameter 3 is incorrect.

Syntax 3

IntVal = FILETRANSFER(Mode, ComObj, SourceFile [, ResultVar]);

Return type: INTEGER.

Execution

Mode

Mnemonic

Action

3

DELETE

Delete the specified file from the field device corresponding to the communication object.

Return: 0 if successful. A negative value is a parameter error, the value indicating which parameter is incorrect. For example, -3 means that parameter 3 is incorrect.

The FILETRANSFER instruction operates asynchronously. That is once a request has been generated, the script continues without waiting for the request to be completed. The ResultVar can be used to monitor the status of the request.

Status variable values

The ResultVar variable can take the following values.

Value Description
0 Operation completed successfully
-1 Operation failed, unknown error
-2 Operation failed, internal Error
-3 No communication object
-4 Communication object not connected
-5 Operation failed, request not supported
-6 Operation failed, access denied
-7 Download could not be initialized
-8 Download failed
-9 Upload could not be initialized
-10 Upload failed
-11 Delete file failed
-12 Browsing failed
-13 Message routing failed
-14 No remote server
-15 No transaction
-16 No server
-17 Connection already close
-18 Protocol error, flow control activated
-19 Protocol error, max services reached
-20 Protocol error, no data read
-21 Protocol error, memory
-22 Protocol error, encoding error
-23 Protocol error, incorrect transaction
-24 Protocol error, connection closed
-25 Protocol error, time out
-26 Protocol error, connection state
-27 Protocol error, application
-28 Protocol error, parameters
-29 Protocol error, confirmed error
-30 Protocol error, reject
-31 Ambiguous file name
-32 Download failed, file is busy
-33 Download failed, file name syntax error
-34 Download failed, content type invalid
-35 Download failed, position invalid
-36 Download failed, access to the file denied
-37 Download failed, file not found. Occurs if you try to download a file the does not exist in the server
-38 Upload failed, duplicate file name in the file system
-39 Upload failed, insufficient space on the file system
-40 Device not started
-41 Device in error state
-42 Cannot access destination file
-43 Definition
-44 Browsing error, no file or no folder
-45 Moving file from the temporary directory to the final directory failed, access denied
-46 Moving file from the temporary directory to the final directory failed, file not found
-47 Moving file from the temporary directory to the final directory failed, invalid name
-48 Moving file from the temporary directory to the final directory failed, file already exists and cannot be overridden