PLCnext Control Solution
A PLCnext Control Solution contains commonly a complete PLCnext Engineer project configuration as an app part.
A PLCnext Control Solution is also called solution for short.
The user of a solution does not need any programming knowledge to use the app. A solution is transferred directly from the PLCnext Store or via Web-based Management (WBM) to a PLCnext Control.
A solution usually contains a web interface. This interface can be used to configure the solution with predefined parameters.
A solution is locked. The source code is not public by default and thus cannot be changed by the user.
Default mode
By default, the solution project is treated as read-only. It is integrated into the system when the app starts and removed when the app stops or during an update. In this mode, the app provides a complete PLCnext Engineer project as a read-only component.
Persistent mode
For some applications, it must be possible to edit the project configuration at runtime. In these cases, the solution can start with an empty project configuration that can be expanded by the user during operation. This configuration remains persistent even if the application is stopped or updated.
Necessary additions in the app description file
If the optional JSON object "engineerapp" is present in the app description file, the AppManger knows that a complete PLCnext Engineer project is inside the app.
The "engineerapp" entry is structured as follows:
"engineerapp": {
"folder": "<local path>/PCWE",
"useAppPersistentDir": <true/false>
}
"folder":
Specifies in which directory within the app container the complete PLCnext Engineer project is stored. This makes it possible to build up the folder structure as desired within the app container.
useAppPersistentDir:
Using a persistent data folder to store and load the PLCnext Engineer application project provided by the app. This entry is optional and has the value "false" by default.
- Default Mode (value is "false"):Default app projects folder within the apps home directory is used to copy/store the application project
- The solution project ist loaded directly from the PLCnext Engineer project provided by the app.
- The solution project is treated as read-only: it is integrated into the system on app start and removed on app stop or during an app update.
- No changes to the provided solution project are possible.
- Persistent Mode (value is "true"):
- Persistent data folder of the app is used to store and load the solution project.
- The app must activate persistent data storage (see File and data storage ).
- The solution project is loaded from the app’s persistent folder at app start and is editable at runtime by the app.
- If the app contains an initial PLCnext Engineer project folder in its mounted container, it will be copied to the persistent storage location of the app. If no project is provided (folder with the specified path does not exist in the app folder), an empty folder will be created instead, allowing users to start from scratch. The path within the persistent storage folder of the app matches the one specified in its app description file. The path to the solution project folder is defined as:
$ARP_PATH_APPS_DATA_DIR$/<app identifier>/<app path to engineer PCWE folder> - The solution project remains available after app stop or app update.
- The solution project folder is only deleted when the app is uninstalled.
Steps to create and integrate a solution
Create the solution:
- Watch the tutorials in the PLCnext Community for more information on how to create a PLCnext Engineer project.
- Make sure that the controller firmware version is greater than 2019.0
- Make sure that the version of your PLCnext Engineer is compatible with the firmware of your controller.
- Program your PLCnext Engineer project.
- If necessary, license your PLCnext Engineer project.
- Download your PLCnext Engineer project to your controller.
- Test your PLCnext Engineer project.
Integrate the solution to your app:
- The files you need are in the PLCnext project folder /opt/plcnext/projects/PCWE/ . You should copy the project folder into your app folder.
(e.g. with PuTTY cp -r /opt/plcnext/projects/PCWE/ <app folder>/<subfolder for this part>/PCWE) - Add the app part "engineerapp" ("Necessary additions in the app description file") in your app description file.
Integrating a PLCnext Engineer project with C++ Libraries
The software PLCnext Engineer (all versions until 2020.6) requires a manual acting when creating a solution from some PLCnext Engineer projects. This applies only to PLCnext Engineer projects that include User Libraries written in C++.
When a PLCnext Engineer project includes a library written in C++, the resulting project on the PLC includes a file named pcwe.plm.config. This file includes the path to the .so file containing the PLM component, but this path includes the hard-coded directory name "PCWE". This causes a problem when creating a solution from this project for the PLCnext Store, because the solution is not installed in the PCWE project directory, and so the .so file containing the PLM component cannot be found.
The file <path>/PCWE/Plc/Plm/pcwe.plm.config pcwe.plm.config from the PLCnext Engineer project directory must be edited (before creating the app container) to remove the hard-coded reference to the PCWE directory from the corresponding C++ library entries.
For example:
<Library name="<LibName>" binaryPath="$ARP_PATH_PROJECTS_DIR$/PCWE/Libs/<LibName>/lib<LibName>.so" />
to:
<Library name="<LibName>" binaryPath="$ARP_PATH_PROJECT_CURRENT_DIR$/Libs/<LibName>/lib<LibName>.so" />
Specifications and restrictions
- Only one solution may be active in the overall system.
- An EngineerApp part is activated/deactivated when you start/stop the app.
- Up to firmware version 2020.6: The activation/deactivation of an EngineerApp part requires a restart of the firmware.
- From firmware version 2020.6: The activation/deactivation of an EngineerApp part does not require a restart of the firmware and is done at runtime.
- Persistent mode:
- Is supported beginning with firmware version 2026.0 LTS.
- No migration between the two modes (default/persistent) is supported during updates.
- If the persistent solution project folder does already exist on app update, it will not be overwritten with the project provided by the new app version (otherwise the configuration is overwritten). You must implement the desired/needed integration steps via post update script defined in the update uonfiguration app part (see Update Configurations).
Demo EngineerApp
The demo app with an engineer part (solution) contains a simple solution for flashing an LED (controlling a digital output) in an AXL F DO16 I/O module. The I/O module is controlled by the controller (AXC F 2152) via Axioline F.
The app description for the demo solution is as follows:
{
"plcnextapp": {
"name": "EngineerApp AXIO",
"identifier": "EngineerApp_AXIO",
"version": "123.456data",
"target": "AXC F 2152",
"minfirmware_version": "19.0.0",
"manufacturer": "PhoenixContact"
},
"engineerapp": {
"folder": "/arp/PCWE/"
}
}
The following demo EngineerApp files are available on GitHub HERE:
- App container folder:
- App description file: app_info.json
- Compiled PLCnext Engineer Solution folder (arp/PCWE)
- Source folder:
- PLCnext Engineer project file AXCF_AXIO_DEMO.pcwex
- App description file: app_info.json
- Demo app container file: EngineerApp_AXIO.app
Support in the firmware
The PLCnext Control Solution as an app part is supported in the firmware from version 19.0.0.
See also