You are on page 1of 128

L19 - Studio 5000® and Logix Advanced Lab

For Classroom Use Only!

Important User Information
This documentation, whether, illustrative, printed, “online” or electronic (hereinafter “Documentation”) is intended for use only as
a learning aid when using Rockwell Automation approved demonstration hardware, software and firmware. The Documentation
should only be used as a learning tool by qualified professionals.

The variety of uses for the hardware, software and firmware (hereinafter “Products”) described in this Documentation, mandates
that those responsible for the application and use of those Products must satisfy themselves that all necessary steps have been
taken to ensure that each application and actual use meets all performance and safety requirements, including any applicable
laws, regulations, codes and standards in addition to any applicable technical documents.

In no event will Rockwell Automation, Inc., or any of its affiliate or subsidiary companies (hereinafter “Rockwell Automation”) be
responsible or liable for any indirect or consequential damages resulting from the use or application of the Products described in
this Documentation. Rockwell Automation does not assume responsibility or liability for damages of any kind based on the
alleged use of, or reliance on, this Documentation.

No patent liability is assumed by Rockwell Automation with respect to use of information, circuits, equipment, or software
described in the Documentation.

Except as specifically agreed in writing as part of a maintenance or support contract, equipment users are responsible for:
• properly using, calibrating, operating, monitoring and maintaining all Products consistent with all Rockwell Automation
or third-party provided instructions, warnings, recommendations and documentation;
• ensuring that only properly trained personnel use, operate and maintain the Products at all times;
• staying informed of all Product updates and alerts and implementing all updates and fixes; and
• all other factors affecting the Products that are outside of the direct control of Rockwell Automation.

Reproduction of the contents of the Documentation, in whole or in part, without written permission of Rockwell Automation is
prohibited.

Throughout this manual we use the following notes to make you aware of safety considerations:

Identifies information about practices or circumstances
that can cause an explosion in a hazardous environment,
which may lead to personal injury or death, property damage, or economic loss.

Identifies information that is critical for successful application and understanding of the product.

Identifies information about practices or circumstances that can lead to personal injury or death, property
damage, or economic loss. Attentions help you:
• identify a hazard
• avoid a hazard
• recognize the consequence

Labels may be located on or inside the drive to alert people that dangerous voltage may be present.

Labels may be located on or inside the drive to alert people that surfaces may be dangerous temperatures.

L19 – Studio 5000 and Logix Advanced Lab

Contents
Before you begin ........................................................................................................................................... 4
About this lab .................................................................................................................................................................................... 4
Tools & prerequisites ........................................................................................................................................................................ 4

Lab 1: Introduction to the Logical Organizer <5 minutes> ..................................................... 5

Lab 2: Logix Designer Compare Tool <15 minutes> ................................................................ 10

Lab 3: Using AOI’s to Monitor Module Status <15 minutes> ................................................ 22
Lab 3.1: Using Module as an InOut Parameter............................................................................................................................... 22
Lab 3.2: Using Module Object Path Attribute .................................................................................................................................. 32

Lab 4: Improving Efficiency Using Partial Import Online <10 minutes> .......................... 38
Lab 4.1: Code Library Example ................................................................................................................................................. 38
Lab 4.2: Line Expansion Example ............................................................................................................................................. 44

Lab 5: Introduction to Program Parameters <40 minutes> .................................................. 56
Lab 5.1: Input Parameters .............................................................................................................................................................. 57
Lab 5.2: Output Parameters............................................................................................................................................................ 64
Lab 5.3: InOut Parameters.............................................................................................................................................................. 70
Lab 5.4: Public Parameters............................................................................................................................................................. 73
Lab 5.5: Direct Access of Program Parameters.............................................................................................................................. 78

Lab 6: User-Defined Data Types, UDT <10 Minutes> ............................................................... 83

Lab 7: Add-On Instructions (AOI) <25 minutes> ....................................................................... 99

3 of 128

You will have approximately 90 minutes to complete as many sections of this lab as you would like too.ACD Lab 4 Introduction to the Logical Organizer  Logical_Organizer. The following sections explain what you’ll be doing in this lab session.Studio 5000 and Logix Advanced Lab Lab 1 Compare and Merge Tool  L75_Project_Start.ACD & Line_Expansion. The intent of this lab to present an array of topics for the user to select from.ACD .ACD Lab 2 AOI Hardware Status  Hardware_Status_ModuleSts.ACD & Tank_Supervisor. NOTE: To ensure proper lab execution of the lab the VMWare image should be reset to the correct snapshot prior beginning the lab.ACD Lab 3 Introduction to Program Parameters  Sample_Project_Start. It will take approximately 180 minutes (3 hours) to complete all of the sections! You do not need to complete all of the sections.ACD & Library Lab 6 Using User Defined Datatypes  Advanced_Base.ACD Lab 7 AddOn Instructions AOI  CLX_S7_00. each lab section is independent so you can pick and choose what you are interested in during the time available.ACD & Hardware_Status_ModuleWho.ACD Lab 5 Improving Efficiency Using Partial Import Online  Tank_Controller.Before you begin About this lab Welcome to this Hands-On Lab series! This session provides you with an opportunity to explore advanced concepts within the Logix platform.ACD & CLX_S8_00. If you choose to complete every lab section it will take more than the allotted time for the lab. Tools & prerequisites This hands-on lab is intended for individuals who use: Studio 5000 Logix Designer or RSLogix 5000 ControlLogix or CompactLogix This hands-on lab uses the following files: L19 . and what you will need to do to complete the hands-on exercises. This hands-on lab uses: RSLogix Emulate 5000 v24 4 of 128 .

Studio 5000 and Logix Advanced Lab\ Lab 4 Introduction to the Logical Organizer 3. Open the project named Logical_Organizer. You will be organizing the application from Section 1 into logical groups. 2. Understand the different options available within the Logical Organizer.Lab 1: Introduction to the Logical Organizer <5 minutes> This section will cover the Logical Organizer which is new with version 24. 5 of 128 . Double-Click on the Lab Files folder on the desktop. Navigate to C:\Lab Files\ L19 . Goals: Organize the Section 1 application. Open Lab File 1.ACD.

The remainder of this section will walk you through the Logical Organizer. Right-click on the root folder (Logical Model Tank_Controller).Using the Logical Organizer 1. 3. Locate the Logical Organizer tab. This view doesn’t always present code modules in a logical format that is applicable to the machine or process design. This can be extremely helpful when viewing code modules that have been developed at the program level. Select Add => New Folder… 6 of 128 . 2. NOTE: The Controller Organizer is used to organize programs into a task structure which defines how the logic will be executed. Click on the Logical Organizer tab. The Logical Organizer gives users a new way to group and view programs in an application.

7. NOTE: The Logical Organizer should look like the following screen shot. NOTE: Now that we have some folders created. Name the folder Simulation_Logic. Click on the Simulation1 program and drag it to the Simulation_Logic folder. 6. NOTE: This folder will hold the simulation program used to fill and drain the tank. Click OK. 5. Create two additional folders using the same steps.4. Name one folder Tank_Manager and the other Station_1. let’s move the programs around. 7 of 128 .

Click on the Auto_Cycle1 Program and drag it to the Station_1 Folder. Click on the Pump1 Program and drag it to the Station_1 Folder. 8 of 128 . Click on the Station_1 folder and drag it to the Tank_Manager folder.8. 9. 25.

26. Close the Project. • Up to 15 sub-programs can be nested under one program or folder. Logical Organizer Facts: • New programs that are created in the Logical Organizer will appear in the Unscheduled Programs / Phases folder in the Controller Organizer. This is particularly powerful if a code library exists in the form of an ACD file. This view also supports the same functionality as the Controller Organizer to view. or delete code. Congratulations! You have just finished this Lab Click to Proceed to Contents 9 of 128 . The Logical Organizer also allows you to drag / drop programs and program structures (sub-programs) within the same application or across multiple instances of Studio 5000 Logix Designer. 27. General Information about the Logical Organizer The Logical Organizer allows the user to separate the application into a multi-level. You will see an example of this functionality later in the lab. • The number of programs that can be added to a task has been increased from 100 to 1000. • The Logical Organizer hierarchy is stored in the controller upon a download. logical hierarchy of folders. programs. create. Click on the Tank1 Program and drag it to the Station_1 Folder. and phases.

select All Programs > Rockwell Software > Logix Designer Tools > Logix Designer Compare Tool The Compare Tool window will appear 2. 10 of 128 . From the Start menu. Wouldn’t it be nice if you had a tool that could compare and merge these different projects together and lets you control the granularity to choose what parts of the project to merge? Since V17. In this lab we will cover the new Compare and Merge capabilities and then explore the ability to create a new merged file from the result of the Compare. Start the program. This tool is also available in Studio 5000 with enhancements to accommodate the new features introduced in V24. In the Toolbar click. Open the Compare and Merge Tool 1. the RSLogix 5000 Compare Tool has been available to help you find differences in Logix projects. With today’s complex Control Systems it’s not uncommon to have 2-5 Engineers working on their specific part of the project and chances are they are working from different Logix Project . the New Compare icon.Lab 2: Logix Designer Compare Tool <15 minutes> Overview of the Logix Compare and Merge Tool Long gone are the days where a single Controls Engineer completes a project all by themselves.acd files.

11 of 128 .The New Compare pop-up will appear. 4. click the Browse button.ACD file. Open Project Files Project Path: C:\ Lab Files\ L19 . navigate to the Lab1 Compare and Merge Tool folder and select the L75_Project_Start.Studio 5000 and Logix Advanced Lab\ Lab1 Compare and Merge Tool 3. For the Left Project. For the Right Project. This window allows us to pick the two projects we want to compare.ACD file using the path above. follow the same path and select the Line_Expansion.

Click OK. When completed. 12 of 128 . You may need to expand the window to make it large enough to see everything. Notice the options provided. the Compare Results window will show where the differences were found. Comparing Project Files When the compare process is done. The Compare progress button will appear while the compare is occurring. You could also filter out some of the tags. We will stay with the defaults here but you could eliminate tag values and descriptions as part of the compare. 5. Make sure the Include descriptions in compare box is checked. your Compare window will look like this.

For example. Double- Click the Summary Folder in the left most menu.Indicates common items that contain child elements. but with a rung that does not match.Indicates items that exist in one project but not the other. Double-clicking on these items brings up more detailed compare information. 13 of 128 . some differences exist between the properties of the Controllers. In this case the only difference is the Controller Properties Name 7.Indicates items that are common between the two projects. The middle and right columns report on how many differences were found in each category. or a tag that exists. Black . Gray .Indicates common items in which no differences were found. but have a difference. Information displayed in the Compare Summary. 6. but contains different data. Double-click on Properties. and Right Project is color-coded: Red . Blue . Since the Properties entry under the Controller folder is Blue. If you want to see the differences in the Compare Summary. These are for context only. you might have a ladder routine that exists in both projects. Close the Controller Properties window. The leftmost column titled ’Compare Summary’ shows the categories where differences were found. no further details can be displayed. The difference is also highlighted in blue. Left Project.

Double-click on the EN2T.Indicates items that exist in one project but not the other. The EN2T is Red signifying it does not exist in the _Start ACD file.8. Expand the Local folder in the Right Project. The next folder in the Summary window is labeled Modules. Remember! Red . The module’s full definition is displayed. Click on the Modules folder. Close the I/O Module Window. 9. This shows the I/O tree from the completed ACD file. 10. 14 of 128 .

