FileCopy

PLCopen motion icon

 Function Block - Copies a file's contents to a new file.

  • Large files take a noticeable amount of time to complete.
    • Example: A 1000KB file takes approximately 0.6 seconds.

Inputs

Input

Data Type

See Data Types.

Range

Unit

Default

Description

Execute

BOOL

FALSE, TRUE

N/A

No default

On the rising edge, request to perform copying a file.

Src

STRING

No range

N/A

No default

The path to the source file.

Dst

STRING

No range

User units

No default

The destination path to the source file.

Outputs

Output

Data Type

See Data Types.

Range

Unit

Description

Done

BOOL

FALSE, TRUE

N/A

If TRUE, the command completed successfully.

Error

BOOL

FALSE, TRUE

N/A

If TRUE, an error has occurred.

ErrorID

DINT

Enumerated

N/A

FBD Language Example

Not available.

FFLD Language Example

Not available.

IL Language Example

Not available.

ST Language Example

(* FileCopy example *)
CASE StepCounter OF
0:
  Inst_FileCopy(TRUE, 'Source.txt', 'Dest.txt');
  StepCounter := StepCounter + 1;
1:
  Inst_FileCopy(TRUE, 'Source.txt', 'Dest.txt');
  IF Inst_FileCopy.Done THEN
     Inst_FileCopy(FALSE, '', '');
     StepCounter := StepCounter + 1;
  END_IF;
END_CASE;

See Also