Function BlockFileSizePLCopen motion icon

Description

This function block renames a file.

Figure 7-213: The FileSize Function Block

Related Functions

FileCopy, FileDelete, FileRename, FileExists

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 read the size of a file
  Data Type BOOL
  Range 0, 1
  Unit N/A
  Default
Path Description The path to the file
  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
Size Description The size of the file in bytes
  Data Type DINT

Example

Structured Text

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