Using what you’ve learned above. click on each different view and observe what is different. Click on Tasks and expand the sub-folders 12. 11. There are two other folders in the Summary window indicating other project differences: Tasks and Logical Organizer View. Click on Logical Organizer View and expand the sub-folders. 15 of 128 .

Refer to the table below for Icon definition. 13. 16 of 128 . Notice certain icon/ boxes are checked. The top windows show the comparison between the two projects. This table describes the meaning of the icons you will see in this comparison window. click on the Merge icon in the toolbar. To start the merge.Merging Project Files Now that we have a comparison of the two files. we can invoke the Merge feature introduced with Studio 5000 V24. This will open up a window with 2 sections.

15. If you prefer to use “Tank_Supervisor” you could check its box. So in our example above. 14. the name “Tank_Controller” will be selected. Clicking on the home icon will take us back to the original screen. You’ll first notice that a navigation aid exists in the toolbar in the form of the home icon. Double-Click on Main Task in the left pane. Referring to the Task folder. the greyed out checked box indicates that the result of the merge will have items from both files. Now we can choose the items under Tasks that we want included. an arrow and ‘Tasks’. We can go even further by selecting what properties of the task will be included. Double-Click on the Tasks folder to expand the entry. This results in the following window: 17 of 128 . Of course any changes we made to the check boxes would be reflected there.

acd file under the Scheduled Programs. it will be merged and will reside in the Main Task. otherwise if unchecked they will be in the Unscheduled Programs. We will see that both panes have the blue text indicating a blend of projects.ACD”. Navigate back to the MainTask by clicking MainTask in the menu path. 18 of 128 .16. 17. Explore the other folders and make some changes as you desire. All scheduled programs that are checked will be included in the Merge. Click the Home Icon to navigate back to the Home Page. The bottom pane in the Merge Tool window is labeled “Resulting Project – MergeProject. Double-Click on Scheduled Programs in the Left Pane. 18. Check the “Auto_Cycle2” box. This selection process can be done for every item in the selection panes. Once again.

feel free to explore the Tool and make any changes you like. 19 of 128 . If we click. we can see that most of the items will be taken from the right pane. The representations for each of these icons in this lower pane are as follows. then Auto_Cycle1. Double-Click on Programs. If you made some changes. 19. for instance on Auto_Cycle1 we will see why the icon is the double headed arrow. The Program Tags and MainRoutine will come from the left pane while the Connections will come from the right pane. Again. This pane shows which direction the merged items will be flowing. you will see those selected in the directional arrows. Using the key above.

Saving Merged Project Once the Merge project is set to your satisfaction. or L5X. The Save As window will open. By default. the file will be saved as MergeResult. 21. 20 of 128 . 22. You can change the save location if you would like. we can save it in any of 3 formats: ACD. but you can change the name or the file type before saving.ACD. L5K. launch Studio 5000 by clicking the Open Merge Result button on the Merge Tool and open your new Merge project. Also by default it will be stored in “Lab 1 Compare and Merge Tool” folder. Once you’ve completed saving. 20. Click on the disc icon in the Toolbar to begin the Save.

and Auto_Cyle2 Program along with an EN2T Module in the local Chassis. Click the Yes button when you are asked to open a copy of the MergeResult. Verify the project. 25. Close the compare tool and Logix Designer. You will probably see some errors and warnings but they are well documented and most likely the result of Program Connections that are missing. Pump2. Notice the Merged Program has a Tank2.acd file open. Congratulations! You have just finished this Lab Click to Proceed to Contents 21 of 128 .23. Note: Program Connections were introduced in V24. They are described in another lab session. Reviewing Merged Project 24.acd file. Notice: the Compare and Merge Tool may have the MergeResult.

You will be using an existing program in an effort to conserve time. Navigate to the link below and double-click the project named Hardware_Status_ModuleSts. Lab 3. This gives the user a great method of linking a module to the logic inside of an AOI. This allows the AOI to monitor attributes such as: EntryStatus. NOTE: RSLinx may take a few moments to open. 11.Studio 5000 and Logix Advanced Lab\ Lab 2 AOI Hardware Status 12. FaultCode. AOI Hardware Status:  Module as an InOut Parameter in an AOI: The predefined data type Module can now be added as an InOut parameter to an AOI. Double-Click on the Lab Files folder on the desktop. The example uses the Module predefined data type and retrieved the modules EntryStatus attribute.1: Using Module as an InOut Parameter This section will review an example of using the Module predefined data type in an AOI. Click on Communications => Who Active at the top of the screen. Examples will be given of how they can be used in your next application. 10. LEDStatus and the new Path attribute.  Module Class available inside an AOI: GSV instructions can now access the Module Class inside of an AOI.Lab 3: Using AOI’s to Monitor Module Status <15 minutes> This section will provide an introduction to a new feature in version 24 of Studio 5000™ Logix Designer. The EntryStatus attribute is analyzed to set descriptive status bits for the module.  Module Path Attribute: The Module Class of a GSV instruction now has a new Attribute called Path. you will learn the benefits for these new features. In this section. The module path can be used in a message instruction to point the message directly at the module. the user can use a pull down of the I/O Configuration to select the module linked to the AOI. This feature is designed to extend the functionality of Logix Add On Instructions (AOI).ACD to open it in Logix Designer. You can find the project in this directory: C:\Lab Files\ L19 . 22 of 128 . When instantiating the AOI. This returns the module path.

press Download. You do not need to expand the controller. You will need to restart RSLogix 5000 Emulator. close the Who Active window and reopen the Who Active window before you can continue. If prompted to change the controller back to Remote Run. RSLogix 5000 Emulator. If not prompted.13. Expand the MainTask. changed the controller mode to Remote Run in Studio 5000 Logix Designer. Expand the Program CommSts_Local. 14. 16. Expand AB_VBP-1 Note: If you see a Red X on the Virtual Chassis you may have shutdown RSLogix 5000 Emulator. 18. Select 01. 17. When prompted. Click Yes. 15. Press Download. Open the Routine Slot02_ModSts 23 of 128 .

Note: The branch below the AOI_ModuleSts_V01 instruction is used to show the values of the output of the AOI without having to look them up in the Monitor Tags view. The AOI_Module_Sts_V01 IOMod_Ref InOut Parameter uses the MODULE datatype. 24 of 128 . Monitor Rung 1. The AOI_ModuleSts_V01 returns the running status of the module inputted in to the AOI. We are only able to pass the MODULE datatype into the AOI.19.

25 of 128 . Check Inhibit Module. To see the AOI work we will Inhibit the SIM_IO_02 module in slot 2. 25. Then Click on OK. Press Yes on the Danger. 23. Click On Properties in the menu. 22. Navigate back to the Slot02_ModSts Routine. Navigate to the Connection tab. Connection Interruption screen that will popup.20. 21. Select the SIM_IO_02 module in slot 2 in the I/O Configuration and then Click the Right Mouse Button. 24.

Go back to the Slot02_ModSts Routine and verify that Local_02_ModSts.Running tag is False. You can now remove the Inhibit from the SIM_IO_02 module in slot 2 in the I/O Configuration.Running tag is True. 30.Inhibited tag is False and the Local Local_02_ModSts. 28. Select Rung 1 of the Slot02_ModSts Routine. This linking is done by selecting the module from the I/O Configuration. 29. let’s take a closer look at the linking of the module into the AOI.26.Inhibited tag is True and the Local Local_02_ModSts. 27. Now you can see that the Local_02_ModSts. Now. 26 of 128 . Press the Enable Edits button in the toolbar on top of the Ladder viewer/editor window.

31. a) The top selection. now you can see the configuration of IO_LocalSlot02 and how it links to the module in the I/O Configuration named SIM_IO_02. Select IO_LocalSlot02. d) Open the Parameters tab. 27 of 128 . Note: Using this method we can have the same logic and just change the connection for each use. Any module can be selected. 2 parameters are displayed: i) IO_LocalSlot_02 ii) IO_LocalSlot_03 b) The use of Program Parameters of the Module datatype can further aid in code reuse! c) Open the Program Properties for CommSts_Local by right clicking on the program and selecting Properties from the drop down menu. 32. above the I/O Configuration. You will just need to browse to the module using the I/O Configuration tree to select the module. Now. change the Module that IO_ModRef in the AOI_ModuleSts_V01 instruction is referencing.

38. Since we are using RSLogix 5000 Emulator and 1789-SIM modules we can create a module fault by temporally removing the 1789-SIM module from the RSLogix Emulate 5000 Chassis Monitor. Cancel Edits on the rung. In the AOI_ModuleSts_V01 instruction of this rung you will notice that the parameter is used in place of the module name that was used in our first example.33. Testing module faults. They will need to be returned to the RSLogix 5000 Emulate Chassis Monitor for these other labs to function properly. 28 of 128 . 37. 40. Note: The 1789-SIM modules are used in the next lab section. Monitor Rung 1 of the Slot02_ModSts routine. Press Cancel 34. Verify that this logic functions the same as the logic in Slot02_ModSts routine by inhibiting and un-inhibiting module SIM_IO_03. Open the RSLogix Emulate 5000 Chassis Monitor by Double Clicking on the RSLogix Emulate 5000 Chassis Monitor icon on the desktop. 35. Open the Routine Slot03_ModSts 36. 39.

Now. (this is the default) 43. Select Create (the only option) 29 of 128 .Faulted bit is now True. Right click on the module and select Remove. Press OK. Right click on Slot 2 in the chassis monitor.41. 44. return the 1789-SIM module to Slot 2 of the RSLogix Emulate 5000 Chassis Monitor. 45. 42. The Local_02_ModSts. be sure that Clear Chassis Monitor module configuration is not checked. Select the module in Slot 2.

Make Sure Use the Previous Configuration is Selected (this is the default) 48. Verify that that Label contains the text “IO_Simulation” 50.46. Press Finish 30 of 128 . Select Module Type: 1789-SIM and Slot 2 47. Press Next 49.

53. Close Studio 5000 Logix Designer. 31 of 128 . Verify that the module is in the chassis monitor 52.51. If prompted to save the file respond with No. You can follow these same steps (29-40) to test a fault for the 1789-SIM module in Slot 3.

but the STRING datatype using a DINT for the LEN (length). This returns the same information that we see in RSLinx Classic when we right click on a device in the RSWho screen and select Device Properties. Note: This example is based on information contained in Rockwell Automation KnowledgeBase Article 28917. Using the BTD we insure that the value is not converted. This should be more than enough for a real world MESSAGE datatype Path. The message instruction performs a Device Who. The COP instruction copies the remaining data to the Path DATA member – the string value of the message path. The BTD copies the SINT path length from the SINT array to the LEN member of the String. It returns the data shown below. The GSV returns SINT’s. 32 of 128 . This logic only uses byte 0 which limits us to a maximum of 255 characters for our length.Lab 3.2: Using Module Object Path Attribute This section will review an example of using the Path attribute of the Module Object. The logic shown below from the AOI_ModWho_V01 uses this logic. This time we are coping from SINT to SINT. This example re-uses a single message instruction to return the Module firmware revision from multiple modules. Additional Information – Module Object Path Attribute Example of Use The Path attribute of the Module object can be retrieved by using a GSV instruction. Since SINT array indexes 0 and 1 contain the length some additional logic is required to copy the Path attribute output in to the Message Datatype Path STRING member.

