Retrieving and Editing Project Information
You can use the Project Information object to retrieve information about your project and the associated file, and edit certain information.
File attributes
Meta-information, such as vendor, 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. It is therefore crucial that, as a library vendor, 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
.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
.The Project Information dialog opens.
Select the Automatically generate 'Project Information' POUs option.
Requirement: The following property is defined.
Schlüssel = nProp1 Typ= Zahl Wert= 333
Select the Automatically generate 'Project Information' POUs option.
Declare a
DINT
type variable.Example:
showprop : DINT;
Call the function
GetNumberProperty
:showprop := GetNumberProperty("nProp1");
You are granted access to the value in the application.
Tip
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 used as a dongle.
Requirement: The project is a library project.
Click
.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.
Deprecated: Signing a library project – Only for version compatibility with CODESYS < 3.5 SP15 – In version CODESYS V3 SP17 and higher, only for existing libraries with the deprecated signing which has been created in the Project Information – Signing dialog
Tip
As of CODESYS V3 SP15, library signing is always based on certificates. To perform this kind of signing, see the help page about the Save Project as Compiled Library command. In contrast to deprecated signing by using the settings in the Project Information – Signing dialog, the entire library is signed with the certificate.
In case you still have to sign a library project for a CODESYS version < V3 SP15 for reasons of compatibility, then proceed as follows:
Requirement: You have an available private key file with an associated token. In the project information of the library project, a library compatibility with a CODESYS version < V3 SP15 is set on the Summary tab.
Click
.The Project Information dialog opens.
Click the Signing tab.
Select the Activate signing option.
Specify the memory location of your private key file.
CODESYS automatically enters the token in Public key token.
Example:
427A5701DA3CF3CF
Click
.The library project is saved as a files with the extension
*.library
. You will see the token in the library repository or Library Manager in the library details and can compare it with the published token from the library vendor. In this way, you can check whether the library actually originates from the desired vendor.
Creating private key files
Click
.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.