FileDelete

PLCopen motion icon

 Function Block - Removes a file from the file system.

Inputs

Input

Data Type

Range

Unit

Default

Description

Execute

BOOL

0 to 1

N/A

No default

On the rising edge, request to perform deletion of a file.

Path

STRING

N/A

N/A

No default

The path to the file.

Outputs

Output

Data Type

Range

Unit

Description

Done

BOOL

 

 

If TRUE, the command completed successfully.

Error

BOOL

 

 

If TRUE, an error has occurred.

ErrorID

DINT

 

 

Indicates the error if Error output is TRUE.

See the table in File and TCP/IP Function Block ErrorIDs.

Remarks

Figure 1: FileDelete

FBD Language Example

Not available.

FFLD Language Example

Not available.

IL Language Example

Not available.

ST Language Example

(* FileDelete example *)
CASE StepCounter OF
0:
  Inst_FileDelete(TRUE, 'Test.txt');
  StepCounter := StepCounter + 1;
1:
  Inst_FileDelete(TRUE, 'Test.txt');
  IF Inst_FileDelete.Done THEN
     Inst_FileDelete(FALSE, '');
     StepCounter := StepCounter + 1;
  END_IF;
END_CASE;

See Also