Function BlockFileClosePLCopen motion icon

Description

This function block closes an open file.

Figure 7-202: The FileCopy Function Block

Related Functions

FileEOF, FileOpenA, FileOpenR, FileOpenW, FileReadLine, FileReadBinData, FileSeek, FileWriteBinData, FileWriteLine

See also: File Management

Arguments

Input

Execute Description On the rising edgeClosed A rising edge is the transition of a digital signal from low to high. It is also called positive edge request to perform closing a file.
  Data Type BOOL
  Range 0, 1
  Unit N/A
  Default
ID Description ID of the open file.
  Data Type UDINT
  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

(* FileClose example *)
CASE StepCounter OF
0:
  Inst_FileClose(TRUE, MyOutputFileID);
  StepCounter := StepCounter + 1;
1:
  Inst_FileClose(TRUE, MyOutputFileID);
  IF Inst_FileClose.Done THEN
     Inst_FileClose(FALSE, 0);
     StepCounter := StepCounter + 1;
  END_IF;
END_CASE;