About Import/Export of Components
The Import/Export of Components lets you have a greater degree of flexibility for development and deployment of projects offline and online. It provides for the reuse of components of the project. You can export large components (such as routines and programs) from a project and import these components, both offline and online, into another project. Project changes or additions that are impractical to do with online editing can be done offline and then imported all at once into a running controller.
Engineering collaboration is also facilitated in that many engineers can work on one or more of these components independently and then merge them into a single project.
When you export a selected component from a project to an .L5X file, the file contains the definition of that component and everything else from the project that is referenced by that component, such as tags, User-defined Data Types, and Add-On Instructions.
You can import these components into either the same or a different project, both offline or online (even in Remote Run mode). When you import these sections, you can create something new in a project (specify a unique final name) or update something that already exists in the project (specify a final name that is the same as an existing object).
Importing a component and its associated components is like doing a number of edits to your project file in one operation. You can do all these edits separately but import gives you the ability to do them all at once.
To complete the import, all of the references in that section must be resolved, such as identifying the appropriate tags, routines, User-defined Data Types, and Add-On Instructions.
You configure the import on the Import Configuration Dialog box to resolve the references. For example:
In this example:
- Tag_A is created. The imported logic referencing Tag_A references a newly created Tag_A in the project.
- Tag_B has its name changed to Tag_D so it is not created. The imported logic referencing Tag_B instead references the existing Tag_D.
- Routine_A has its name changed to Routine_B. Imported JSRs to Routine_A are directed to the existing Routine_B.
- AOI_1 overwrites an existing Add-On Instruction called AOI_1. The imported logic and tags use AOI_1 and any existing references to AOI_1 in the project now use the new definition of AOI_1 from the .L5X file (overwriting an Add-On Instruction definition can only be done offline).
- UDT_1 is created. Imported tags defined by UDT_1 are defined by UDT_1 in the project.
For example, if you import a routine, the routine itself is the imported component. The program and controller scope tags, along with their corresponding User-defined Data Types, any routines called through JSR instructions, and any Add-On Instructions in logic of the routine are the references. When you configure the import, you select how to connect the references. The following conditions must be met.
Every:
- Tag in the import must connect to a tag in the project.
- JSR to a referenced routine must be directed to a routine in the project.
- User-defined data type for a referenced tag must connect to a user-defined data type in the project.
- Add-On instruction must connect to an Add-On Instruction in the project.
These references might already exist in the project or you can create them in the project from the information in the .L5X file.
Import as Primary Component or a Reference
The primary component you import (such as a section of rungs, routines, or programs) is the import component. Any external components used by the primary component are references. For example, if you import a program (primary component), all of its tags and routines are also components. On the Online Configuration dialog box, you can rename the component and its external references and change their descriptions, but you cannot change any of the components. If the component name matches an existing component in the project, the existing component is overwritten. If the primary component name does not match an existing component in the project, a new component is created.
By default, tag references connect to components of the same type and name in the project. You can change the final name of the component on the Import Configuration dialog box. For example, you could connect a Boolean tag reference A to B[3].ACCUM.4 (where B is an existing Tag in the project that is an array of structures). Then all tag references in the imported logic to tag A now says B[3].ACCUM.4. Another way to connect tag references to existing tags in the project is to modify their Alias for field. You can modify the Alias For field if you are creating a new tag or overwriting an existing tag, regardless of whether it was originally an alias tag or not. This mechanism also lets you connect multiple tag references to the same tag in the project.
Module references are similar in that they connect to components of the same type and name in the project, and you can change the final name of the component. You can also use the module browser to connect to a module by clicking in the Final Name column.
It is possible to create logic that tag references or other components that do not exist. These are undefined components. If you export that logic, the name of the undefined component is also exported, but there is no definition to export. Similarly, when logic references another imported component, such as a JSRs to other routines for a routine component, these referenced routines are not included in the import file. The .L5X file does not contain a definition and the import cannot create the component, but you can still connect an undefined tag reference by changing its final name to collide with an existing component.
All tags referenced by the component are included in the export file. All referenced Add-On Instructions and User-defined Data Types are also included, unless the export component is an Add-On Instruction or User-defined Data Type and tag references are not specified to be included in the export.
Definitions of tasks, programs, equipment phases, equipment sequences, modules, and undefined components that are referenced in the exported logic are not included in the export file (but the tag references to those components are still included in the export file).
Offline values are included for all exported tags when the project is offline at the time of export.
Provide Feedback