Function Description

The GET_FILE_INFO function enables information on the file to be obtained.

The OPEN_FILE function must be enabled before the GET_FILE_INFO block because the value of FileDescriptor comes from the output parameter of the OPEN_FILE or CREATE_FILE block.

The additional parameters EN and ENO can be configured.

FBD Representation

The representation in FBD of the GET_FILE_INFO function is as follows:

Ladder Representation

The representation in Ladder of the GET_FILE_INFO function is as follows:

IL representation

Representation:

CAL GET_FILE_INFO_Instance (REQ:=GetFileInfoStart, FILEDESC:=GetFileInfoDescriptor, DONE=>GetFileInfoDone, ERROR=>GetFileInfoError, STATUS=>GetFileInfoStatus, ATTRIBUTES=>GetFileInfoAttributes, LENGTH=>GetFileInfoLength, ACCESSTIME=>GetFileInfoAccessTime, MODTIME=>GetFileInfoModifiedTime, CHANGESTATTIME=>GetFileInfoChangeStatusTime)

ST representation

Representation:

GET_FILE_INFO_Instance (REQ:=GetFileInfoStart, FILEDESC:=GetFileInfoDescriptor, DONE=>GetFileInfoDone, ERROR=>GetFileInfoError, STATUS=>GetFileInfoStatus, ATTRIBUTES=>GetFileInfoAttributes, LENGTH=>GetFileInfoLength, ACCESSTIME=>GetFileInfoAccessTime, MODTIME=>GetFileInfoModifiedTime, CHANGESTATETIME=>GetFileInfoChangeStatusTime);

Parameter Description

The following table describes the input parameter:

Parameter

Type

Comment

FILEDESC

DINT

This parameter specifies the file descriptor returned by the OPEN_FILE functions.

The following table describes the output parameters:

Parameter

Type

Comment

ATTRIBUTES

WORD

This bit field specifies the file attributes:

  • Bit 0: read-only file

  • Bit 1: hidden file

  • Bit 2: system file

  • Bit 3: volume label (not a file)

  • Bit 4: sub-directory

  • Bit 5: subject to archival

LENGTH

UDINT

This parameter specifies the size of the file in bytes.

ACCESSTIME

DATEANDTIME

This parameter specifies the date and time when the file was last accessed.

NOTE: This parameter is not updated for M580 PLCs.

MODTIME

DATEANDTIME

This parameter specifies the date and time when the file was last modified.

CHANGESTATETIME

DATEANDTIME

This parameter specifies the date and time when the last file status change took place.

Description of common parameters.