close the Who Active window and reopen the Who Active window before you can continue. Navigate to the link below and double-click the project named Hardware_Status_ModuleWho. You can find the project in this directory: C:\Lab Files\ L19 . 6. RSLogix 5000 Emulator. Select 01. changed the controller mode to Remote Run in Studio 5000 Logix Designer. 4. 33 of 128 .1. If not prompted.ACD to open it in Logix Designer. Double-Click on the Lab Files folder on the desktop.Studio 5000 and Logix Advanced Lab\ Lab 2 AOI Hardware Status 3. Click on Communications => Who Active at the top of the screen. Click Yes. When prompted. Press Download. 2. If prompted to change the controller back to Remote Run. 7. You will need to restart RSLogix 5000 Emulator. You do not need to expand the controller. 5. 8. press Download. Expand AB_VBP-1 Note: If you see a Red X on the Virtual Chassis you may have shutdown RSLogix 5000 Emulator.

Expand the Program ModuleWho_Local.9. Open the Routine Slot02_ModWho 34 of 128 . Expand the MainTask.

It also reuses a single message instruction. (Reference screen capture above) 12. 11. This returns more data than just the modules firmware revision. The AOI uses the New Path attribute of the MODULE object to point the message instruction to the module linked to IO_ModRef. single message tag and associated code! The message instruction in the AOI uses the DeviceWho message. 35 of 128 . The AOI_Module_Who_V01 retrieves the Major_Firmware and Minor_Firmware revisions of the Module linked to the InOut Parameter IO_ModRef. Monitor Rung 1. Right Mouse Click and Select Toggle Bit from the menu or press Control-T.10. This triggers AO_Module_Who to go out and retrieve the Major_Firmware and Minor_Firmware revision from the linked module – SIM_IO_02. Reference Rockwell Automation KnowledgeBase Article 28917 for details on all of the data returned by the DeviceWho message. Select the XIC instruction with Cmd_Local02_ModWho. This gives us an easy way to get module information. You will see the final values in the Local02_Major_Firmware and Local02_Minor_Firmware controller scope tags. On controller first scan all of the major and minor firmware revision tags are cleared.

14. 36 of 128 . Right Mouse Click and Select Device Properties. Open RSLinx Classic from the desktop and use Communications/ RSWho to browse to the SIM_IO_02 module (IO Module in Slot 2).13. From the screen that pops up verify the values you have in Local01_Major_Firmware and Local01_Minor_Firmware Logix controller scope tags.

15. Just like with the module in Slot 2. you can verify the results by bringing up the Device Properties of the module in RSLinx Classic. Go Offline with the controller. This AOI monitors the 1789-SIM module in Slot 3. Close Studio 5000 Logix Designer. 17. 16. Congratulations! You have just finished this Lab Click to Proceed to Contents 37 of 128 . 18. You can follow the same steps with the AOI in the Routine Slot03_ModWho. If prompted to save the file respond with No.

Navigate to C:\Lab Files\ L19 . We will also be discussing the Partial Import Online (PIO) functionality. 4. 1.ACD from the C:\Lab Files\ L19 . We will be working in both the Controller and Logical Organizer windows. 5. Minimize the Tank_Controller project.1: Code Library Example This section will demonstrate an example using an ACD file as an overall code library.Lab 4: Improving Efficiency Using Partial Import Online <10 minutes> This section will cover how to use some of the new features in version 24 of Studio 5000 Logix Designer to improve efficiency. 6. Open Studio 5000 Logix Designer 2.Studio 5000 and Logix Advanced Lab\ Lab 5 Improving Efficiency Using Partial Import Online 38 of 128 . Open the project Tank_Controller. Lab 4. Press File => Open 3.Studio 5000 and Logix Advanced Lab\ Lab 5 Improving Efficiency Using Partial Import Online folder on the desktop. Double-Click on the Lab Files folder on the desktop.

9. and now it’s time to drag and drop some of our code modules from our library to the actual Tank_Supervisor ACD file. Make sure you select the Controller Organizer for each application. NOTE: The Tank_Supervisor. It is the default application when a new project is created. Open the project named Tank_Supervisor. This essentially means the overall code library for your company is stored in an ACD file. You’ve opened both projects.7.ACD file is a blank project. For this example. NOTE: Let’s assume that the Tank_Controller.ACD file is your company’s Code Module repository.ACD. We created a new ACD file called Tank_Supervisor. 39 of 128 . Size the Studio 5000 windows for Tank_Supervisor AND Tank_Controller so they look like the screen shot below. 8. we will assume you must roll out a tank control system.

10. Make sure you drop it onto the 1756 Backplane. Click on the Logical Organizer in both applications. Select the 1756-MODULE SIM_IO module in the Tank_Controller. 11.ACD file.ACD file. 40 of 128 .ACD file and drag / drop it into the Tank_Supervisor. 28. The I/O Configuration should look like the following screen shot in the Tank_Supervisor.

This means that when a folder or program is copied. Select the MainProgram in the Tank_Supervisor. The introduction of the Logical Organizer gives the user a much better visual representation of a system or process and its components from a modular view. a “deep” copy will be performed.ACD file and press Delete.acd file. 15. when you drag and drop items into the Logical Organizer. NOTE: When you drag and drop items into the Logical Organizer. all sub-folders and sub-programs are copied. but do not close it. Select the Simulation_Logic folder in the Tank_Controller. NOTE: It is extremely easy and fast to drag and drop items between instances of Studio 5000 Logix Designer. Select the Tank_Manager folder in the Tank_Controller. programs are not scheduled. Additionally.acd file.12. 14.acd file and drag / drop it into the Logical Model for the Tank_Supervisor.acd file and drag / drop it into the Logical Model for the Tank_Supervisor. 13.acd at the moment. Maximize the Tank_Supervisor. Many users will store their code libraries in an ACD file for this purpose. We are finished with the Tank_Controller. 41 of 128 . We must now schedule the new programs. Minimize the Tank_Controller. 16.

Click on the Controller Organizer in the Tank_Supervisor. Leave everything else at the default value.17. Let’s create the Periodic Task for the Simulation Logic. Right-click on the Tasks folder and select New Task… 20. click OK. All programs should be in the “Unscheduled Programs / Phases” folder. 42 of 128 . Enter Sim_Logic into the name. 19. 18.acd file.

This gives us an example of using a Library ACD file with the Copy and Paste method of transferring Library logic to create an application ACD file. 25. Drag and drop the Tank1 Program into the MainTask Task. 23. This is one major advantage to using modular coding design practices. 43 of 128 . Drag and drop the Pump1 Program into the MainTask Task. You created this one from scratch extremely quickly using an ACD file that contains the same code modules (programs). Drag and drop the Simulation1 Program into the Sim_Logic Task. NOTE: This task/program structure should look nearly identical to the file we used in Sections 1 and 2. Drag and drop the Auto_Cycle1 Program into the MainTask Task.21. 22. 24.

You have the flexibility to store all code modules (programs / AOIs) in a dedicated library ACD file or as exported xml files. Expand the Simulation_Logic folder. rename items. while giving you quick access to all of the program’s parameters and connections prior to the import. Partial Import Online (PIO) PIO brings even more power and flexibility to the design environment when implementing Program Parameters. Click on the Logical Organizer in the Tank_Supervisor. During the design phase. Let’s walk through the process of adding the second Tank Station.acd file. and most importantly configure connections. 44 of 128 . 2. we knew we would be adding a second Tank Station after the initial startup.2: Line Expansion Example This section will demonstrate an example of using modular programming techniques to simulate a line expansion.Lab 4. When these files are imported or copied into the ACD file. PIO will allow you to import these programs while offline OR online. Let’s assume this application was already in operation in the field. 1. With that in mind. we made sure to include enough I/O to support the expansion. . you will have a detailed utility (GUI) that will allow the user to view / handle collisions.

Using right- click drag and drop of components will give you a few more options on how the component is pasted / imported.3. NOTE: This file is an export of the Simulation_1 program. you can left-click drag and drop components which will function similarly to copy/paste. 29. Select the Simulation. Right-Click on the Simulation_Logic folder. Press the Open button.L5X file. NOTE: Additionally. Select Add => Import Program.Studio 5000 and Logix Advanced Lab\Lab 5 Improving Efficiency Using Partial Import Online\Library. 45 of 128 . Navigate to C:\Lab Files\L19 . We will be using the PIO functionality to import this program into our application.

6. 46 of 128 . It should look like the screen shot below. Since we are adding a second line. we want to create a new simulation program. NOTE: The red flag indicates that an item is flagged for review. the operation will overwrite the existing Simualtion1 program with the imported program. NOTE: This window allows us to see the details about the import. The user should investigate all flags prior to the import. We can view and correct collisions as well as make changes to connections. By default.4. The Import Configuration window will be displayed. in this scenario. NOTE: This item was flagged because the program Simulation1 already exists in this application. 5. Let’s take a look at the flag listed above. change the Final Name to Simulation2. In the Configure Program Properties window. Select the Simulation1 program in the “Import Content” window.

NOTE: This will schedule the Simulation2 program in the Sim_Logic Periodic Task. NOTE: Notice how the flag disappeared and the operation changed to “Create”.7. Clicking in a different box will accept the name change. select Sim_Logic. 8. In the “Schedule In” drop-down. 47 of 128 . The Configure Program Properties window should look like the screen shot below. 9. Click in the Description box.

Click on the Connections folder in the Import Content window. 13. NOTE: This window will allow you to create new connections. scroll to the right to view the Final Connection. Select Disconnect for each connection. you will notice all connections are tied to Pump 1 and Tank 1. change the connections on the imported tags. The Simulation_Logic folder should now have a new program called Simulation2. 14. or disconnect connections. 48 of 128 . Now it’s time to import the station programs for station 2. In the Configure Connections window.10. Press OK. 11. For this example. we should disconnect these four connections. Click in the Operation box and select the drop-down. 12. Since we have not imported Station 2. They will be properly connected on the import of Station 2.

Using right-click drag and drop of components will give you a few more options on how the component is pasted / imported 16. Select Add => Import Program. NOTE: Additionally. Select the Station. 49 of 128 . you can left-click drag and drop components which will function similarly to copy/paste.15. Navigate to C:\Lab Files\ L19 .L5X file. Right-Click on the Tank_Manager folder. NOTE: This file is an export of the Station_1 folder. Expand the Tank_Manager folder. 30.Studio 5000 and Logix Advanced Lab\ Lab 5 Improving Efficiency Using Partial Import Online\Library. We will be using the PIO functionality to import this program into our application.

Click in the Description box to accept the name change.17. It should look like the screen shot below. change the Final Name to Station_2. The Import Configuration window will be displayed. Press the Open button. In the Configure Program Properties window. 50 of 128 . 31. 18. 19.

21. The Configure Program Properties window should look like the screen shot below. In the “Schedule In” drop-down.20. Click on the Connections folder in the Import Content window. select MainTask. 51 of 128 . NOTE: This will schedule all programs in the Station_2 folder in the MainTask. 22.

