Creating an Export File

When you choose to export an Add-On Instruction, the exported Add-On Instruction includes all of its parameters, local tags, and routines. These will be imported with the Add-On Instruction automatically.

Optionally, you can include any nested Add-On Instructions or User-Defined Data Types that are referenced by the exported Add-On Instruction. Referenced Add-On Instructions and data types are exported to the .L5X file if you select Include all referenced Add-On Instructions and User-Defined Types during the export.

Add-On Instruction definition references may also be exported when a program, routine, set of rungs, or User-Defined Data Type is exported.

In deciding how to manage your Add-On Instruction definitions in export files, you need to consider your goals in storing the definitionss.



Exporting to Separate Files

If you want to store many Add-On Instructions that share a set of common Add-On Instructions or User-Defined Data Types in a common location, you may want to choose to export each Add-On Instruction and User-Defined Data Types to separate files without including references.

Follow these steps to export to separate files.

1. Right-click the Add-On Instruction in the Controller Organizer, and choose Export Add-On Instruction.

2. Select the common location to store the .L5X file.


3. Type a name for the file.

4. Clear Include referenced Add-On Instructions and User-Defined Types.

5. Click Export.

6. Follow the above steps to individually export the other shared Add-On Instructions and User-Defined Data Types.

Using export in this way lets you manage the shared Add-On Instruction and User-Defined Data Types independently of the Add-On Instructions that reference them. One advantage of this is the ability to update the shared component without having to regenerate all the export files for the instructions that reference it. That is, it is only stored in one file instead of in every file whose instruction references it. This can help with the maintenance of the instructions as you only have to update one export file.

To use Add-On Instructions that have been exported in a separate file, without references, you must first import any User-Defined Data Types of Add-On Instructions that the exported instruction references before the import of the referencing instruction can be successful. To do this, work from the bottom up.

Import the lowest-level User-Defined Data Types and any User-Defined Data Types that reference them.

Then, import the lowest-level Add-On Instructions, followed by any Add-On Instructions that reference those low-level Add-On Instructions. Once all of the items it references are in place, the import of the Add-On Instruction will succeed.


Exporting to a Single File

If you manage each Add-On Instruction as a standalone, you may want to export the instruction and any referenced Add-On Instructions or User-Defined Data Types into one export file. By including any referenced Add-On Instructions or User-Defined Data Types, you also make it easier to preserve the instruction signature of an Add-On Instruction.

Follow these steps to export to a single file and include any referenced items.

1. Right-click Add-On Instruction in Controller Organizer and choose Export Add-On Instruction.

2. Choose the location to store the .L5X file.


3. Type a name for the file.

4. Check Include referenced Add-On Instructions and User-Defined Types.

5. Click Export.

This exports the selected Add-On Instruction and all the referenced instructions into the same export file. This file can be used to distribute an Add-On Instruction. When the exported Add-On Instruction is imported into the project, the referenced instructions are imported as well in one step.


0 comments :