PLCnext on Instagram  PLCnext on YouTube Github PLCnext CommunityStore PLCnext Community

  1. jbals
  2. PLCnext Store
  3. Wednesday, 22 January 2020

I am currently developing a plcnext app and recognized that the persistent data folder of my app (required via "datastorage" - "persistentdata":true) is deleted as soon as the app is stopped via the WBM. Is this the desired behavior? I expected that the persistent data is removed when the app is uninstalled and not when the app is stopped.

Daniel PLCnext Store Team Accepted Answer Pending Moderation
0
Votes
Undo

Hello jbals,

> Is this the desired behavior?

(unfortunately) yes:

Specifications and restrictions

  • The creation of a persistent/temporary memory does not require a restart of the firmware
  • Stopping an app deletes its persistent/temporary memory

PLCnext Store Info Center

I will discuss with the developers what solution they suggest.

Phoenix Contact Electronics Headquarters - PLCnext Store Team

  1. 4 weeks ago
  2. PLCnext Store
  3. # 1
Daniel PLCnext Store Team Accepted Answer Pending Moderation
0
Votes
Undo

Hello jbals,

maybe there is a misunderstanding with the terms start/stop.
start/stop can be understood as install/uninstall.
Please read the following note:

App installation states

Phoenix Contact Electronics Headquarters - PLCnext Store Team

  1. 4 weeks ago
  2. PLCnext Store
  3. # 2
jbals Accepted Answer Pending Moderation
0
Votes
Undo

The WBM provides in the Administration - PLCnextApps section 4 buttons "Install App", "Start", "Stop", "Uninstall".

Now you are telling me that "Start" means "install" and "Stop" means "uninstall"....

What do I have to expect when I use the buttons "Install App" and "Uninstall" ?

And how Do I stop an app without deleting its data folder? And where is the difference between temporary and persistent data? Temporary data will be lost after a reboot and persistent data will remain?

  1. 4 weeks ago
  2. PLCnext Store
  3. # 3
Martin PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo

Hi jbals,

Since the WBM app management features are new in firmware version 2020.0, I was also unaware of the full implications of the app "Start"and "Stop" buttons, but I have now clarified this with Daniel.

This can be understood better with a description of the process that was used when an app could only be installed from the PLCnext Store:

Install procedure from the PLCnext Store

  1. User clicks on "Install" in the PLCnext Store. All the remaining steps are automatic.
  2. The .app file is downloaded to the directory /opt/plcnext/installed_apps. The app is now considered "Installed".
  3. The squashfs file system defined by the .app file is mounted. Other tasks defined in the app_info.json file are performed, including:
    • Creating permanent and temporary data directories for the app.
    • Creating an init.d script for daemon apps.
    • Creating a .acf.config file for function extension apps.
    • Registering any shared object libraries with the operating system.

After step 3 is complete, the app is considered "Started".

Uninstall procedure from the PLCnext Store

The process of uninstalling an app through the PLCnext Store is done in reverse:

  1. User clicks on "Uninstall" in the PLCnext Store. All the remaining steps are automatic.
  2. The squashfs file system defined by the .app file is unmounted. All files and data associated with the app are deleted. The app is now considered "Stopped".
  3. The .app file is deleted from the directory /opt/plcnext/installed_apps. The app is now considered "Uninstalled".

 

Now, here are some interesting additional facts:

- When you "Install" an app through WBM, it performs step 2 of the "Install" procedure above.

- When you "Start" an app through WBM, it performs step 3 of the "Install" procedure above.

- When you "Stop" an app through WBM, it performs step 2 in the "Uninstall" procedure above.

- When you "Uninstall" an app through WBM, it performs step 3 of the "Uninstall" procedure above.

So, you can see that the init.d script (for a daemon app), and the app's data directories, are all deleted and re-created every time you click "stop" and "start" in WBM.

=======================================

To answer your other questions:

- how to stop an app without deleting it's data directories? This cannot be done through the WBM page, and must be done by calling the init.d script yourself (for a daemon app).

- what is the difference between the permanent and temporary data directories? Data is deleted from the temporary directory when the plc reboots; data is not deleted from the permanent directory when the plc reboots.

 

~ Martin.

 

Phoenix Contact Electronics Headquarters - PLCnext Runtime Product Management and Support

  1. 4 weeks ago
  2. PLCnext Store
  3. # 4
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.