-

Importing Types from Another Project

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'.

The 'Import From Another Project' command imports the types from another PLCnext Engineer project into an existing project. It does not matter whether

The types imported are added to the 'Local' folder of the respective subcategory in the COMPONENTS area.

Proceed as follows:

  1. Open the project into which you want to import the file content.
  2. 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.
  3. In the dialog, you can specify a target folder for the imported types. If you make a specification here, then the imported types appear in the COMPONENTS in each case under this folder name. The imported types are then easier to find.
    Without specifying a destination folder, the imported types are sorted into the already existing types according to their category.

    Example:

  4. 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'.

    The tree in the import dialog reflects the usual project structure: You can find the following subtrees each of which contains the importable type elements:

    • 'Libraries': only user libraries generated in PLCnext Engineer can be imported. System or firmware libraries are not listed.
    • 'Components' may contain the subcategories
      'Programming' (POUs and data types worksheets from the import project),
      'HMI' (objects and symbols),
      'Devices' (which have been added to the import project).
    • 'Plant': may only contain HMI pages as they are the only types in the PLANT area.

    Search/filter function in the import dialog

    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.

  5. 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'.
  6. Consult the Error List (MESSAGES window) for error messages (for example semantic errors due to missing POUs or invalid types).
  7. 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.
  8. In the 'Tasks and Events' editor of the 'PLCnext' node, create a program instance in a task for each imported program.