Inp_FillPumpON. In this example.Inp_DrainPumpON. Tank2. Since Station_2 must control an entirely different set of hardware.Out_DrainPumpON to \Simulation2. The following steps will walk you through this process.Val_PumpSpeed to \Simulation2. This is where the PIO feature can really start to improve efficiency.Out_FillPumpON to \Simulation2. the Station_2 folder is the parent and the Pump2. 24. and Auto_Cycle2 programs are children. 52 of 128 . Widen the Import Configuration window and expand the Final Connection column so you can see the Parameter Name AND the Final Connection. Change the Final Connection for \Pump2. Change the Final Connection for \Pump2. NOTE: You will notice that this parameter is listed twice in the list. Fanning is when multiple connections are configured to one parameter. 23. We will have access to all connections from a single window. This is normal when “fanning” is implemented.Inp_PumpSpeed. 32. 33. NOTE: You will notice that this parameter is listed twice in the list. Change the Final Connection for \Pump2. The Configure Connection window will allow you to make changes to connections in the parent program as well as all children programs that are within the parent program. This is normal when “fanning” is implemented. we must make the applicable changes to several connections. Fanning is when multiple connections are configured to one parameter.

Data[1].Inp_LeakDetectionPLC5. 40. 36.Inp_FillPumpPB to Local:2:I. Change the Final Connection for \Pump2. Change the Final Connection for \Auto_Cycle2.Data[0].01. Change the Final Connection for \Pump2. NOTE: You will notice that this parameter is listed twice in the list. 53 of 128 .03.Inp_PumpSpeed to Controller Scope Tag Pump2_Speed_Command 41.Out_DrainPumpON to Local:2:O.Inp_ModeSwitch to Local:2:I. This is normal when “fanning” is implemented.Out_TankLevel. 37. Fanning is when multiple connections are configured to one parameter. Change the Final Connection for \Tank2. Change the Final Connection for \Tank2. 35.Inp_DrainPumpPB to Local:2:I. This is normal when “fanning” is implemented. NOTE: We are not changing the connection for \Tank2. NOTE: You will notice that this parameter is listed twice in the list. Change the Final Connection for \Pump2. We will connect to the same controller tags as Station_1.Data[1].03.Val_TankLevel to \Simulation2.Data[1]. 39. Change the Final Connection for \Pump2.34. 38.Data[0].Out_FillPumpON to Local:2:O.Out_VoltMeter to Controller Scope Tag Pump2_Speed_Output.05. Fanning is when multiple connections are configured to one parameter. Change the Final Connection for \Pump2.01.

You will need to make a different Message tag to connect to the ‘Tank2. Create a new message tag for this connection. NOTE: The tag MSG_PLC5_Read can only have one connection. 26. The new message tag is not shown.Pv_MSG_PLC5Read' parameter. NOTE: Verify that all final connections match the screen shot below. You will need to create a new Message tag to connect to the ‘Tank2. Expand the Station_2 folder and verify that the programs imported successfully. Press OK. The red arrows indicate the connections that have been changed.42. NOTE: The tag MSG_PLC5_Read can only have one connection. 25. The Tank_Manager folder should now have a new folder called Station_2. The Final Connection column should look like the screen shot below.Pv_MSG_PLC5Read' parameter. 54 of 128 .

NOTE: Station_2 will operate exactly like Station_1. If prompted to save the file respond with No. a) This workflow can also be performed online with the controller in Run mode! 44. only using different I/O and tags. You can now see the advantage of the POI window. 43. Close Studio 5000 Logix Designer. a) This workflow can also be completed while online with the controller in Run mode! Congratulations! You have just finished this Lab Click to Proceed to Contents 55 of 128 . 45. PIO logic import highlights the tag change capabilities that can be performed before code is added into your application. You can quickly change tags while importing a program or routine.

Data sharing between Programs can be achieved either through pre- defined connections between parameters or directly through a special notation.e.Lab 5: Introduction to Program Parameters <40 minutes> Since applications often consist of many code modules. their values cannot change from external sources during the execution of the program when connected to Output or Public parameters.  Input parameters: an Input parameter defines the data that is passed by value into the executing program. Programs. they can be linked to other modules using Connections. We will cover existing and new methods. Once a code module’s inputs and outputs have been defined. An InOut parameter must be bound to exactly one target including Input and Public parameters as well as Controller scope tags. you will learn how connections are made between code modules (Programs). An Input parameter supports a maximum of one connection or InOut binding. HMI external access can be specified on individual basis for each parameter. Unlike local tags. In this section. Program Parameter types: Program parameters define a data interface for Programs. without the use of controller scoped tags. Because Output parameters are always passed by value. This feature allows the user to configure program-to-program connections. You will be using an existing program in an effort to conserve time. their values cannot change outside of the execution of the Program nor can they be changed from other programs. all program parameters are publically accessible outside of the program. and special usage parameters. Code Modules are linked together using clearly defined “inputs” and “outputs” that are required for a module to complete its task. This interaction is often referred to as the Linking Layer. These features are designed to provide a design environment that enables users to fully implement modular programming methodologies. Prior to version 24. Within the Logix environment. Version 24 introduces a feature called Program Parameters. This section will provide an introduction to several powerful features in version 24 of Studio 5000™ Logix Designer.  Public parameters: a Public parameter defines the data that is passed by value into a program or is produced by the executing program. each module must have a means of interacting with other modules or devices. and AOIs. Because Input parameters are passed by value. i. Output parameters can be connected to one or several Input and Public parameters or Controller scope tags. Execution varies depending on the type of container used. Some restrictions apply when binding an InOut to an Output parameter. We will primarily focus on how to create and connect Program Parameters (New in version 24). users were forced to use controller scoped tags for the linking layer. which are InOut and Public. which are Input and Output. 56 of 128 . A Public parameter accepts several connections or InOut bindings (with the exception of Controller scope tags) and can function as a data concentrator or shared memory between programs.  InOut parameters: an InOut parameter represents a reference to data that can be used both as input and output during the execution of a program. users can implement modular design techniques in a number of ways including the use of Routines. Additionally. The ability to define program-to- program interfaces adds an additional level of Encapsulation for an improved modular programming environment. if the application was segregated using programs.  Output parameters: an Output parameter defines the data that is produced as a direct result of executing the program. Because InOut parameters are always passed by reference. There are two types of parameters for Programs: standard parameters. scheduled (Programs) versus called (AOI’s and Routines). their values can change from external sources during the execution of the program.

you will be setting up several connections to Input parameters. The example application contains three code modules (Pump. Double-Click on the Lab Files folder on the desktop. Once the project has opened.Lab 5. maximize Studio 5000. This was done to conserve time. Navigate to the link below and double-click the project named Sample_Project_Start. Additionally. The code module interface has been defined and parameters are already created. This change was required to reflect the addition of Program Parameters. In the Controller Organizer.1: Input Parameters This section will cover Input parameters.Studio 5000 and Logix Advanced Lab\ Lab 3 Introduction to Program Parameters 3. the naming convention used for Programs in version 24 now matches the naming convention used for Add-On Instructions (AOIs). 2. Goals: Create an Input Parameter Configure a connection Understand when an Input connection can be used 1. 4. and Auto_Cycle).ACD to open it in Logix Designer. Tank. 57 of 128 . Double-click the Parameters and Local Tags NOTE: You will notice that Program Tags are now Parameters and Local Tags. In this section. expand the Pump1 Program. You can find the project in this directory: C:\Lab Files\ L19 .

do so now by clicking on the “+” symbol. 6. The steps below will walk you through creating a connection.5. connecting an Output parameter to an Input parameter will ensure that data is copied from the Output parameter to the Input on every scan. The screen shot above indicates that this input parameter has no connections. NOTE: A Parameter must be “connected” to another Parameter or Controller Tag. You may need to expand the name column. Locate the tag properties window on the right side of the screen. This is can be done by pressing the gray button to the left of the tag name. For example. Highlight the tag Inp_DrainPumpPB. If Parameter Connections is not expanded. 58 of 128 .

Click in the box that says ‘New Connection’.7. This input parameter is for the Drain Pump Pushbutton input. It will be connected to the physical input point in the Controller Tags. Locate and expand Local:2:I. 9. press the gray button on the right. Once you click in the box. Press the drop down arrow when the tag selection pop-up appears. 8. 59 of 128 . We will explore some of them as we progress through the lab. 10. NOTE: There are many ways to filter or search through tags on this screen. Take a moment to familiarize yourself with the many options.

Data. Press the OK button. We need to create one more Input connection. This also applies to connections that are configured to bits in a SINT. Once you select Bit 2. Highlight Local:2:I. Click on the Edit Tags tab for the Pump1 Parameters and Local Tags. In this case. Let’s create this connection using a different method. In this application. The number on the left between the brackets indicates the number of connections to the parent tag. 14. This can conserve time. then any connection to a member of the tag will be reflected in the number on the right. NOTE: Notice how the {0:0} next to Parameter Connections changed to {1:0}. but may become cumbersome as tag names grow in length and complexity. NOTE: If you know the exact tag name. 12. 60 of 128 . Press the drop down arrow that appears to the right of the highlighted tag. 15. the tag selection screen should look like the screen shot below. INT or DINT.Data. the parent tag is Inp_DrainPumpPB. 13. This indicates that it is used in logic somewhere in the application. you can manually enter the text in step 7. bit 4 corresponds to the input point for the Auto / Manual mode selection for Tank 1. The number on the right indicates the number of connections to members of the parent tag. NOTE: The drop down allows us to select the individual bits in Local:1:I. Select Bit 2. NOTE: Notice how bit 4 is gray. For example. if the parent tag was a User- Defined data type.11.

18. Click on the ellipses button (button w/ three dots) to open the Connection Configuration Dialog Box. This button will display the Connection Configuration screen. You may have to scroll to the right to see the Connection column. By default. You can also just type the name of the connection tag into the connection box. We are going to configure this connection through the Connection Configuration Screen. the Connection column is not displayed. This will display the tag selection pop-up. Select Toggle Column and then select Connection. If only one connection exists or is desired. the Connection column should be visible. Right-click on one of the column headers. After completing step 16. Click in the Connection box for this tag. you can click the drop down arrow. This window would be required if more than one connection exists or must be configured. Locate the tag Inp_FillPumpPB. 17. Right-Click on column header Select Toggle Column Select Connection NOTE: The user can customize the tag database columns. NOTE: At this point.16. you can click the gray button with the three dots. 61 of 128 .

Click on the gray button on the right side of the name box. 62 of 128 . 20. you can either manually type the connection into the name box or you can use the tag selection pop-up. NOTE: From this screen. This example will use the pop-up.Data.[1] Select Bit 0 and press OK. 21.19. Click in the box under the name column that says New Connection. Navigate to Local:2:I.

• A program can write to its own input parameters. Verify that the Connection Configuration Dialog Box looks like the following screenshot. The same rule applies for User-Defined Structures. An error will occur if any additional connection is defined for Input1 at the DINT level. and InOut Parameters. • Input Parameter values are refreshed BEFORE each scan of a program. Output Parameters. 23.22. For example. lets assume you have a DINT input parameter in Program A named Input1. there may be better options available and they will be discussed later in the lab. Lets also assume that Program B has a BOOL output parameter named Output1 that is connected to bit 0 of Input1 in Program A. This makes input parameters a great option for connecting input card data to a code module or object. It also is a good option for code module or object commands that are point-to-point. Click OK to close the Connection Configuration Dialog Box. If multiple code modules or objects must have access to the command. The values will not change during the logic execution. Additional Information – Input Parameters When to use Input Parameters Input Parameters can be connected to Controller Scoped tags. Input Parameter General Information • Input parameters (including members) can only support ONE connection. 63 of 128 . Public Parameters. Users will no longer have to write code to buffer inputs if they don’t want them to change during program execution.

