Integrating external libraries for the vendor blocks
How to integrate external C-libraries or C++-libraries, if they are used within your vendor blocks:
-
In the project explorer: Select the project in which you have created the vendor block.
-
In menu Project, select Properties.
-
In the properties, expand group PLC-Object and select Settings for C-Blocks.
-
Define the following properties for the platform for which you want to integrate external C-libraries or C++-libraries:
-
Under Target platform, select the platform (e.g. WindowsX86).
-
Enter the required paths/names in the input fields.
Input field for
Purpose
Include path
one or more additional include folders for your own header files (separated by
;
)
Example 1:c:/myheader/inc
Example 2:c:/myheader/inc;c:/myheader/h
Example 3:../../../myheader/inc
– This corresponds to the sub-foldermyheader\inc
of the current project.
It is possible to enter absolute and relative paths (both to be entered with/
). Start a relative path always with../../../
– this corresponds to the folder of the current project.
But it is also possible to use the variable${PROJECT_LOC}
in order to specify the folder of the current project.Library name
one or more names of the C-libraries or C++-libraries to be integrated (separated by
;
)
Example 1:library1
Example 2:library1;library2
Neuron recommends the usage of unique names for the libraries. Then you can be sure that Neuron Power Engineer integrates the correct library in the appertaining path.
Observe that you have to enter other names than those shown in the file system:Platform
Name of library (in the file system)
Input in the field
WindowsX86
TestW.lib
TestW
LinuxX86, Raspbian, RevolutionPi
libTestR.a
TestR
phyboardRegor, phyboardWega
libTestP.a
TestP
Library path
one or more paths to the folders with the C-libraries or C++-libraries to be integrated (separated by
;
)
Example 1:c:/library1
Example 2:c:/libraries/lib1;c:/libraries/lib2
Example 3:../../../libraries/lib1
– This corresponds to the sub-folderlibraries\lib1
of the current project.
It is possible to enter absolute and relative paths (both to be entered with/
). Start a relative path always with../../../
– this corresponds to the folder of the current project.
But it is also possible to use the variable${PROJECT_LOC}
in order to specify the folder of the current project.Additional source file path
one or more paths to the folders with additional source files (separated by
;
) so that these files are considered for the generated code
It is possible to enter absolute and relative paths (both to be entered with/
). Start a relative path always with../../../
– this corresponds to the folder of the current project.
But it is also possible to use the variable${PROJECT_LOC}
in order to specify the folder of the current project.Observe:
-
Only files with extensions
.c
and.cpp
are considered. Other files within the folders are ignored. -
Specified folders are searched recursively for C/C++ files.
Additional code generators:
depending on the extended version of Neuron Power Engineer: a list of additionally available code generators
By default, the code generators are enabled. If required, uncheck the code generator for the current project. -
-
-
Click Apply so that the settings for the platform are applied.
-
If you want to integrate external C-libraries or C++-libraries for other platforms as well, repeat the last step (number 4) for each platform.
-
Click OK in order to close the dialog with the properties.
If you load the application onto the PLC now, the defined C-libraries or C++-libraries are included.