File and data storage 

The files of an app container are unpacked into a read only filesystem mounted via SquashFS, so that the apps cannot save/store data/files in their installation directory at runtime.

 

The app description can be used to specify whether a persistent and/or temporary location is required. This will be created by the AppManager if the corresponding entry is present.

 

Persistent memory is created on a storage medium (e.g. internal or external SD card) and is available again after a restart of the device. It should be noted here that SD cards cannot be rewritten as often as required due to their design and can therefore age. An app may only write files to the medium in rare cases (under no circumstances in short cycles of only a few seconds). The automatic closing of files in case of power failure or reset of the controller is not supported by the system. The app must be able to recognize corrupt files and handle them accordingly.

The temporary memory is created as ramdisk and is emptied after each power failure or reset of the controller.

The following environment variables from section Directories and environment variables are required:

  • ARP_PATH_APPS_DATA_DIR : Root storage directory of the persistent data of all apps
  • ARP_PATH_APPS_TEMP_DIR: Root storage directory of the temporary data of all apps

If a persistent memory is required by the app, a folder is created under ARP_PATH_APPS_DATA_DIR. This folder contains the identifier of the app. An app can store its persistent data in the following folder: ARP _PATH_APPS_DATA_DIR/<identifier>

If a temporary memory is required by the app, a folder is created under ARP_PATH_APPS_TEMP_DIR. This folder contains the identifier of the app. An app can store its temporary data in the following folder: ARP _PATH_APPS_TEMP_DIR/<identifier>

Necessary additions in the app description file

If the optional JSON object "datastorage" is present in the app description file, the AppManager knows that configurations for the persistent/temporary folder (called "memory" here) are located in the app.

The created persistent/temporary folders of an app can be used by all app components.

The "datastorage" entry is structured as follows:

"datastorage": {
     "persistentdata": true,
     "temporarydata": true,
       "directoriesToCreate": {
            "temporary": [
                {
                    "path": "<folder name/path>"
                }, 
                {
                    "path": "/folder2"]
                }
             ],
            "persistent": [
                {
                    "path": "<folder name/path>"
                }, 
                {
                    "path": "/folder3"]
                }
             ],
        }
  }

"persistentdata":

Boolean value for whether persistent memory is required.

"temporarydata":

Boolean value for whether temporary memory is required.

"directoriesToCreate":

Optional field. Directories with the specified paths/names will be created within the App folder for persistent/temporary data:

  • temporary: Optional. Array with folder names/pathes to create. The entries are relative pathes within the App temporary data folder          
    ARP_PATH_APPS_TEMP_DIR/<identifier>/<folder name/path>
  • persistent: Optional. Array with folder names/pathes to create. The entries are relative pathes within the App persistent data folder          
    ARP_PATH_APPS_DATA_DIR/<identifier>/<folder name/path>

Specifications and restrictions

  • The creation of a persistent/temporary memory does not require a restart of the firmware.
  • The creation/deletion of persistent/temporary memory is done on app installation/uninstallation.
  • Uninstalling an app deletes its persistent/temporary memory.

Demo Data Storage App

The procedure for using and configuring a Data Storage App Part is explained in the following demo sections:

Support in the firmware

The Data Storage app part type is supported in the firmware from version 19.3.0.

Directories to create: the option "directoriesToCreate" is supported in the PLCnext Technology firmware from version 25.0.0.

 

 

 


•  Web browser recommendation: Chrome/Edge 88 or newer, Firefox ESR 90 or neweror Safari  • 
• Published/reviewed: 2024-11-21 • Revision 17 •