The example application contains three code modules (Pump. Do not worry about the Red “X” next to Pv_MSG_PLC5Read. In the Controller Organizer. This was done to conserve time. In this section we will use the Parameters Tab in the Program Properties window. NOTE: The Parameters tab is new with version 24. right-click on the Tank1 Program and select Properties. Select the Parameters Tab. NOTE: There are several ways to configure connections. and Auto_Cycle). 2. In this section. 64 of 128 . We will discuss this later in the lab. Both methods are available and can be used based on user preference.Lab 5. In the previous section. you will be setting up several connections to Output parameters. Goals: Create an Output Parameter Configure a connection Understand when an Output connection can be used 1. The code module interface has been defined and parameters are already created.2: Output Parameters This section will cover Output parameters. we used the Tag Properties window. Tank. This gives the user another way to see and configure parameters and connections.

type the following: Pump_Speed_Output NOTE: If a Red “X” appears next to this connection. 5. DO NOT click on the graphic. 6. an output parameter must also be configured for both the Drain and Fill pumps in the Auto_Cycle module.3. In the Connections Window. Since the Auto_Cycle module must be connected to the Pump module. The Pump code module has been configured to have a public run command for both the Drain and Fill pumps. Click in the name box for Out_VoltMeter. We will be configuring these connections as well as explore some of the filter / search mechanisms throughout the next several steps. expand the Auto_Cycle1 Program. the Auto_Cycle code module must be able to command the Drain and Fill pumps to run. NOTE: If you press the button next to the parameter name. Click OK to close the Program Properties window. 4. it’s possible you typed the number “0” instead of the letter “O”. You will have to press the home icon (house) to return to the normal view. it will allow you to view the tag parameters members (bits). The Connections Window allows you to view and / or modify connections for a selected parameter. See the note below for more details. For this application. Press Apply. In the Controller Organizer. 65 of 128 . in the Name box that reads New Connection.

Highlight the parameter Out_DrainPump. 10. 9. expand Parameter Connections. In the tag properties window. 11. press the gray button on the right. Click in the box that says ‘New Connection’.7. 8. Once you click in the box. 66 of 128 . The next two connections will be connections between two programs. Double-click the Parameters and Local Tags So far. Press the drop down arrow when the tag selection pop-up appears. all connections that have been configured have been to Controller Tags (I/O).

Remove the checkbox on “Show Controller Tags” 13. select Pump1. Double-click on \Pump1. 15. You are only viewing the Pump1 parameters that can be connected to the Output parameter. 67 of 128 . You may have to expand the name column to see the entire parameter name. All local tags and parameters that would make invalid connections are not visible.12. In the “Show Parameters from other Program” dropdown. NOTE: Your window should appear like the screen shot above. Remove the checkbox on “Show Program Tags” 14.Cmd_PublicDrain.

NOTE: This can be a quick way to narrow down the parameters. Press OK. 18. 17. 22. 21. Once you click in the box. 23. Double-click on \Pump1. You may have to expand the name column to see the entire parameter name. In the upper left corner of the parameter selection pop-up.16. 19. Press OK. expand Parameter Connections. Click in the box that says ‘New Connection’. 68 of 128 . Press the drop down arrow when the tag selection pop-up appears. press the gray button on the right. enter “PublicFill”. 20.Cmd_PublicFill. Highlight the parameter Out_FillPump. In the tag properties window. especially if you know some key words in the tag name.

InOut parameters will be discussed in the next section. This would be a good technique for configuring a code module to monitor the output value of a different code module. etc) in other code modules or objects. settings. This makes output parameters a great option for connecting a code module or object to an output card. lets assume you have a BOOL input parameter in Program A and Program B named Input1a and Input1b. It also is a good option for configuring a code module or object to invoke operations (commands.Additional Information – Output Parameters When to use Output Parameters Output Parameters can be connected to Controller Scoped tags. and Public Parameters. Input Parameters. You are allowed to connect a single output parameter in Program C to Input1a AND Input1b. • An Output parameter can ONLY be connected to an InOut parameter if both the Output and InOut parameters are configured as Constants. This is prohibited when the InOut and Output parameters are configured as Constants which means the value cannot be changed by logic. As stated earlier. which functions similarly to alias tags. This allows one code module or object to send multiple commands to multiple modules or objects using one output parameter. Output Parameter General Information • Output parameters (including members) can support multiple connections. 69 of 128 . • Output Parameter values are refreshed AFTER each scan of a program. the InOut parameter is merely a pointer to the original tag. The primary reason for this requirement is InOut parameters are passed by reference. For example. values written to the InOut parameter would overwrite the value in the Output parameter. This is often referred to as “fanning”. this is often referred to as “fanning”. If a non-constant InOut parameter could be connected to a non-constant Output parameter. Updated output parameter values will NOT be available to the parameters connected to that output parameter until the program execution is complete. In other words. multiple connections can be configured for an output parameter. Additionally.

expand the Tank1 Program. 70 of 128 . In this section. This was done to conserve time. That PLC5 has several inputs that gather leak detection status of the tank area. The code module interface has been defined and parameters are already created. The example application contains three code modules (Pump. and Auto_Cycle). In the Controller Organizer. Message instructions must reside in the Controller Tags. Double-click the Parameters and Local Tags Let’s assume this system has a PLC5 that is running remotely at the tank location. you will be setting up several connections to InOut parameters. which indicates an error. Tank. This tag should have the Red “X”. The following steps in this section will walk you through the process of connecting a Message instruction to a program InOut parameter.Lab 5. Highlight Pv_MSG_PLC5Read. This provides an extra layer of encapsulation. 3. An InOut parameter can be used to connect directly to the Message instruction at the Controller scope. Goals: Create an InOut Parameter Configure a connection Understand when an InOut connection can be used 1.3: InOut Parameters This section will cover InOut parameters. This application will retrieve the leak detection status from the PLC5 using a PLC5 Word Read MSG instruction. 2.

Since Message instruction source and destination tags must also be at the controller scope. Remove the checkbox on “Show Tank1 Tags”. 71 of 128 . Click in the box that says ‘New Connection’ in the tag properties window. select <none>.4. 7. 6. we created an additional parameter to connect to the result (destination) of the Message instruction. 5. If you look in the Parameters and Local Tags for Tank1. Note: This checkbox maybe labeled as “Show Program Tags”. Scroll down in the list and double-click the MSG_PLC5_Read Controller Tag. you will also see an input parameter named Inp_LeakDetectionPLC5. 8. Press OK. Press the drop down arrow when the tag selection pop-up appears. 10. In the “Show Parameters from other Program” dropdown. Once you click in the box. press the gray button on the right. instead of “Show Tank1 Tags”. 9.

You cannot configure connections to any member of an InOut parameter. Input Parameters. This will ensure that the higher priority task is using the most up-to-date value of a tag. it is possible that the InOut parameter values could change during the execution of a program. which means they simply point to the base tag. If the higher priority task is referencing data in the lower priority task. and Output Parameters (Constants). InOut Parameter General Information • InOut parameters can only support ONE connection. • An InOut parameter can ONLY be connected to an Output parameter if both the Output and InOut parameters are configured as Constants. Depending on your task structure. • InOut parameters are passed by REFERENCE. the InOut parameter will allow the higher priority task to point directly to a tag’s value in the lower priority task. unless using the Partial Import Online (PIO). In this scenario. See the tool tip for Output Parameters for a more detailed explaination. A prime example would be MSG instructions. this behavior may be necessary. the current value of the parameter connected to the InOut Parameter will be used. With that in mind. • InOut parameters CANNOT be changed online. Public Parameters. they are merely a pointer to the original data and closely resemble the behavior of an alias tag. InOut parameters are especially unique because they pass by reference rather than by value. when an InOut parameter is used in logic. In other words.Additional Information – InOut Parameters When to use InOut Parameters InOut Parameters can be connected to Controller Scoped tags. InOut parameters would allow a program to connect directly to the MSG instruction tags in the controller scope. Another useful scenario where InOut parameters would be required is the use of instructions whose tags can only be placed at the controller scope. a lower priority task will be interrupted by a higher priority task. One example of a structure that could potentially take advantage of InOut parameters is an application that contains multiple tasks with different priority assignments. 72 of 128 . In other words.

and Auto_Cycle). Click on the Edit Tags tab of the Parameters and Local Tags. The Pump program has an input parameter configured to connect to the Auto Mode status public parameter in Auto_Cycle. Select the drop down arrow and select Public Parameter. 5. 4. This was done to conserve time. We will be configuring this connection in the next several steps. 73 of 128 . In this section. NOTE: This tag was originally configured as a Local Tag. In the Controller Organizer. Expand the Parameter Connections in the tag properties window.4: Public Parameters This section will cover Public parameters.Lab 5. The example application contains three code modules (Pump. you will be setting up several connections to Public parameters. It can easily be converted to a public parameter so other programs can get access. Double-click the Parameters and Local Tags 3. expand the Auto_Cycle1 Program. 2. Goals: Create a Public Parameter Configure a connection Understand when a Public connection can be used 1. Tank. Click inside the usage box for Sts_AutoMode. The code module interface has been defined and parameters are already created.

7.Inp_AutoMode and complete the connection. Select the drop down arrow and select Public Parameter. 12. Click inside the usage box for Sts_ManualMode. Press the drop down arrow when the tag selection pop-up appears. press the gray button on the right. Click in the New Connection Box Click on the “…” Button Click the drop-down arrow and select the connection tag 74 of 128 . Expand the Parameter Connections in the tag properties window. Use the search / filter options to find \Pump1. Configure a connection from Sts_ManualMode to \Pump1. 8. Once you click in the box.6. Set Show Parameters from other Programs to Pump1. 9. 11. 10. Click in the box that says ‘New Connection’ in the tag properties window.Inp_ManualMode.

In this example. NOTE: Let’s do a quick review of what we discussed earlier in the lab. that would mean there are two connections to one or more of the 16 bits (INT data type) of Val_LeakDetection. Select Toggle Column and then select Connection. You may have to expand the width of the Connection column. 75 of 128 . Highlight Val_LeakDetection. Right-Click on column header Select Toggle Column Select Connection 14. Navigate (scroll right) to the Connection column. However. 16. which is Val_LeakDetection. You can quickly identify the number of connections for the parameter and its members by looking at the numbers between the brackets. Right-click on one of the column headers. Logix Designer version 24 software will allow you to view all of the connections to a given parameter in the parameters tab of the program properties. 2 connections are made to one or more members of the parent parameter. Look at the Parameter Connections for this tag in the Properties window. Navigate to the Parameters and Local Tags of the Tank1 Program. The example above indicates that 0 connections are made to the parent parameter.13. The two connections you just created should look like the following screen shot. We will also observe how to quickly identify how many total connections are configured for a parameter. 15. The remaining steps will demonstrate how to connect to members of a parameter.

Val_LeakDetection. 25. Highlight Val_LeakDetection. 23. 21. Mouse over the connection box for the Val_LeakDetection Public Parameter. Navigate to the Parameters and Local Tags of the Tank1 Program. 18. Define this connection to \Tank1. Let’s create another connection to a member of the Val_LeakDetection parameter. 22. Navigate to the Parameters and Local Tags of the Tank1 Program. Look at the Parameter Connections for this tag in the Properties window.0 19. 24. Navigate to the Parameters and Local Tags of the Auto_Cycle1 Program. You may have to configure the Connection column to be visible. 26. Note how the {0:2} changed to {0:3}. Highlight Val_LeakDetection. 76 of 128 . Define this connection to \Tank1.Val_LeakDetection. Navigate to the Parameters and Local Tags of the Pump1 Program. Create a connection for Inp_LeakStatusWord. Note how the {0:3} changed to {1:3}.17. 20. Look at the Parameter Connections for this tag in the Properties window. The Connection column in the Parameters and Local Tags window will display the same information. Create a connection for Inp_PumpAreaLeak. The popup will show you all of the connections that are configured for a given parameter.

if the command is configured as a Public parameter. so higher priority tasks that interrupt a program during execution will have access to any updated values in the lower priority task. The public parameter will contain the real-time value of the controller scope tag. when a Public parameter value updates. it is immediately available to any higher priorty tasks that are connected to that parameter. Public parameters are updated as the source updates. A possible scenario where this would be useful would be if a code module or object could receive a command from many modules or objects. then all 10 code modules or objects could have an output connected to a single Public parameter. In other words. but an individual input parameter would be required for each connection. Public Parameter General Information • Public parameters can support MULTIPLE connections. Output Parameters. • Public parameters are updated when the source is updated. The key benefit to using Public parameters over controller scoped tags is better encapsulation.Additional Information – Public Parameters When to use Public Parameters Public Parameters can be connected to Input Parameters. • Public parameters can be aliased to Controller Scope Tags. if a code module or object had a command that could be invoked by 10 different code modules or objects then 10 input parameters would be required. This includes User-Defined Structures. 77 of 128 . it is important to remember that the alias update will be asynchronous to program execution. Additionally. However. If a code module or object contains data that must be globally available to other code modules. Input parameters could be used. but at the program level. Public parameters have the look and feel of controller scoped tags. In other words. and InOut Parameters. “fanning” is supported with Public Parameters. If this functionality is desired. then a Public parameter would be an excellent option. You can configure connections to the base Public parameter or any member of a Public parameter.

higher priority tasks will be using parameter values that are up-to-date. Program B could reference the Tank_Level parameter in logic without creating a corresponding parameter to connect to Program A. values will be updated when the program that contains the output parameter completes execution.Lab 5. • Using Direct Access of input parameters is a good way to circumvent the “one connection” limit for input parameters. Rung 2 should have an XIO instruction that is not tied to a tag. If you create an input but do not configure any connections for that input. NOTE: We want to make sure that we turn the Fill Pump off when the Tank is full. Goals: Configure logic to use direct access Understand how direct access behaves in logic What is Direct Access? Direct access allows the user to reference another programs parameters in logic without configuring parameters in the local program. Navigate to the MainRoutine of the Auto_Cycle1 Program. and Public parameters can all be directly accessed. you can directly reference it from multiple programs. 78 of 128 . 27. When direct access is implemented on Input and Public parameters. You will be configuring logic and directly accessing several program parameters. the values of the referenced parameters are updated in real time. minimizing the risk of performing actions on stale data.5: Direct Access of Program Parameters This section will cover the direct access of Program Parameters. 28. Output. Direct Access General Information • Program local tags CANNOT be accessed using direct access • Input. We can use direct reference to acquire the value of the tank full status. When direct access is implemented on Output parameters. Double-click the “?” above this instruction. if Program A had an output parameter called Tank_Level. For example. The Auto_Cycle1 program can directly access the value of the Sts_TankFull parameter in the Tank program without creating a physical connection. When directly referencing Input and Public parameters.

Let’s download the program to the controller and see how the program operates. 33. Rung 3 should have an XIO instruction that is not tied to a tag. NOTE: The Drain Pump will now shut off when the tank is empty. Verify the Controller.Sts_TankEmpty. close the Who Active window and reopen the Who Active window before you can continue. Expand AB_VBP-1 Note: If you see a Red X on the Virtual Chassis you may have shutdown RSLogix 5000 Emulator. NOTE: No Errors or Warnings should be present. 79 of 128 . 32. 31. NOTE: RSLinx may take a few moments to open.29. Click on Communications => Who Active at the top of the screen. 34. If the Error window is not visible. NOTE: The Fill Pump will now shut off when the tank is full. You will need to restart RSLogix 5000 Emulator. Use the filters to find and select \Tank1. press Alt+1. Press the drop-down arrow. Press the drop-down arrow. 30. Double-click the “?” above this instruction. Use the filters to find and select \Tank1.Sts_TankFull.

Press Download. 43. This set the system to Auto mode (Local:2:I. press Download. When the 1789-SIM output at 00 is ON. Make sure the 1789-SIM Input 04 is toggled ON. Select Properties 41. Click Yes.04 ON). 37. 40. Monitor the 1789-SIM inputs and outputs. You click on the Input number to toggle its value between on and off. When the 1789-SIM output 02 is ON. Double Click on the RSLogix Emulate 5000 Chassis Monitor icon on the desktop to open it. RSLogix 5000 Emulator.Data[1]. Right Click on the 1789-SIM module in Slot 2. the Fill Pump is ON.Digital Inputs: 80 of 128 . When prompted to change the controller back to Remote Run. Open the I/O Data Tab Note: When the input or output is ON it will have a yellow highlight. the Drain Pump is ON.35. You do not need to expand the controller. a) Lab I/O . When prompted. 44. Select 01. 39. 36. 38. 42.

