Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

FileCopy

  • Last UpdatedJul 18, 2023
  • 1 minute read

Copies a file. You can use the DOS wild card characters (*) and (?) to copy groups of files. In asynchronous mode, this function will return immediately and the copy will continue in the background. Copying files does not interfere with the operation of other Plant SCADA tasks, because this function is time-sliced.

If synchronous mode is selected, this function becomes a blocking function.

Syntax

FileCopy(sSource, sDest, nMode)

sSource:

The name of the source file to copy.

sDest:

The name of destination file to copy to. To copy a file to the printer, specify the name as "LPT1.DOS".

nMode:

The copy mode:

0 - Normal

1 - Copy only if the file time is different.

2 - Copy in asynchronous mode.

Multiple modes can be selected by adding them together (for example, set Mode to 3 to copy in asynchronous mode if the file time is different).

Return Value

0 (zero) if successful, otherwise an error is returned. However, if you copy in asynchronous mode, the return value does not reflect whether the copy operation was successful or not, because the function returns before the actual copy is complete.

FileDelete

Example

! Copy Report.Txt to Report.Bak.
FileCopy ("C:\Data\Report.Txt", "C:\Data\Report.Bak",0);
/* Copy AlarmLog.Txt to AlarmLog.Bak only if the file time is
different. Copy in the background. */
FileCopy ("AlarmLog.Txt", "AlarmLog.Bak",1+2);

See Also

File Functions

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in