FileEOF

PLCopen motion icon

 Function Block - Test if the end of the file is reached in a file that is open for reading.

Inputs

Input

Data Type

See Data Types.

Range

Unit

Default

Description

Execute

BOOL

FALSE, TRUE

N/A

No default

On the rising edge, test if the end of the file is reached.

ID

UDINT

No range

N/A

No default

The ID of the open 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

EOF

BOOL

FALSE, TRUE

N/A

TRUE if the end of the file has been encountered.

FBD Language Example

Not available.

FFLD Language Example

Not available.

IL Language Example

Not available.

ST Language Example

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

See Also