PLM (Program Library Manager)

The Program Library Manager (PLM) is part of the PLC Manager. It loads and unloads components during the runtime of the PLCnext Technology firmware. The PLM controls the entire service life of the component instance in accordance with the states of the controller and changes of these states by means of the PLCnext Engineer commands: 

  • Cold or warm restart 
  • Hot restart
  • Reset
  • Download (a reset is implicitly performed prior to the download, however, not during Download Changes)

Functions

The PLM takes on the role of creating, configuring and destroying the components that can instantiate user programs. The application components are controlled as follows:

Calling of anIComponent User action in PLCnext Engineer
void Initialize()
  • Restart
  • Send project
void SubscribeServices()
  • Restart
  • Send project
void LoadSettings(const string & settingsPath)
  • Restart
  • Send project
void SetupSettings()
  • Restart
  • Send project
void PublishServices() The function is only called by a firmware component, not by the PLM.
void LoadConfig()
  • Restart
  • Cold restart
  • Warm restart
  • Send project
void SetupConfig()
  • Restart
  • Cold restart
  • Warm restart
  • Send project
void ResetConfig()
  • Restart
  • Cold restart
  • Warm restart
  • Send project
void Dispose()
  • Send project

Configuration

The PLM system is configured via a *.plm.config file that is created automatically by the PLCnext Engineer.  For more information in the configuration files, see Configuration files.

The PlmConfigurationDocument format is used to configure components that can instantiate user programs. The Library, Component and Settings elements are evaluated by the PLM.

PLM libraries

The configuration document that adds a library to the PLM configuration is created automatically by the PLCnext Engineer as shown in the following example:

<?xml version="1.0" encoding="utf-8"?>
<PlmConfigurationDocument    
   xmlns="http://phoenixcontact.com/schema/plmconfig"    
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    
   xsi:schemaLocation="http://www.phoenixcontact.com/schema/plmconfig"schemaVersion="1.0" > 
                                
   <Libraries>         
      <Library name="MyLibraryPLM" 
         binaryPath="$ARP_PROJECTS_DIR$/Default/libs/libMyLibraryPLM.so" />
      </Libraries>
   </PlmConfigurationDocument>


The following table lists explanations of the individual attributes:

XML element Description
<Libraries> List of libraries. Here, libraries are listed that are to be loaded to create components.
<Library> Definition of a library.
name Name of the library referenced in a component configuration.
binaryPath Path of the library's binary (*.so) that is to be loaded.

PLM components

Components are classes in the sense of object-oriented programming. They are a part of a library and provide a public interface to the library. They therefore facilitate access to libraries with coherent functionality, and can be instantiated once or several times.

PLM components enable the PLCnext Technology platform to be extended by configuring accordingly. The PLM components must be implemented in accordance with a particular template. The PLM components must register with the ComponentFactory of the library. Furthermore, they must implement the IComponent interface in order for the PLM to dynamically integrate them into the firmware (see IComponent and IProgram).

PLM components are instantiated once or several times. They are assigned with a system-wide unique instance name.

Adding a component instance

Component instances are added to the PLM configuration as shown in the following example:

<?xml version="1.0" encoding="utf-8"?>
<PlmConfigurationDocument
   xmlns="http://phoenixcontact.com/schema/plmconfig"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.phoenixcontact.com/schema/plmconfig"
   schemaVersion="1.0" >
      <!-- Components included into /opt/plcnext/projects/Default/*.acf.config
           are managed by ACF
           while components included into /opt/plcnext/projects/Default/Plc/Plm/*.plm.config
           are managed by PLM
      -->
   <Components>
      <Component name="PlmDemo" type="MyLibraryPlm.MyComponentPlm" library="MyLibraryPlm">
         <Settings path="/opt/plcnext/projects/Default/libs/PLMDemoSettings.xml" />
      </Component>
   </Components>
</PlmConfigurationDocument>

The following table lists explanations of the individual attributes:

XML element Description
<Components> List of the components that are to be created
<Component> Definition of a component instance.
name Name of the component instance.
It must be unique throughout the entire system because all resources in the system are addressed via the component name.
type Type name of the component. The name is composed of <namespace>.<class>
A library can provide several component types. Typically, C++ type names are used here. The name is used in the code to register components with the ComponentFactory. This is the only dependency between the system configuration and the source code.
library Name of the library that contains the component and was defined under <Libraries>.
<Settings path> Path to the component settings file.
If the component requires a project configuration, the path to the component-specific project configuration must be specified in the settings file. This settings file is especially useful if two or more component instances of the same type shall be used.

PLM components can instantiate programs which are executed by an ESM task. The configuration which programs to instantiate and their association to an ESM task is described in the Task configuration via configuration files.

 

 

 

 


• Published/reviewed: 2024-12-19  ☃  Revision 076 •