Showing posts with label Add-On Instructions. Show all posts

Updating an Add-On Instruction to a Newer Revision via Import

0 comments
When you need to update an instruction to a newer revision, you can import it from an .L5X file or copy it from an existing project. You must be offline to update an Add-On Instruction.
Follow these steps to update an Add-On Instruction to a newer revision by importing it.

1. Right-click the Add-On Instruction folder and choose Import Add-On Instruction.

2. Select the file with the Add-On Instruction and click Import.


3. Review the Import Configuration dialog box, and from the Operations menu, choose Overwrite.


4. Click Collision Details to see any differences in the Add-On Instructions and to view where the Add-On Instruction is used.

The Property Compare tab shows the differences between the instructions, in this case, the Revision, Edited Date, and Software Revision.


The Project References tab shows where the existing Add-On Instruction is used.


5. Click Close and then OK to complete the operation.


Read More »

Importing an Add-On Instruction

0 comments
You can import an Add-On Instruction that was exported from another RSLogix 5000 project. When importing an Add-On Instruction, the parameters, local tags, and routines are imported as part of the Add-On Instruction. Once the project has the Add-On Instruction, you can use it in your programs.

When importing Add-On Instructions directly or as references, consider these guidelines.

Tag Data:
Imported tags that reference an Add-On Instruction in the import file may be affected if the Add-On Instruction is not imported as well. In this case, the imported tag’s data may be converted if the existing Add-On Instruction’s data structure is different and tag data may be lost.
If an existing Add-On Instruction is overwritten, project tag data may be converted if the Add-On Instruction’s data structure is different and tag data may be lost.

Logic:
Imported logic that references the Add-On Instruction in the import file may be affected if the Add-On Instruction is not imported. If an existing Add-On Instruction is used for the imported logic reference and the parameter list of the Add-On Instruction in the project is different, the project may not verify or it may verify but not work as expected.
If an existing Add-On Instruction is overwritten, logic in the project that references the Add-On Instruction may be affected. The project may not verify or may verify but not work as expected

Add-On Instructions While Online:
An Add-On Instruction cannot be overwritten during import while online with the controller, although a new Add-On Instruction may be created while online.

Final Name Change:
If the Final Name of an Add-On Instruction is modified during import configuration, the edit date of the imported Add-On Instruction will be updated. In addition, all logic, tags, User-Defined Data Types, and other Add-On Instructions in the import file that reference the Add-On
Instruction will be updated to reference the new name. As a result, the edit date of any Add-On Instruction that references the Add-On Instruction will be updated.
Add-On Instructions that have been sealed with an instruction signature cannot be renamed during import.

User-Defined Data Types:
Add-On Instructions cannot overwrite User-Defined Data Types. Add-On Instructions and User-Defined Data Types must have unique names.

Instruction Signature:
If you import an Add-On Instruction with an instruction signature into a project where referenced Add-On Instructions or User-Defined Data Types are not available, you may need to remove the signature.
You can overwrite an Add-On Instruction that has an instruction signature by importing a different Add-On Instruction with the same name into an existing routine. Add-On Instructions that have been sealed with an instruction signature cannot be renamed during import.

Safety Add-On Instructions:
You cannot import a safety Add-On Instruction into a standard task.
You cannot import a safety Add-On Instruction into a safety project that has been safety-locked or one that has a safety task signature.
You cannot import a safety Add-On Instruction while online.
Class, instruction signature, signature history, and safety instruction signature, if it exists, remain intact when an Add-On Instruction with an instruction signature is imported.


Import Configuration

When you select a file to import, the Import Configuration dialog box lets you choose how the Add-On Instruction and referenced components are imported.

If there are no issues, you can simply click OK to complete the import.

If your Add-On Instruction collides with one already in the project, you can:

· Rename it, by typing a new, unique name in the Final Name field.
· Choose Overwrite from the Operation menu.
· Choose Use Existing from the Operation menu.


The Collision Details button lets you view the Property Compare tab, which shows the differences between the two instructions, and the Project References tab, which shows where the existing Add-On Instruction is used.


Read More »

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 »

Using the Add Element Dialog Box

0 comments
Follow these instructions to access the Add (language) Element dialog box.

1. Press Alt + Insert anywhere in the editor or by right-clicking the logic in the Editor.


2. Locate the Add-On Instruction you want to add to your routine.


3. Select the Add-On Instruction and click OK.

Use Instruction Help to display the instruction help for any instruction in the browser.



Read More »

Accessing Add-On Instructions

0 comments
The Add-On Instruction can be used in any one of the Ladder Diagram, Function Block, or Structured Text languages (including Structured Text within Sequential Function Chart actions). The appearance of the instruction conforms to the language in which it is placed.

The Add-On Instructions in the project can be accessed from any of the normal instruction selection tools.

The instruction toolbar has an Add-On tab that lists all of the currently available Add-On Instructions in the project.



Read More »

Using Add-On Instructions

0 comments
Add-On Instructions are used in your routines like any built-in instructions. You add calls to your instruction and then define the arguments for any parameters.

Accessing Add-On Instructions (View)
Using the Add Element Dialog Box (View)
Including an Add-On Instruction in a Routine (View)
Tips for Using an Add-On Instruction (View)
Programmatically Access a Parameter (View)
Monitoring the Value of a Parameter (View)
Viewing Logic and Monitor with Data Context (View)
Determining if the Add-On Instruction is Source Protected (View)
Copying an Add-On Instruction (View)
Storing Your Add-On Instructions (View)

Read More »

Simulation Instruction Example

0 comments
The Simulation_DT_1st Add-On Instruction adds a dead time and a first-order lag to an input variable.

Figure 10 - Simulation Example Definition Editor General Tab