000.Data[1]. Set the Controller Scope tag Pump_Speed_Command to a value of 10. 46.00 Station 1 Fill Pump Run PB ii) Local:2:I. NOTE: You should notice that 1789-SIM output 00 will turn on and the value of Tank1 local tag Val_TankLevel will being to increase. This will manually turn the drain pump ON. NOTE: The rate at which the tank is filling and draining should have increased. A high value simulates a higher pump speed. When the tank is full. This will turn off the Pump Fill PB. NOTE: You should notice that 1789-SIM output 00 will turn ON and Val_TankLevel will being to decrease.00 Station 1 Fill Pump Run ii) Local:2:O. 48. Toggle 1789-SIM input 02 to ON. Toggle 1789-SIM input 00 to ON. This value simulates the pump speed. In Studio 5000 Logix Designer Controller Tags. Monitor the Tank1 local tag Val_TankLevel.02 Station 1 Drain Pump Run 45. you must manually operate the fill and drain pumps.Data. This will put the system into Manual Mode.04 Station 1 Auto Cycle Mode Switch (1=Auto) b) Lab I/O .Data[1].Digital Outputs: i) Local:2:O.Data. Toggle 1789-SIM input 04 to OFF. i) Local:2:I. 1789-SIM output 00 will turn off even if 1789-SIM input 00 is on. This will manually turn the fill pump ON. NOTE: You should notice the tank slowly filling and draining. 81 of 128 . Set the Controller Scope tag Pump_Speed_Command to a value of 25. 47. Values are from 0-32. The tank will continue to fill until Val_TankLevel is >= Val_TankCapacity. Monitor 1789-SIM output 00 for Tank Filling and output 02 for Tank Draining. 51. 50.02 Station 1 Drain Pump Run PB iii) Local:2:I. this tag will display the level of the tank. When the tank is empty 1789-SIM output 00 will turn off even if 1789-SIM input 00 is on.767.Data[1].000. Toggle 1789-SIM input 00 to OFF. NOTE: Since the system is now in manual mode. 49.

Close Studio 5000 Logix Designer. Go Offline with the controller. Congratulations! You have just finished this Lab Click to Proceed to Contents 82 of 128 . 46.24. If prompted to save the file respond with No.

for example. you will:  Create a reusable UDT with a specific purpose in mind (a conveyor)  Reuse this UDT to quickly and easily create multiple conveyors  Instantiate the UDT to a specific conveyor Instantiate definition: To create such an instance by. What You Will Accomplish in this Section of the Lab As you complete the exercises in this section of the lab. saving a great deal of design time and enforcing a high level of standardization. it becomes apparent that there will be certain “constructs” which will need to be instantiated repeatedly. that means create something reusable but each new use of it gets configured with specific values unique to that use. giving it a name. During typical system design. We will be able to define this conveyor once as a User-Defined Data Type (UDT) and then use this Data Type repeatedly as required. defining one particular variation of object within a class. In layman's terms. Go to the desktop and launch Studio 5000 using the Studio 5000 icon. We will look at the case where there will be a number of conveyors installed into the system where each conveyor will have roughly the same data associated with it. and locating it in some physical place. Note that you are running in a VM Ware environment and it will take a few moments to launch Studio 5000. Follow the steps below to complete the Lab 1. you will create a User-Defined Data Type for a generic Conveyor.Lab 6: User-Defined Data Types. UDT <10 Minutes> About this Lab In this section of the lab. 83 of 128 .

Note that you are running in a VM Ware environment and it will take a few moments to open this project.2. On the following screen Select Open Existing Project. There is a shortcut on the desktop to the Lab Files folder. 3.Studio 5000 and Logix Advanced Lab\ Lab 6 Using User Defined Datatypes directory and open the Advanced_Base. In the Open Project window. 84 of 128 .ACD file. Browse to the C:\Lab Files\ L19 .

Notice the folders listed below the Data Types folder in the Controller Organizer In the User-Defined folder you will find any data structure created by the programmer. 4. The String folder holds character type data In the Add-On-Defined folder you will find any tags associated with any Add-On-Instructions In the Predefined folder you will find a long list of Atomic and predefined data types In the Module-Defined folder you will find all of the data types associated with any modules added into the I/O tree. 85 of 128 .

5. Right Click on the User-Defined Folder and select New Data Type...

6. Name the new UDT 'Conveyor'

7. From discussions with your engineering department you have been told that the conveyor UDT needs the
following elements.
 Start_PB  BOOL
 Stop_PB  BOOL
 Speed_Ref  REAL

86 of 128

8. Add a description to your new Conveyor UDT (optional).

9. We will now begin adding new members to build our conveyor UDT. Click on Add Member. It will change to
a white space and we can now type the name of our first member Start_PB.

10. Double Click in the Data Type column next to the name Start_PB that we just entered. Type BOOL for
Boolean data type. Select Apply. You could have also clicked on the ellipses and found the BOOL data
type by scrolling to it.

87 of 128

11. Your UDT should now look as shown below.

12. In a similar manner continue adding new elements of the correct data type until your UDT looks as shown
below. Click Add Member... Fill in the correct name... Select the correct Data Type. Add the optional
Description as shown. Select Apply when finished, then Select OK.

Note: Descriptions are optional.

88 of 128

Some important words on UDTs We grouped all of the BOOLs (each takes up a single bit in memory)
together followed by various DINTs and REALs (DINTS and REALs take up 32 bits of memory each). This is
not required but is more memory efficient. This particular UDT uses 8 bytes of memory. But if you were to
analyze it you might think that it should only need 5 bytes. There are 3 bytes of BOOLs that were allocated
but not displayed or used. Every time you create one non consecutive BOOL you are really creating 32
BOOLs total. That is why it is more memory efficient to group BOOLs together. Each instance of Data Type
'Conveyor' will use 8 bytes.
Some optional comments were added. These comments do not subtract from controller memory. You will
see later that the comments will be carried through as you create multiple instances of Data Type 'Conveyor'.
UDTs can be created and edited on-line but can only be edited off-line once an instance is created.
For more information on UDTs see publications 1756-RM094 and 1756-PM020.

13. In the Controller Organizer Expand the User-Defined Data type folder and you will see that the
new Conveyor type exists. This new data type is now available to be used multiple times
throughout our program.

