FB_BA_PersistentFile

FB_BA_PersistentFile 1:

FB_BA_PersistentFile provides a foundation for handling persistent data in standard formats.

Syntax

FUNCTION_BLOCK ABSTRACT FB_BA_PersistentFile
VAR_INPUT
  bRead          : BOOL;
  bWrite         : BOOL;
END_VAR
VAR_OUTPUT
  bBusy          : BOOL;
  bError         : BOOL;
  nErrId         : UDINT;
  nChunks        : UDINT
END_VAR
VAR_INPUT CONSTANT
  {region 'Settings'}
    sFileName    : STRING;
  {endregion}
END_VAR

FB_BA_PersistentFile 2: Inputs

Name

Type

Description

bRead

BOOL

Flag to start the read access.

bWrite

BOOL

Flag to start the write operation.

FB_BA_PersistentFile 3: Outputs

Name

Type

Description

bBusy

BOOL

The function block is currently processing the task.

bError

BOOL

An error occurred during processing.

nErrorId

UDINT

Error number

nChunks

UDINT

Number of chunks used in the current or most recent read or write operation.

FB_BA_PersistentFile 4: Inputs CONSTANT

Name

Type

Description

sFileName

STRING

Name of the destination file (without the path or file extension).

FB_BA_PersistentFile 5: Properties

Name

Type

Access

Definition location

Description

Reading

BOOL

Get/Set

Local

Indicates that a read access is in progress and sets the file open mode to Read.

Writing

BOOL

Get/Set

Local

Indicates that a write operation is in progress and sets the file access mode to write.