Figure 11 - Simulation Example Definition Editor Parameter Tab


Figure 12 - Simulation Example Logic


Ladder Diagram Configuration

In this example, the instruction simulates a deadtime and lag (first order) process.

The Simulation_DT_1st instruction reads the control variable from the PID instruction. The PID instruction reads the SimOutput Parameter of the Simulation_DT_1st instruction.


Function Block Diagram Configuration

The PIDE instruction sends the control variable to the Simulation_DT_1st instruction. The Simulation_DT_1st instruction calculates an output and sends it to the PIDE instruction as the process variable


Structured Text Configuration

Simulation_DT_1st( Sim_DT_ST, My_PIDE_ST.CVEU, DT_Array_ST );
My_PIDE_ST.PV := Sim_DT_ST.SimOutput;
PIDE(My_PIDE_ST );

The Simulation_DT_1st instruction reads the control variable from the PIDE instruction and calculates an output.

The output goes to the process variable of the PIDE instruction.



Read More »

Motor Starter Instruction Example

0 comments
The Motor_Starter Add-On Instruction starts and stops a motor.

If the stop pushbutton is closed and the start pushbutton is pressed then:

· the motor gets the command to run.
· the instruction seals in the command, so the motor keeps running even after you release the start pushbutton.

If the stop pushbutton is pressed (opened), then the motor stops.

Figure 4 - Motor Starter Example Definition Editor General Tab


Figure 5 - Motor Starter Example Definition Editor Parameter Tab


Figure 6 - Motor Starter Example Ladder Logic


The following diagrams show the Motor Starter instruction called in three different programming languages.

Figure 7 - Motor Starter Ladder Diagram


Figure 8 - Motor Starter Function Block Diagram


Figure 9 - Motor Starter Structured Text

Motor_Starter(Motor_Starter_ST, Stop_PB, Start_PB, Motor_Out_ST);

Read More »

Creating Instruction Help

0 comments
Custom instruction help is generated automatically as you are creating your Add-On Instructions. The Logix Designer application automatically builds help for your Add-On Instructions by using the instruction’s description, revision note, and parameter descriptions. By creating meaningful descriptions, you can help the users of your instruction.

In addition, you can add your own custom text to the help by using the extended description field. You can provide additional help documentation by entering it on the Help tab of the Add-On Instruction Definition Editor. The instruction help is available in the instruction browser and from any call to the instruction in a language editor by pressing F1.

Writing Clear Descriptions

When writing your descriptions keep the following in mind:

· Use short sentences and simple language.
· Be brief and direct when you write.
· Include simple examples.
· Proofread your entries.

This is an example of the Extended Description Text field in the Help tab of the Add-On Instruction Definition Editor. This area lets you create directions on how to use and troubleshoot your instruction. The Instruction Help Preview window shows how your text will look as generated instruction help.

Documenting an Add-On Instruction

Follow these steps to create custom help for an instruction.

1. Right-click an Add-On Instruction and choose Open Definition.

2. On the General tab, enter a description and a revision note for the Add-On Instruction to explain the purpose of the instruction.

3. Click the Parameters tab and enter a meaningful description for each Parameter.

4. Right-click each routine located below the Add-On Instruction in the Controller Organizer and choose Properties.

5. Enter a description for execution of each routine.

a. For the logic routine, describe execution of the instruction when EnableIn is true.

b. For the EnableInFalse routine (if one exists), describe actions that will take place when EnableIn is false, such as any outputs that get cleared.

c. For the Prescan routine (if one exists), briefly describe actions that will take place during the Prescan routine, such as initialization of any parameters.

d. For the Postscan routine (if one exists), briefly describe actions that will take place during the Postscan routine, such as initialization of any parameters resetting any internal state of the instruction.

6. Click the Help tab of the Add-On Instruction Definition Editor and enter additional information in the Extended Description field.

The extended description can include the following information:

· Additional parameter information
· Description of how the instruction executes
· Change history notes

7. Review the Help format in the preview window

This is an example of the Logix Designer application generated help for the instruction. This information is gathered from the definition descriptions that you complete when defining an instruction.









Project Documentation

With RSLogix 5000 software, version 17 and later, you have the option to display project documentation, such as tag descriptions and rung comments in any supported localized language. You can store project documentation for multiple languages in a single project file rather than in language-specific project files. You define all the localized languages that the project will support and set the current, default, and optional custom localized language. The software uses the default language if the current language's content is blank for a particular component of the project. However, you can use a custom language to tailor documentation to a specific type of project file user.

Enter the localized descriptions in your project, either when programming in that language or by using the import/export utility to translate the documentation offline and then import it back into the project. Once you enable project documentation in application, you can dynamically switch between languages as you use the software.

Project documentation that supports multiple translations includes these variables:

• Component descriptions in tags, routines, programs, equipment phases, user-defined data types, and Add-On Instructions
• Engineering units and state identifiers added to tags, user-defined data types, or Add-On Instructions
• Trends
• Controllers
• Alarm Messages (in configuration of ALARM_ANALOG and ALARM_DIGITAL tags)
• Tasks
• Property descriptions for module in the Controller Organizer
• Rung comments, SFC text boxes, and FBD text boxes

If you want to allow project documentation on an Add-On Instruction that is sealed with an instruction signature, you must enter the localized documentation into your Add-On Instruction before generating the signature. Because the signature history is created after the instruction signature is generated, the signature history is not translatable. If the translated information already exists when you generate the Add-On Instruction signature, you can switch the language while keeping the signature intact because the switch does not alter the instruction definition, it only changes the language that is displayed.

For more information on enabling a project to support multiple translations of project documentation, refer to the online help.


Read More »