14. So far we have designed a UDT to meet some specific goals of our application. This UDT can be used multiple times
throughout our program. It has been designed to meet certain goals dictated by our application. It is created from
various Atomic tags within the controller. We have saved our UDT, by saving it we have essentially created a new
ControlLogix predefined tag type. We will now create some new tags of data type Conveyor.

15. In the Controller organizer, Double Click on Controller Tags.

89 of 128

90 of 128 . The following window will appear. Scroll to the bottom of the screen and Click on the white space at the bottom in the Name column. Be sure the Edit Tags tab is selected.16. Type Conveyor_1.

18. Click the white space. Scroll to the Conveyor data type or begin typing Conveyor (the Auto Complete function will find Conveyor after the first few characters). then on the Ellipses. by default the data type is DINT. 91 of 128 .17. Note: A windows will popup warning you that data will be truncated or lost. Select OK. Then Hit the Enter Key. Move the mouse to the Data Type column in the Conveyor_1 row. Press OK. This will bring up the Select Data Type dialog.

Close the Tag Browser window 92 of 128 . After creating a new Data Type. Observe that all of the elements of our previously created data type Conveyor have been created with our new Conveyor_1 tag. Notice also that the comments we added into the original UDT have come along as well. Commented UDTs While the comments we typed when we created our UDT did come forward. If you desire you could create multiple instances each with a unique name or even an array of Conveyor data types. of type conveyor you can type over the Descriptions in the "Child" if desired. So far we have created a single instance of the Conveyor UDT. notice that they are a light grey. This means that the "Parent" Data Type Conveyor had comments and they were brought forward. 19. Expand the + next to the newly created Conveyor_1 tag.

We could Instantiate multiple instances of the Class Conveyor by creating multiple Objects each with a unique name. Reusable code can be a great way to increase productivity.N Class Instantiation Object 93 of 128 . This data type consisted of members that had nomenclature specific to operational tasks of a generic conveyor. a safety gate etc.. Reusable Code can be a valuable tool to increase productivity and decrease engineering development time. In Object Oriented Design terms when we created the new data type Conveyor we created a Class. We can take this one step further. Now think about a machine or a system that would have a conveyor. while leveraging existing work. one object for each conveyor on our machine. The OEM programmer could spend a lot of time developing a UDT and some associated ladder code to go with it that could be stored for future use on multiple machines. let’s say a packaging machine. a pump. because a packaging machine would tend to have 1 or more conveyors on it. you could develop a UDT and associated ladder code for each of these machine parts. on it.. let us say that we work for an OEM who builds packaging machines. We then Instantiated an Object called Conveyor_1. 20. Study the diagram below to get a base understanding of our accomplishments UDT Conveyor_1 New Data Type Conveyor Conveyor IN_Feed_Conveyor HMI_Start_BP Packaging_Conveyor Individual Instances Members of of Data Conveyor Type Percent_Scrap Conveyor Conveyor. Now think about these few tasks from a larger machine perspective. By creating this UDT we have created a reusable piece of code that can help us build new machines in a more productive manner. Now that we have created this UDT called Conveyor_1 what does this all mean? First we created a new Data type called Conveyor. Using our new UDT we can now more easily create multiple conveyors for our packaging machine. We then created a tag called Conveyor_1 of data type Conveyor. In our example we could develop code for a simple conveyor. While a UDT is not a direct corollary to Object Oriented Design it is very similar.

A warning screen will pop-up acknowledging that a tag and uses the Conveyor UDT will be changed. Press Yes.Adding a Tag Member to a UDT In this section we will add a new tag member to the Conveyor UDT that we just created. Click on OK when complete. Add a new member call Part_Count with a Data Type of DINT. Open the Data Types User-Defined folder in the Controller Organizer and Double Click on the Conveyor UDT. 21. 94 of 128 . 23. 22.

25. In the Controller organizer. 95 of 128 .24. Double Click on Controller Tags. Expand the + next to the Conveyor_1 tag. Observe that are new Part_Count member has been added to our Conveyor_1 tag.

Press OK 96 of 128 . Note: Start typing in the space shown below inside of the red box. In the Controller organizer. Select the Conveyor UDT for the Data Type with a Dim 0 of 25. The following window will appear. 28. 27. Double Click on Controller Tags. Type Conveyor. Scroll to the bottom of the screen and Click on the white space at the bottom in the Name column. Once you begin type a new row will be added for the new tag. Be sure the Edit Tags tab is selected.Create an Array Tag with a UDT In this section we will add a new array tag to the Controller Scope tags with the Conveyor UDT that we just created and modified. 26.

The New Conveyor tag is shown below. 30. Conveyor[2] tag. 31. Conveyor[3] tag. Each Conveyor array index could point to an actual conveyor used in a system. Change the tag display view tab to Monitor Tags. Observe that the Conveyor UDT is used for each array index of the new Conveyor tag. Close Studio 5000 Logix Designer 97 of 128 . Expand the + next to the Conveyor[1] tag.29. This is a very powerful tool to create multiple conveyor instances very quickly in Studio 5000 Logix Design. Comments in Studio 5000 Logix Designer and/or an alias tags could be used to give the array tags for each index a more descriptive name. 32. etc. Expand the + next to the Conveyor tag.

We have learned:  Some basic principles of the tag structure of a Logix controller.Lab Summary To be truly effective our new UDT would need some associated ladder code to go with it. AOIs will be discussed in greater detail in the next Lab. In following reusable code principles this code would be developed and saved for use in conjunction with our UDT. Congratulations! You have just finished this Lab Click to Proceed to Contents 98 of 128 .  Laid a foundation for the concept of reusable code. In the spirit of reusable code this ladder code could be placed in an Add-On Instruction (AOI). The ladder code specific to our conveyor will not be covered here. This UDT and ladder code would be capable of being used on our current machine and all future machines.  How self-descriptive nomenclature can help us more quickly and easily develop a program.

Custom help for your instructions makes it easier for users to have a successful application of the Add-On Instruction.Lab 7: Add-On Instructions (AOI) <25 minutes> About This Lab Version 16 of RSLogix5000 Logix introduced the concept of reusable code objects called Add-On Instructions(AOI). Finally. Once created. regardless of who is implementing the project. you can use the Add-On Instruction’s source protection capability to prevent unwanted changes to your instruction and/or to protect your intellectual property. Online troubleshooting of your Add-On Instructions is simplified by the provision of context views which allow you to visualize the logic for your instruction for a specific instance of its use. We will then use the Add-On instruction in another project to show how much time you can save with them. In this lab we will take all of the conveyor code we were using in the previous lab and encapsulate it within a single Add-On instruction. an Add-On Instruction may then be used in any of the Studio 5000 Logix Designer editors without any additional effort on your part. Function Block Diagram. This saves you time by allowing you to easily re-use sets of your commonly used instructions in your projects and promotes project consistency because commonly used algorithms will all work in the same manner. and Structured Text editors already available in Studio 5000 Logix Designer. Add-On Instructions allow you to encapsulate your most commonly used logic as sets of reusable instructions. Add-On Instructions may be created using the standard Ladder. In this lab you will:  Get an overview of AOI Basics  Create an AOI  Use an AOI  Apply signature to an AOI  Export / Import AOI with a signature 99 of 128 . similar to the built-in instructions already in the Logix controllers.

100 of 128 . The revision is not automatically managed by the software. NOTE: InOut tag values are not displayed even when Required and Visible because they can be configured as arrays and displaying arrays can consume excessive amounts of space.AOI basics This section provides an overview of the basic parts of an Add-On Instruction and their uses 1. and vendor information is copied into the custom help for the instruction. You are responsible for defining how it is used and when it is updated. The Parameter order defines the order that the Parameters appear on the instruction call. Parameters The Parameters define the instruction interface. General Information The General tab contains the information from when you first created the instruction. You can use this tab to update the information. 2. revision. The description. how the instruction appears when used. revision note.

Local Tags Local Tags are hidden members private to the instruction. Local Tags are not visible outside the instruction and cannot be referenced by other programs or routines. 101 of 128 . The software orders the members of the data type that correspond to the Parameters in the order that the Parameters are defined. It is the code that executes whenever the instruction is called. Shown below is the interface of an Add-On Instruction and its primary Logic routine that defines what the instruction does. The software builds the associated data type. 5.3. Logic Routine The Logic routine of the Add-On Instruction defines the primary functionality of the instruction. Local Tags are added as hidden members. 4. Data Type Parameters and Local Tags are used to define the data type that is used when executing the instruction.

102 of 128 . The By: fields show who made the change based on the Windows user name at the time of the change. Change History The Change History tab displays the creation and latest edit information that is tracked by the software.6. Optional Scan Mode Routines 7.

8. Help The Name. you will open an existing program and create the AOI. and Parameter definitions are used to automatically build the Instruction help. Use the Extended Description Text to provide additional Help documentation for the Add-On Instruction.Studio 5000 and Logix Advanced Lab\ Lab 7 AddOn Instructions AOI folder. Creating an Add-On Instruction (AOI) In this section of the lab we will take one section of the conveyor code we worked with in the last lab and use it to create part of our AOI. From the Controller Organizer. 103 of 128 . Currently each conveyor code section is made up of one Program and four Routines.ACD using the File > Open menu browsing to C:\Lab Files\ L19 . The Instruction Help Preview shows how your instruction will appear in the various languages. In this section of the lab. based on Parameters defined as Required or Visible. Open CLX_S7_00. 10. Revision. 9. By using an AOI we can reduce all of this to one custom instruction that can be used anywhere in the application. expand the Conveyor program folder. Description.

12. Complete the ‘New Add-On Instruction’ dialog as follows: 13. 104 of 128 .11. Right click on the Add-On Instructions folder and select New Add-On Instruction… from the drop-down menu. Click OK button to accept.

14. The instruction definition should open.

15. Click on the Parameters tab to view the parameters for the instruction.

The ‘EnableIn’ and ‘EnableOut’ parameters are predefined and are added by default to each Add-On
Instruction. The ‘EnableIn’ is manipulated by factors unique to each language environment and can
be used for specialized functionality. This is an advanced topic and is beyond the scope of this lab.
The ‘EnableOut’ generally follows the state of the ‘EnableIn’ but can be manipulated by user
programming.

The Parameters tab is a tag database editor window for parameters specific to this Add-
On Instruction with the inclusion of definition specific fields: ‘Usage’ allows the user to
designate the parameter as:
‘Input’ An input to the instruction (atomic type)
‘Output’ An output from the instruction (atomic type)
‘InOut’ A parameter which is passed ‘by reference’ to the instruction (any data type
including UDTs, arrays, etc)

105 of 128

‘Default’ allows the user to specify a default value for the associated parameter. This is
the value the parameter assumes when the instance tag for an instruction call is first
created.
‘Req’ - A parameter which has been checked as ‘Required’ will force the user to enter a
tag or make a FB (Function Block) connection to this parameter when an instruction
instance is used in a routine. This modifier defines verification behavior in the languages
as will be seen later. A ‘Required’ parameter is also ‘Visible’ by default.
‘Vis’ - A parameter which has been checked as ‘Visible’ will be visible by default on the
instruction when it is used in a routine. Use of this modifier causes differing results
depending upon the data type and the language (LD, FB, ST, SFC) in which an
instruction instance is used.
‘Description’ field is important because any information used here will be ‘passed
through’ to any instruction instance of the user program. This ‘self-documents’ the
instruction for usage, units, etc.
We will be copying and pasting code from an existing routine for this lab but we need to
create some new tags first.

