FB_BA_PersistentBinaryFile

The FB_BA_PersistentBinaryFile provides built-in data handling for persistent data in a binary (byte) format. The operation is performed in multiple chunks.
File format
Individual data items (of varying lengths) can be handled in segments:

The file path ends with the extension *.psd or *.bin.
Workflow
Write
- Start the writing process
FB_BA_PersistentBinaryFile.bWrite := TRUE;The callback I_BA_PersistentBinaryFileProvider.WriteData() is called. - Writing data
Output the buffer address using pBuff.
Output the buffer size using nBuff. - Finish the write operation
The callback I_BA_PersistentBinaryFileProvider.WriteData() returns TRUE.

Read
- Start the reading process
FB_BA_PersistentBinaryFile.bRead := TRUE;
The callback I_BA_PersistentBinaryFileProvider.ReadingData() is called. - Read data
Data is provided via pBuff and nBuff. - Stop reading
The callback I_BA_PersistentBinaryFileProvider.ReadingData() returns TRUE.

Inherits from: FB_BA_PersistentFile
Syntax
FUNCTION_BLOCK FB_BA_PersistentBinaryFile EXTENDS FB_BA_PersistentFile
VAR_INPUT CONSTANT
{region 'Settings'}
iOwner : I_BA_PersistentBinaryFileProvider;
{endregion}
END_VAR
Inputs CONSTANT
Name | Type | Description |
|---|---|---|
iOwner | Interface to the source of the files to be read and written. |