Importing Types from PLCopen XML
Note
The types import function, as described here, is not available for safety-related POUs and data types. |
PLCnext Engineer allows you to import IEC 61131-3-compliant types (programs, function blocks, function POUs, and data types) as well as HMI symbols and pages into your project.
For this, the 'File > Import' menu provides the commands 'Import From PLCopen XML' and 'Import From Another Project'.
The 'Import From PLCopen XML' imports the types from a PLCopen XML file into an existing project.
Precondition: The XML file must comply with the PLCopen XML schema version 1.01 as created, for example, by PC WORX 6.x. (For more information, please refer to http://www.plcopen.org.)
When importing a PLCopen XML file, the following applies:
- Tasks are imported to the ESM1 node in the 'Tasks and Events' editor of the PLCnext node. For task types, only cyclic tasks will be imported.
- Data types and POUs are added to the 'Local' folder of the respective subcategory in the COMPONENTS area.
- Types with the same name in the project are not imported.
- Variables are imported into the controller's data list.
- If you import the file into an empty project (project does not contain a controller), the resource related elements such as tasks, variables, etc. will not be imported. A corresponding note is indicated in the import dialog.
- Messages about the import process are reported in the Project Log in the MESSAGES window. The log lists, for example, if types have not been imported because they are not supported in PLCnext Engineer (such as an unsupported programming language) or already exist or if imported graphical code could not be handled correctly.
Proceed as follows:
- Open the project into which you want to import the file content.
- Select 'File > Import > Import From PLCopen XML'. In the 'Open' dialog browse for the desired XML file you want to import and click 'Open'.
- The dialog 'Import from PLCopen XML' displays information on the file version and its origin, date, etc. Verify this information to ensure that the correct file (version) is going to be imported.
- Check the option 'Align Graphical Objects to Grid', if desired.
- Deselect the types you want to exclude from the import and click 'OK' (the dialog lists the available types that can be imported).
Note
Observe the dependencies of POUs when (de)selecting them in the dialog. If, for example, a POU is imported which calls a function block that is not imported, the missing FB will cause a semantic error. - Consult the Project Log in the MESSAGES window for messages about the import process.
- Consult the Error List (MESSAGES window) for error messages (for example semantic errors due to missing POUs or invalid types).