16. Enter the following tags on the Parameter tab. Note: Parameters are Input, Output, and InOut tags only. Local
tags are entered on a separate tab. Click on the Apply button to accept changes.

106 of 128

17. Click the Local Tags tab and enter the tags as shown.

18. Click Apply

19. Click on OK to close the dialog.

Entering the Logic
We are going to cheat and just copy the logic we already have. We could enter the logic from scratch but since this
is about saving development time we will do it the easy way.

20. From the Controller organizer locate the C_Start_Stop routine and double-click it to open it.

21. From the toolbar menu select Edit > Select All.
This will select all the rungs in the routine.

22. Right click on Rung 0 and select Copy Rung

23. Expand the Add-On Instructions folder if it is not already expanded in the Controller organizer.

24. Double click on Logic to open it.

25. Right click on the End rung and select Paste

107 of 128

In the next section we will open an existing program and begin working with a complete AOI. 28. 27. an Add-On instruction may then be used in any of the Studio 5000 Logix Designer editors without any additional effort on your part. Close the file within Studio 5000 Logix Designer using File > Close. Function Block Diagram. 108 of 128 . Note: Errors may occur if the tags were not typed in correctly in the definition of the AOI. All of the logic should now appear without any errors. Using the AOI in RLL (Ladder Logic) Add-On Instructions may be created using the standard Ladder. Expand the AOI until you can see the Logic and Parameters. Once created. 29. you will open an existing program and create the AOI. All three Routines that make up one conveyor have been combined into one custom instruction. We just created our first Add-On Instruction. 30.ACD using the File > Open menu browsing to C:\Lab Files\ L19 . Respond with No if prompted to save the file. Delete the empty rung. Open CLX_S8_00. In real life we probably would want to put all of the routines in it but we just wanted to show how to construct one. and Structured Text editors already available in Studio 5000 Logix Designer. This file has the completed Conveyor_Core AOI already done for you.26. That’s it.Studio 5000 and Logix Advanced Lab\ Lab 7 AddOn Instructions AOI folder. In this section of the lab. A complete working example is provided in the next step so don’t worry if errors exist at this point.

You should see all the logic that was in the three routines we used to have. 34. This will open the definition so you can see all the tags that are now part of the instructions definition. 33. 35. 109 of 128 . Click on the Logic button to open the logic. Right click on Conveyor_Core and select Open_Definition. 32. Click the Parameters tab. This will determine how the instruction looks and acts once we place it in an application. Notice which ones are marked REQ and VIS. Ten rungs total.31.

39. (We created this Routine already to save time) 37. Open Conveyor_1 routine for editing by expanding the Main Task and Conveyor program and then double clicking on the Conveyor_1 routine. 110 of 128 . AOI tag structure: At this point the instruction behaves like any other Studio 5000 Logix Designer instruction. 38. You should see a blank rung and a new Add-On menu choice. It has inputs and outputs that need to be defined and other parameters that need to be filled in – just like a Timer does.Let’s use it 36. Select the Add-On tab and then click the Conveyor button. This will add a Conveyor instruction to the rung.

Right click on the first question mark and select New Tag. These fields show the current values of those parameters. The parameters with a single question mark (?) after them require a tag name to be entered. The parameters with a double question mark (??) after them are tag value fields. 40. 41. Complete the New Tag dialog as shown Conveyor_Core 111 of 128 .

Double click on the Motor_Overload_Input question mark and maneuver down to pick input 0 as shown. The rest of the arguments are inputs. 45. Verify the routine by clicking on the Verify icon. This follows the same conventions as any other built in instruction in Logix. 44. 112 of 128 . 43. If this were a TON instruction. 42. the Data Type would be Timer. 46. Do the same for the rest of the inputs. until all of the question marks are gone. selecting sequential input points for each input in the instruction. Click Create to accept. This is what we named our AOI. We can assign some real I/O to these inputs the way we would for any other input arguments. Note: Data Type is Conveyor_Core.

The rung should match the image below: Alias tags referenced by AOI: We could have used Aliases here instead of I/O tags. This can make it easier to understand when looking at the addresses but is not necessary. Alias Tag Base Tag Let’s create an Alias address like the one shown 48. After you accept it you should see Question marks for the value because the entered tag name does not exist yet. 113 of 128 .47. Click on the Motor_Overload_Input address and type My_Motor_Overload.

49. Click Create to accept it. 51. Fill in the dialog as shown. The instruction should now have your Alias filled in. Right click on the new tag name and select New “My_Motor_Overload” 50. 114 of 128 . Make sure you fill in the Alias part as shown by using the pull down menu and selecting the correct I/O point.

Create a new Routine named Conveyor_2 by right clicking on the Conveyor Program and then selecting New Routine. Fill out the dialog as shown specifying Function Block as the Type and click OK button when you are finished. How do you know what the internal elements are named? The AOI follows the same conventions as any other instruction does.Using an Add-On Instruction Output in Ladder 52. 115 of 128 . Create the rung pictured below to demonstrate how to access non-visible tags from an AOI programmatically. 54. Tag Name Parameter Using the AOI in a Function Block (FB) Routine 53.

The data tag for the instruction Conveyor_Core_01 has already been created. The pins associated with parameters designated as Visible in the instruction definition are visible on the instruction by default. Double click on the new Conveyor_2 routine to open it. The Nub at the end of the input pin is an indication that this parameter requires a connection. Select the Add-On tab and click the Conveyor button. 116 of 128 . The Conveyor instruction will be added to the page. The instruction will not successfully verify until all “Required” parameters have connections. 56. This conforms to the behavior of any instruction created in the Function block environment.55.

You could use an Alias here just like we did for the RLL instruction. 59. 60. 58. Notice the is gone from the upper left corner. Select unused addresses for all the IREF’s as shown below for the required input points. Click the Input Reference (IREF) button six times as the AOI requires six inputs. Drag the IREF’s to align roughly with the nubs of the FB instruction on the sheet and wire them to the Motor_Overload_Input connectors. The instruction will now verify.57. 117 of 128 .

Open a second instance of Studio 5000 Logix Designer using the shortcut for Studio 5000 Logix Designer on the desktop or the button selecting Programs\Rockwell Software\Studio 5000 4. Storing your Instructions There are two ways to store and use a group of instruction definitions together. 118 of 128 . 3.ACD file) and then use Copy/Paste feature to use them Export them to an . (should be the file that you currently have open) 2. Keep them in a project file (. In this section we will also apply security to a routine and an AOI.Re-using an AOI Remember in the “Improving Efficiency Using Partial Import Online” lab how we saved time by copying and pasting or exporting and importing code? We can do the same things with AOI’s to save even more time or to simplify program design and re-use.ACD file. Begin a new file by selecting New Project from the Quick Start page.L5X file and then import them as you need them Copy and Paste 1. From the Controller organizer in our Conveyor application. right click on the Conveyor_Core AOI and select COPY. Continue working with CLX_S8_00.

Enter the Name AOI_LAB 6. Note: It will take a minute to create the new ACD file. Fill in the resulting dialog box as shown below: Use the latest version of Logix you can select 8. 119 of 128 . For this example we selected a 1756-L75.5. 7. Click Finish once complete. Click Next when finished. Select a Logix Controller.

but they will need to remove the Signature to edit the AOI logic or tags. Close this instance of Studio 5000 Logix Designer. 10.9. The AOI signature value can be monitored to record “version” of AOI that was created. Respond with No if prompted to save the file. This is fine if you are using your own AOI’s. AOI Signatures Copying and Pasting requires you to have two instances of Studio 5000 Logix Designer open at the same time. 11. How do you send someone else a copy of the AOI? What if you want to apply security to the AOI? Perhaps you want to know if another user has edited the AOI? AOI Signatures allows the application developer to monitor changes to an AOI. In this section of the lab we will:  Apply a Signature to the Conveyor_Core AOI  Export the AOI  Import the AOI in a new application 120 of 128 . From the Controller organizer right click on Add-On Instructions and pick Paste. The Conveyor_Core AOI should now be present and ready for our use in the new program. Users can view the logic and tag values inside AOIs with Signatures.

3. Click on Generate. 121 of 128 . Press Yes to confirm and generate the instruction signature. Continue using the CLX_S8_00. to generate a new Signature for this AOI. A warning message will be displayed.Applying Signatures 1. shown below. In the Controller Organizer.ACD file. Navigate to the Signature tab. Then we will import it into a new ACD file. 4. Before we export the Conveyor_Core AOI we will apply a signature to it. Double Click on the AOI to display it’s properties. 2. Navigate to the Conveyor_Core AOI.

5. so anyone can remove the Signature and change the AOI. The AOI signature will need to be removed before the AOI can be modified. But. the icon for the Conveyor_Core AOI has now changed since a Signature has been added. if a new AOI signature is created it will not match the original signature. Below is the AOI with the Signature. 122 of 128 . In the Controller Organizer. 6. The blue dot in the icon indicates that the AOI has a signature. Note: AOIs with Signatures cannot be modified. There is not any security on removing AOI signatures.

In the Controller Organizer. If we had referenced other AOI’s (nested) we would have wanted to check this box. Right Click the Conveyor_Core AOI and Select Export. 7. we will export the AOI and then import it into a new Studio 5000 Logix Designer application. 123 of 128 . Note: Include all referenced Add-On Instructions and User-Defined Types checkbox in the Export AOI dialog box that is unchecked.Export AOI Now.

9. Enter a File Name for the AOI and then Press Export. Now. Begin a new file by Selecting New Project from the Quick Start page. Note: Remember the folder name that you exported the AOI to.8. Open a third instance of Studio 5000 Logix Designer using the shortcut for Studio 5000 Logix Designer on the desktop or the button selecting Programs\Rockwell Software\Studio 5000 13. Create a New Studio 5000 Logix Designer Application 12. 124 of 128 .

Click Next when finished. Select a Logix Controller. 125 of 128 . Note: It will take a minute to create the new ACD file. Enter the Name AOI_LAB 15. 16. For this example we selected a 1756-L75. Fill in the resulting dialog box as shown below: Use the latest version of Logix 17.14. Click Finish once complete.

Now you can view the imported AOI in the new Studio 5000 Logix Designer application. 20.L5X file that you created above and Press OK. This will bring up the Import Configuration Wizard. 126 of 128 . 21. 19. Our Operation is to Create a new AOI in this new application. In the Controller Organizer. Right Click on the AOI Folder and Select Import Add-On Instruction. Browse to Conveyor_Core. 22. Press OK to import the AOI.18.

When you use code segments over and over again you can simply place an AOI in your program instead of re-generating the code again and again. We can apply signatures to AOIs that will allow customers to view and change the code inside. In the first few labs we have moved from all of our logic bunched in one big program to a single instruction that is very compact and easy to use. We saw that we can develop complex code segments and ship them to customers that need. Congratulations! You have just finished this Lab Click to Proceed to Contents 127 of 128 . They will match. Close the both instances of Studio 5000 Logix Designer using File > Close. Respond with No if prompted to save the file. Lab Summary This lab shows that with Add-On Instructions you can generate code in hours versus days.23. You can also compare the AOI Signature values in each of Studio 5000 Logix Designer application. 10. but give use indication that something has changed.

Inc. 128 of 128 . All rights reserved. Copyright© 2015 Rockwell Automation.