Function BlockFileDeletePLCopen motion icon

Description

This function block removes a file from the file system.

Figure 7-194: The FileDelete Function Block

Related Functions

FileCopy, FileRename, FileExists, FileSize

See also: File Management

Arguments

Input

Execute Description On the rising edgeClosedA rising edge is the transition of a digital signal from low to high. It is also called positive edge request to perform deletion of a file
  Data Type BOOL
  Range 0, 1
  Unit N/A
  Default
Path Description The path to the file to be deleted
  Data Type STRING
  Range N/A
  Unit N/A
  Default

Output

Done Description If TRUE, then the command completed successfully
  Data Type BOOL
Error Description If TRUE, an error has occurred
  Data Type BOOL
ErrorID Description Indicates the error if Error output is set to TRUE. See the table in Search IndexFile and TCP/IP Function Block ErrorID Output
  Data Type DINT

Example

Structured Text

(* 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;