You can use the “Project Information” object to retrieve information about your project and the associated file, and edit certain information.
The object contains information about
-
File attributes
-
Meta-information, such as manufacturer, title, or author
-
Properties with keys
-
Statistics
-
Licensing
-
Signing: This way of signing translated libraries is deprecated, and for security reasons should only be used if compatibility with older versions is required. If this method is used, then later you can use a public key token to verify that the library was last signed by the library vendor. As a library vendor, it is therefore crucial that you make the public key used available to the customer, for example in the documentation.
CODESYS saves the project information as an object within the project. When you transfer a project to another system, the “Project Information” object is transferred with it. There is no need for a project archive.
You can use property keys to access the project information externally via function blocks. For a library project, you can also query information about the licensing.
Editing meta-information
-
Click “Project Project Information”.
The “Project Information” dialog opens.
-
Click the “Summary” tab.
-
Specify your data in the input fields (example:
0.0.0.1
in the “Version” input field).CODESYS creates a property with a key for each given value and manages them on the “Properties” tab. For a library project, CODESYS still uses the properties and sorts later in the library repository.
If you select the option for CODESYS to create a functions block for these properties, then you can access the properties programmatically.
Creating functions for accessing properties
-
Click “Project Project Information”.
The “Project Information” dialog opens.
-
Select the “Automatically generate 'Project Information' POUs” option.
Example
Requirement: The following property is defined.
Key = nProp1 Type= number Value= 333
-
Select the “Automatically generate 'Project Information' POUs” option.
-
Declare a property of the type
DINT
, for exampleshowprop : DINT;
. -
Call the function
GetNumberProperty
:showprop := GetNumberProperty("nProp1");
You are granted access to the value in the application.
Note: The functions that are created with the “Automatically generate 'Project Information' POUs” option can be used only if the runtime supports the WSTRING
data type. If this is not the case, then instead you can apply the “Automatically generate 'Library Information' POUs” option. You can use the functions created in this way at least in the application
to access properties. These functions are not registered in the runtime.
Licensing library projects
If your project is a library project, then you can activate the library licensing in use here. The CODESYS Security Key is a dongle.
Requirement: The project is a library project.
-
Click “Project Project Information”.
The “Project Information” dialog opens.
-
Click the “Licensing” tab.
-
Select the “Activate dongle licensing” option.
-
Specify the dongle data in “Firm code”, “Product code”, “Activation URL”, and “Activation mail”.
The library is licensed.
Creating private key files
-
Click “Project Project Information”.
-
Click the “Signing” tab.
-
Click the “Create Private Key File” button.
The “Create Private Key File” dialog opens.
-
Select a safe location, e.g.
D:\for lib developers only\mycomp_libkey.libpk
and exit the dialog with “Save”.