Function BlockFileEOFPLCopen motion icon

Description

This function block tests if the end of a file has been encountered.

Figure 7-205: The FileCopy Function Block

Related Functions

FileClose, 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 test if the end of the file is reached in a file that is open for reading.
  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
EOF Description TRUE if the end of the file has been encountered.
  Data Type BOOL

Example

Structured Text

(* FileEOF example *)
CASE StepCounter OF
0:
  Inst_FileEOF(TRUE, MyInputFileID);
  StepCounter := StepCounter + 1;
1:
  Inst_FileEOF(TRUE, MyInputFileID);
  IF Inst_FileEOF.Done THEN
     EofReached := Inst_FileEOF.EOF;
     Inst_FileEOF(FALSE, 0);
     StepCounter := StepCounter + 1;
  END_IF;
END_CASE;