FB_BA_PersistentFile

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
Inputs
Name | Type | Description |
|---|---|---|
bRead | BOOL | Flag to start the read access. |
bWrite | BOOL | Flag to start the write operation. |
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. |
Inputs CONSTANT
Name | Type | Description |
|---|---|---|
sFileName | STRING | Name of the destination file (without the path or file extension). |
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. |