Creating an Export File

0 comments
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.


Read More »

Importing and Exporting Add-On Instructions

0 comments
Creating an Export File (View)
Importing an Add-On Instruction (View)
Updating an Add-On Instruction to a Newer Revision via Import (View)

Read More »

Storing Your Add-On Instructions

0 comments
There are two ways to store a group of Add-On Instructions together. One is to save your Add-On Instructions in a project file. Another is to create an L5X export file.

Follow these steps to store your instructions by saving them in a project file.

1. Identify what instructions you want to store.

2. Place them in a project file called something like MyInstructions.ACD.

3. Open other projects in additional instances of the application and use copy and paste or drag and drop to move a copy of the instruction from MyInstructions.ACD to another project.

If any of these instructions reference the same Add-On Instruction or User-Defined Data Type, there is only one shared copy in the project file. When an Add-On Instruction is copied to another project, it also copies any instruction it references to the target project.


Read More »

Copying an Add-On Instruction

0 comments
You can copy an Add-On Instruction into your project when it exists in another Logix Designer project. After you copy the Add-On Instruction, you can use the instruction as is or rename it, modify it, and then use it in your programs.

Follow these steps to copy the Add-On Instruction.

1. Open the Logix Designer project that contains the Add-On Instruction.

2. Find the instruction in the Add-On Instructions folder.


3. Right-click the instruction and choose Copy.

4. Go to the other project where you want to paste the instruction.

5. Right-click the Add-On Instructions folder and choose Paste.



Read More »

Determining if the Add-On Instruction is Source Protected

0 comments
An Add-On Instruction may be source protected so you cannot view the logic.
Follow these steps to see if an Add-On Instruction is source protected.

1. Select the Add-On Instruction in the Controller Organizer.

The Add-On Instruction cannot be expanded when fully protected.

2. Look in the Quick View pane for Source Protection.

If the Source Protection attribute is not listed, then the instruction is not protected.



Read More »

Viewing Logic and Monitor with Data Context

0 comments
Follow this procedure when you want to view the logic of an Add-On Instruction and monitor data values with the logic.

1. Right-click the instruction call in any routine.


2. Choose Open Instruction Logic.


The Language Editor opens with the Add-On Instruction's logic routine and with data values from the instruction call.

As you view the logic you can:

· Identify the instruction call whose tags are being used for data.
· See the logic as it executes (when online).
· See Parameter and Local Tag values.
· Change local tag and parameter values for the data instance selected.


To edit the logic of the Add-On Instruction, you must select the instruction <definition> in Data Context.


You cannot edit the instruction logic:

· Online.
· When the logic is in the context of an instruction call.
· If the instruction is source-protected.
· If the instruction is sealed with an instruction signature.

Read More »

Monitoring the Value of a Parameter

0 comments
Follow this procedure when you want to see or change a parameter value of an Add-On Instruction.

1. Open the Properties of the instruction based on what language you are using.

a. For either a Function Block or Ladder Diagram, click Properties for the instruction.


b. For Structured Text, right-click the instruction name and choose Properties.

Motor_Starter(Motor_Starter_ST,
Stop_PB,Start_PB,Motor_Out_ST);


2. Monitor the value of the parameters and change any if needed.
3. Type a new value for each parameter as needed.
4. Click Apply and when finished, OK.

Read More »

Programmatically Access a Parameter

0 comments
Follow these procedures for any language when you want to access an Add-On Instruction parameter that is not available on the instruction face by default.

The following procedures demonstrate how to use the Jog parameter of the Motor Starter Add-On Instructions.


Using the Jog Command in Ladder Diagram

The first rung sets the Jog bit of Motor_Starter_LD = Jog_PB.


Using the Jog Command In Function Block Diagram

Any parameter can be made visible or invisible except those defined as required. Required parameters are always visible. If the parameter is required, you will see it checked in the Properties dialog box.

1. Click Properties for the instruction.


2. Check the Vis checkbox of the Jog parameter to use it in your diagram.

3. Click OK.


4. Wire to the pin for the parameter.


Using the Jog Command in Structured Text



Read More »

Tips for Using an Add-On Instruction

0 comments
This table describes programming tips for you to reference when using Add-On Instructions.

TopicDescription
Instruction HelpUse the instruction help to determine how to use the instruction in your code.
Ladder RungsIn a ladder rung, consider if the instruction should be executed on a false rung condition. It may improve scan time to not execute it.
Data TypesA data type defined with the Add-On Instruction is used for the tag that provides context for the execution from your code. A tag must be defined of this Add-On Instructiondefined type on the call to the instruction.
Indexed TagYou can use an indirect array indexed tag for the Instruction instance. One drawback is that you cannot monitor the Add-On Instruction by using this as a data context.
Passing Data·Input and Output parameters are passed by value. ·InOut parameters are passed by reference.

Read More »

Including an Add-On Instruction in a Routine

0 comments
Follow this procedure when you want to use an Add-On Instruction in one of your routines.

1. Open the Add-On Instruction folder in the Controller Organizer and view the listed instructions.

If the instruction you want to use is not listed, you need to do one of the following:

· Create the instruction in your project.
· Copy and paste an instruction into your project.
· Get the file for an exported instruction definition and then import the instruction into your current project.

2. Open the routine that will use the instruction.
3. Click the Add-On tab on the instruction toolbar.
4. Click the desired Add-On Instruction, for example Simulation, and drag the instruction from the toolbar into the routine.


5. Define arguments for each Parameter on the instruction call.

The instruction appears as follows in each of the languages.

Ladder Diagram


Parameter WithDescription
Single question markThis is a required InOut parameter. Enter a tag.
Single and double question marksThis is a required Input or Output parameter. Enter a tag.
Double question marksThis is not a required parameter. You can either: · Leave as is and use the default value. · Enter a different value if it is an Input parameter.

Function Block Diagram


ItemDescription
Nub on the end of pinThis is a required Input or Output parameter. You must wire the pin to an IREF, OREF, connector, or another block to verify.
Single question markThis is a required InOut parameter. Enter a tag.
No nub on the end of pinThis is not a required parameter. You can either: · Leave as is and use the default value. · Enter a different value if it’s an Input parameter.

Structured Text


The instruction expects arguments for required parameters as listed in the instruction tooltip.


Read More »