Importing Types
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 Another Project' and 'Import From PLCopen XML'.
Import from Another Project
The 'Import From Another Project' command imports the types from another PLCnext Engineer project into an existing project. It does not matter whether the project to be imported is completed/released or under construction (partial or not compilable).
The types imported are added to the 'Local' folder of the respective subcategory in the COMPONENTS area.
Import from PLCopen XML
The 'Import From PLCopen XML' imports the types from a PLCopen XML file into an existing project. 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 as follows:
- System tasks are imported as Event Tasks. If an event name supported by PLCnext Engineer can be derived from the system task, the event name is automatically selected in the 'Event Name' column. Unsupported event names are discarded.
- Cyclic tasks are imported as Cyclic Tasks.
- Default tasks are imported as Idle Tasks.
- Event tasks are not 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.
What do you want to do?
Import from another project
Types from another PLCnext Engineer project can be imported into an existing project. It does not matter whether the current project is empty or already contains a PLANT structure and user-defined types in the COMPONENTS area.
- Open the project into which you want to import the file content.
- Select 'File > Import > Import From Another Project'. In the 'Open' dialog, browse for the desired project you want to import and click 'Open'.
The dialog 'Import from Another Project' appears.
- The dialog 'Import from Another Project' lists the available types that can be imported. Deselect the type you want to exclude from the import and click 'OK'.
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. |
- If a type with the same name already exists in the project, a corresponding message appears. To replace the existing type with the new type, click 'Yes'. Click 'No' to skip the import of the type and continue the process. To stop displaying this message again for all existing types, select 'Do not show again'.
- Consult the Error List (MESSAGES window) for error messages (for example semantic errors due to missing POUs or invalid types).
- Program instances and global variable declarations are not added to the current project automatically. Insert them manually in order to use the type in your project.
Double-click the 'IEC 61131-3' node in the PLANT, open the Data List editor, and insert a Global declaration for each external variable of an imported POU you want to use.
- In the 'Tasks and Events' editor of the 'PLCnext' node, create a program instance in a task for each imported program.
Import from PLCopen XML
Note
The XML file to be imported must comply with the PLCopen XML schema version 1.01 as created by PC WORX 6.x. |
The import of types from a PLCopen XML file project is only possible when a project is already open.
- 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. |
The POUs and data type worksheets selected in the dialog are added to the project in the respective COMPONENTS category.
- 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).