You are on page 1of 14

Add-On Instructions can be created using Ladder Diagram, Function Block Diagram or Structured Text and can be used

in any of these languages without modifying the Add-On Instruction in any way. They can be managed by exporting and importing the definition to XML files. Creating add on instruction Open RSLogix 5000 and look at the Controller Organizer. Youll see a folder for Add-On Instructions.

To create a new instruction, right click on the Add-On Instructions folder and select New Add-On Instruction.

Give the instruction a meaningful name. In this example, we will create an Instruction to control a pump and to monitor how long the pump operates. Lets call it PumpWithTime. Select a programming language from the Type field. You can choose Ladder Diagram, Function Block Diagram or Structured Text. This example uses Function Block Diagram.

Check the boxes to Open Logic Routine and Open Definition editor. The check boxes allow you to open the logic routine editor used to create the instruction, and to open the Add-On Instruction Definition editor, which is used to define the parameters associated with the instruction. Click OK to accept the Add-On Instruction. This will open the Function Block editor in the background and the Add-On Instruction definition editor window in the foreground.

The Add-On Instruction Definition Editor opens to the General tab. It lists basic information for that instruction and allows you to make modifications.

The Local Tags tab allows you to define tags as local to the instruction. Tags defined as local are not visible in the data type defined for the Add-On Instruction. Only the defined parameters are shown as members in the instructions data type.

The Scan Modes tab allows you to define optional routines that handle specific behaviors for specific conditions. These are Prescan, Postscan, and EnableInFalse routines.

The Change History tab identifies who created the Add-On Instruction, who last edited it and when.

The Parameters tab allows you to define the Input and Output Parameters of the instruction. For the PumpWithTime example, we will need a Command parameter to tell the pump to start and stop.

In the Usage field, you can select either an input or an output parameter, which can be passed by value in or out of the instruction. You can also select an InOut parameter, which can be used to reference a structure or a large array of data without passing it through to the instruction. Select Input for the Command parameter.

Select OK to accept your changes and close the Add-On Instruction Definition editor. This will activate the language editor which, in this example, is the Function Block editor. Now we are ready to create the logic for the Add-On Instruction.

In this example, we will use two Input references, one Discrete Two-State Device instruction (which will be the basic controller for the pump), a Retentive Timer instruction and an Output reference. Other instructions can be added later if they are needed.

To add the first instruction, use the Insert key to open the Add Elements browser within the Function Block editor and select the Discrete Two State Device instruction.

Double click on an Input Reference and select the appropriate parameter from the list. Repeat for the other Input reference and the Output References.

As you need additional instructions, use the Insert key and select from the Add Elements browser.

You might also like