L18 - Rockwell Software Studio 5000® and Logix PDF
L18 - Rockwell Software Studio 5000® and Logix PDF
Advanced Lab
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 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.
Advanced Logix
Contents
Before you begin ........................................................................................................................................... 4
About this lab .................................................................................................................................................................................... 4
Tools & prerequisites ........................................................................................................................................................................ 4
Lab 5: Improving Efficiency Using Partial Import Online <10 minutes> .......................... 60
Lab 5.1: Code Library Example ................................................................................................................................................. 60
Lab 5.2: Line Expansion Example ............................................................................................................................................. 67
Lab 8: Using a SD card with a Logix Controller <10 minutes> .......................................... 124
3 of 145
Before you begin
You will have approximately 90 minutes to complete as many sections of this lab as you would like too. It will take approximately
180 minutes (3 hours) to complete all of the sections! You do not need to complete all of the sections.
The intent of this lab to present an array of topics for the user to select from; each lab section is independent so you can pick and
choose what you are interested in during the time available. If you choose to complete every lab section it will take more than
the allotted time for the lab.
NOTE: To ensure proper lab execution of the lab the VMWare image should be reset to the correct snapshot prior beginning the
lab.
4 of 145
Lab 1: Compare and Merge Tool <10 minutes>
5 of 145
The New Compare pop-up will appear.
Project Path: C:\ Lab Files\ L18 – Studio 5000 and Logix Advanced Lab\ Lab1 Compare and Merge Tool
3. For the Left Project, click the Browse button, navigate to the Lab1 Compare and Merge Tool folder
and select the L75_Project_Start.ACD file using the path above.
4. For the Right Project, follow the same path and select the Line_Expansion.ACD file.
6 of 145
When completed, your Compare window will look like this.
Notice the options provided. We will stay with the defaults here but you could eliminate tag values and
descriptions as part of the compare. You could also filter out some of the tags.
5. Click OK. The Compare progress button will appear while the compare is occurring.
When the compare process is done, the Compare Results window will show where the differences were found.
You may need to expand the window to make it large enough to see everything.
7 of 145
The Leftmost column titled ’Compare Summary’ shows the categories where differences were found. The middle
and right columns report on how many differences were found in each category.
Information displayed in the Compare Summary, Left Project, and Right Project is color-coded:
Red - Indicates items that exist in one project but not the other.
Blue - Indicates items that are common between the two projects, but have a difference. For example, you might
have a ladder routine that exists in both projects, but with a rung that does not match, or a tag that exists, but
contains different data. Double-clicking on these items brings up more detailed compare information.
Gray - Indicates common items in which no differences were found. These are for context only; no further details
can be displayed.
6. Since the Properties entry under the Controller folder is Blue, some differences exist between the properties of
the Controllers. Double-click on Properties. The difference is also highlighted in blue. In this case the only
difference is the Controller Properties Name
7. Close the Controller Properties window. If you want to see the differences in the Compare Summary, Double-
Click the Summary Folder in the left most menu.
8 of 145
8. The next folder in the Summary window is labeled Modules. Click on the Modules folder.
This shows the I/O tree from the completed ACD file. The EN2T is Red signifying it does not exist in the _Start
ACD file.
10. Double-click on the EN2T. The module’s full definition is displayed. Remember! Red - Indicates items that exist
in one project but not the other. Close the I/O Module Window.
9 of 145
There are two other folders in the Summary window indicating other project differences: Tasks and Logical
Organizer View. Using what you’ve learned above, click on each different view and observe what is different.
10 of 145
Merging Project Files
Now that we have a comparison of the two files, we can invoke the new Merge feature of Studio 5000 V24.
13. To start the merge, click on the Merge icon in the toolbar.
This will open up a window with 2 sections. The top windows show the comparison between the two projects.
Notice certain icon/ boxes are checked. Refer to the table below for Icon definition.
This table describes the meaning of the icons you will see in this comparison window.
So in our example above, the name “Tank_Controller” will be selected. If you prefer to use
“Tank_Supervisor” you could check its box.
11 of 145
Referring to the Task folder, the greyed out checked box indicates that the result of the merge will have items
from both files.
14. Double-Click on the Tasks folder to expand the entry.
You’ll first notice that a navigation aid exists in the toolbar in the form of the home icon, an arrow and ‘Tasks’.
Clicking on the home icon will take us back to the original screen. Of course any changes we made to the check
boxes would be reflected there. Now we can choose the items under Tasks that we want included. We can go
even further by selecting what properties of the task will be included.
15. Double-Click on Main Task in the left pane. This results in the following window:
16. Double-Click on Scheduled Programs in the Left Pane. All scheduled programs that are checked will
be included in the Merge. acd file under the Scheduled Programs, otherwise if unchecked they will be
in the Unscheduled Programs.
17. Uncheck the “Auto_Cycle2” box. Once again, it will be merged, but it will reside in the Unscheduled
Programs/ Phases Section.
12 of 145
Navigat back to the MainTask by clicking MainTask in the menu path. We will see that both panes have the box
checked indicating a blend of projects.
18. This selection process can be done for every item in the selection panes. Explore the other folders
and make some changes as you desire. Click the Home Icon to navigate back to the Home Page.
The bottom pane in the Merge Tool window is labeled “Resulting Project – MergeProject.ACD”.
The representations for each of these icons in this lower pane are as
follows.
This pane shows which direction the merged items will be flowing. Using the
key above, we can see that most of the items will be taken from the right
pane. If you made some changes, you will see those selected in the
directional arrows. If we click, for instance on Auto_Cycle1 we will see why
the icon is the double headed arrow.
13 of 145
19. Double-Click on Programs, then Auto_Cycle1. The Program Tags and MainRoutine will come from
the left pane while the Connections will come from the right pane. Again, feel free to explore the Tool
and make any changes you like.
20. Click on the disc icon in the Toolbar to begin the Save.
14 of 145
21. By default, the file will be saved as MergeResult.ACD, but you can change the name or the file type
before saving. Also by default it will be stored in C:\Program Files (x86)\Rockwell Software\Logix
Designer Tools\Logix Designer Compare Tool. You can change the save location if you would like.
22. Once you’ve completed saving, launch Studio 5000 by clicking the Launch Merge Project button on
the Merge Tool and open your new Merge project.
23. Click the Yes button when you are asked to open a copy of the MergeResult1.acd file. Notice the
Compare and Merge Tool has the MergeResult1. acd file open.
15 of 145
Reviewing Merged Project
24. Verify the project. You will probably see some errors and warnings but they are well documented and
most likely the result of Program Connections that are missing. Notice the Merged Program has a
Tank2, Pump2, and Auto_Cyle2 Program along with an EN2T Module in the local Chassis.
Note: Program Connections are New for V24. They are described in another lab session.
Congratulations!
You have just finished this Lab
Click to Proceed to Contents
16 of 145
Lab 2: AOI Hardware Abstraction <10 minutes>
This section will provide an introduction to a new feature in version 24 of Studio 5000™ Logix Designer. This feature is
designed to extend the functionality of Logix Add On Instructions (AOI).
Module as an InOut Parameter in an AOI: The predefined data type Module can now be added as an InOut
parameter to an AOI. When instantiating the AOI, the user can use a pull down of the I/O Configuration to select the
module linked to the AOI. This gives the user a great method of linking a module to the logic inside of an AOI.
Module Class available inside an AOI: GSV instructions can now access the Module Class inside of an AOI. This
allows the AOI to monitor attributes such as: EntryStatus, FaultCode, LEDStatus and the new Path attribute.
Module Path Attribute: The Module Class of a GSV instruction now has a new Attribute called Path. This returns the
module path. The module path can be used in a message instruction to point the message directly at the module.
In this section, you will learn the benefits for these new features. Examples will be given of how they can be used in your next
application. You will be using an existing program in an effort to conserve time.
2. Navigate to the link below and double-click the project named Hardware_Abstraction_ModuleSts.ACD to open
it in Logix Designer.
You can find the project in this directory: C:\Lab Files\ L18 - Studio 5000 and Logix Advanced Lab\ Lab 2 AOI Hardware
Abstraction
NOTE: This may take up to a minute to open.
17 of 145
4. Expand the Ethernet/IP Driver AB_ETHIP-1
5. Select 192.168.1.7, 1769-L36ERM. You do not need to expand the controller. Press Download.
8. If not prompted, changed the controller mode to Remote Run in Studio 5000 Logix Designer.
9. Expand the MainTask, Expand the Program CommSts_Local, Open the Routine Slot01_ModSts
10. Monitor Rung 1. The AOI_Module_Sts_V01 IOMod_Ref InOut Parameter uses the MODULE datatype. We
are only able to pass the MODULE datatype into the AOI. The AOI_ModuleSts_V01 returns the running status
of the module inputted in to the AOI.
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.
11. To see the AOI work we will Inhibit the Digital_Combo_IO module in slot 1.
18 of 145
12. Select the Digital_Combo_IO module in slot 1 in the I/O Configuration and then Click the Right Mouse Button.
14. Navigate to the Connection tab. Check Inhibit Module. Then Click on OK.
15. Press Yes on the Danger; Connection Interruption screen that will popup.
19 of 145
17. Now you can see that the Local_01_ModSts.Inhibited tag is True and the Local Local_01_ModSts.Running
tag is False.
18. You can now remove the Inhibit from the Digital_Combo_IO module in slot 1 in the I/O Configuration.
19. Go back to the Slot01_ModSts Routine and verify that Local_01_ModSts.Inhibited tag is False and the Local
Local_01_ModSts.Running tag is True.
20. Now, let’s take a closer look at the linking of the module into the AOI. This linking is done by selecting the
module from the I/O Configuration.
21. Select Rung 1 of the Slot01_ModSts Routine. Press the Enable Edits button in the toolbar on top of the Ladder
viewer/editor window.
20 of 145
22. Now, change the Module that IO_ModRef in the AOI_ModuleSts_V01 instruction is referencing.
23. You will just need to browse to the module using the I/O Configuration tree to select the module. Any module
can be selected.
25. Close Studio 5000 Logix Designer. If prompted to save the file respond with No.
21 of 145
Lab 2.2: Using Module Object Path Attribute
This section will review an example of using the Path attribute of the Module Object. This example re-uses a single
message instruction to return the Module firmware revision from multiple modules. The message instruction performs a
Device Who. 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.
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. The logic show below from the
AOI_ModWho_V01 uses this logic. This logic only uses byte 0 which limits us to a maximum of 255
characters for our length. This should be more than enough for a real world MESSAGE datatype Path.
22 of 145
The BTD copies the SINT path length from the SINT array to the LEN member of the String. The GSV
returns SINT’s, but the STRING datatype using a DINT for the LEN (length). Using the BTD we insure that
the value is not converted. The COP instruction copies the remaining data to the Path DATA member – the
string value of the message path. This time we are coping from SINT to SINT.
2. Navigate to the link below and double-click the project named Hardware_Abstraction_ModuleWho.ACD to
open it in Logix Designer.
You can find the project in this directory: C:\Lab Files\ L18 - Studio 5000 and Logix Advanced Lab\ Lab 2 AOI Hardware
Abstraction
NOTE: This may take up to a minute to open.
23 of 145
5. Select 192.168.1.7, 1769-L36ERM. You do not need to expand the controller. Press Download.
8. If not prompted, changed the controller mode to Remote Run in Studio 5000 Logix Designer.
9. Expand the MainTask, Expand the Program ModuleWho_Local, Open the Routine Slot01_ModWho
24 of 145
10. Monitor Rung 1. The AOI_Module_Who_V01 retrieves the Major_Firmware and Minor_Firmware revisions of
the Module linked to the InOut Parameter IO_ModRef. On controller first scan all of the major and minor
firmware revision tags are cleared.
The AOI uses the New Path attribute of the MODULE object to point the message instruction to the module
linked to IO_ModRef. This gives use an easy way to get module information and reuse message instruction
and associated code!
The message instruction in the AOI use the DeviceWho message. This returns more data than just the
modules firmware revision. Reference Rockwell Automation KnowledgeBase Article 28917 for details on all
of the data returned by the DeviceWho message.
11. Select the XIC instruction with Cmd_Local01_ModWho. Right Mouse Click and Select Toggle Bit from the
menu or press Control-T. (Reference screen capture above)
12. This triggers AO_Module_Who to go out and retrieve the Major_Firmware and Minor_Firmware revision from
the linked module – Digital_Combo_IO. You will see the final values in the Local01_Major_Firmware and
Local01_Minor_Firmware controller scope tags.
25 of 145
13. Open RSLinx Classic from the desktop and use Communications/ RSWho to browse to the
Digital_Combo_IO module (IO Module in Slot 1).
14. Right Mouse Click and Select Device Properties. From the screen that pops up verify the values you have in
Local01_Major_Firmware and Local01_Minor_Firmware Logix controller scope tags.
NOTE: The Major and Minor firmware revisions of your modules may be different.
26 of 145
15. You can follow the same steps with the AOI in the Routine Slot02_ModWho. This AOI monitors the
Analog_Combo_IO module in Slot 2.
Note: Due to issues with the lab you may need to cycle the controler from run to program then back to run
before completing steps 15 and 16.
16. Just like with the module in Slot 1, you can verify the results by bringing up the Device Properties of the module
in RSLinx Classic.
18. Close Studio 5000 Logix Designer. If prompted to save the file respond with No.
Congratulations!
You have just finished this Lab
27 of 145
Click to Proceed to Contents
28 of 145
Lab 3: Introduction to Program Parameters <40 minutes>
Since applications often consist of many code modules, each module must have a means of interacting with other modules or
devices. This interaction is often referred to as the Linking Layer. Code Modules are linked together using clearly defined
“inputs” and “outputs” that are required for a module to complete its task. Once a code module’s inputs and outputs have been
defined, they can be linked to other modules using Connections.
Within the Logix environment, users can implement modular design techniques in a number of ways including the use of
Routines, Programs, and AOIs. Execution varies depending on the type of container used. i.e. scheduled (Programs) versus
called (AOI’s and Routines). Prior to version 24, if the application was segregated using programs, users were forced to use
controller scoped tags for the linking layer. Version 24 introduces a feature called Program Parameters. This feature allows the
user to configure program-to-program connections, without the use of controller scoped tags. The ability to define program-to-
program interfaces adds an additional level of Encapsulation for an improved modular programming environment.
This section will provide an introduction to several powerful features in version 24 of Studio 5000™ Logix Designer. These
features are designed to provide a design environment that enables users to fully implement modular programming
methodologies.
Program Parameter types:
Program parameters define a data interface for Programs. Data sharing between Programs can be achieved either through pre-
defined connections between parameters or directly through a special notation. Unlike local tags, all program parameters are
publically accessible outside of the program. Additionally, HMI external access can be specified on individual basis for each
parameter.
There are two types of parameters for Programs: standard parameters, which are Input and Output, and special usage
parameters, which are InOut and Public.
Input parameters: an Input parameter defines the data that is passed by value into the executing program. Because
Input parameters are passed by value, their values cannot change from external sources during the execution of the
program when connected to Output or Public parameters. An Input parameter supports a maximum of one connection
or InOut binding.
Output parameters: an Output parameter defines the data that is produced as a direct result of executing the
program. Because Output parameters are always passed by value, their values cannot change outside of the
execution of the Program nor can they be changed from other programs. Output parameters can be connected to one
or several Input and Public parameters or Controller scope tags.
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. Because InOut parameters are always passed by reference, their values can
change from external sources during the execution of the program. An InOut parameter must be bound to exactly one
target including Input and Public parameters as well as Controller scope tags. Some restrictions apply when binding an
InOut to an Output parameter.
Public parameters: a Public parameter defines the data that is passed by value into a program or is produced by the
executing program. 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.
In this section, you will learn how connections are made between code modules (Programs). We will cover existing and new
methods. We will primarily focus on how to create and connect Program Parameters (New in version 24). You will be using an
existing program in an effort to conserve time.
29 of 145
Lab 3.1: Input Parameters
This section will cover Input parameters. The example application contains three code modules (Pump, Tank, and Auto_Cycle).
The code module interface has been defined and parameters are already created. This was done to conserve time. In this
section, you will be setting up several connections to Input parameters.
Goals:
Create an Input Parameter
Configure a connection
Understand when an Input connection can be used
2. Navigate to the link below and double-click the project named Sample_Project_Start.ACD to open it in Logix
Designer.
You can find the project in this directory: C:\Lab Files\ L18 - Studio 5000 and Logix Advanced Lab\ Lab 3 Introduction
to Program Parameters
NOTE: This may take up to a minute to open.
NOTE: You will notice that Program Tags are now Parameters and Local Tags. This change was required to reflect the
addition of Program Parameters. Additionally, the naming convention used for Programs in version 24 now matches the
naming convention used for Add-On Instructions (AOIs).
30 of 145
5. Highlight the tag Inp_DrainPumpPB. This is can be done by pressing the gray button to the left of the tag
name. You may need to expand the name column.
6. Locate the tag properties window on the right side of the screen. If Parameter Connections is not expanded,
do so now by clicking on the “+” symbol.
NOTE: A Parameter must be “connected” to another Parameter or Controller Tag. For example, 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. The steps below will walk you through creating a
connection.
31 of 145
7. Click in the box that says ‘New Connection’.
This input parameter is for the Drain Pump Pushbutton input. It will be connected to the physical input point in the
Controller Tags.
8. Once you click in the box, press the gray button on the right.
9. Press the drop down arrow when the tag selection pop-up appears.
NOTE: There are many ways to filter or search through tags on this screen. Take a moment to familiarize
yourself with the many options. We will explore some of them as we progress through the lab.
32 of 145
11. Highlight Local:1:I.Data. Press the drop down arrow that appears to the right of the highlighted tag.
NOTE: The drop down allows us to select the individual bits in Local:1:I.Data.
NOTE: Notice how bit 4 is gray. This indicates that it is used in logic somewhere in the application. In this application, bit 4
corresponds to the input point for Selector Switch DI4 on the demo box. For this application, the DI4 selector switch is the
Auto / Manual mode selection for Tank 1.
13. Once you select Bit 2, the tag selection screen should look like the screen shot below.
NOTE: If you know the exact tag name, you can manually enter the text in step 7. This can conserve time, but may
become cumbersome as tag names grow in length and complexity.
NOTE: Notice how the {0:0} next to Parameter Connections changed to {1:0}. The number on the left between the brackets
indicates the number of connections to the parent tag. In this case, the parent tag is Inp_DrainPumpPB. The number on
the right indicates the number of connections to members of the parent tag. For example, if the parent tag was a User-
Defined data type, then any connection to a member of the tag will be reflected in the number on the right. This also applies
to connections that are configured to bits in a SINT, INT or DINT.
15. We need to create one more Input connection. Let’s create this connection using a different method. Click on
the Edit Tags tab for the Pump1 Parameters and Local Tags.
33 of 145
16. Right-click on one of the column headers. Select Toggle Column and then select Connection.
Right-Click on
column header
Select Toggle
Column
Select Connection
NOTE: The user can customize the tag database columns. By default, the Connection column is not displayed. After
completing step 14, the Connection column should be visible.
17. Locate the tag Inp_FillPumpPB. Click in the Connection box for this tag. You may have to scroll to the right to
see the Connection column.
NOTE: At this point, you can click the gray button with the three dots. This button will display the Connection Configuration
screen. This window would be required if more than one connection exists or must be configured. If only one connection
exists or is desired, you can click the drop down arrow. This will display the tag selection pop-up. 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.
18. Click on the ellipses button (button w/ three dots) to open the Connection Configuration Dialog Box.
34 of 145
19. Click in the box under the name column that says New Connection.
NOTE: From this screen, you can either manually type the connection into the name box or you can use the tag selection
pop-up. This example will use the pop-up.
20. Click on the gray button on the right side of the name box.
35 of 145
22. Verify that the Connection Configuration Dialog Box looks like the following screenshot.
36 of 145
Lab 3.2: Output Parameters
This section will cover Output parameters. The example application contains three code modules (Pump, Tank, and
Auto_Cycle). The code module interface has been defined and parameters are already created. This was done to conserve
time. In this 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. In the Controller Organizer, right-click on the Tank1 Program and select Properties.
NOTE: There are several ways to configure connections. In the previous section, we used the Tag Properties window. In
this section we will use the Parameters Tab in the Program Properties window. Both methods are available and can be
used based on user preference.
NOTE: The Parameters tab is new with version 24. This gives the user another way to see and configure parameters and
connections. Do not worry about the Red “X” next to Pv_MSG_PLC5Read. We will discuss this later in the lab.
37 of 145
3. Click in the name box for Out_VoltMeter. DO NOT click on the graphic. See the note below for more
details.
NOTE: If you press the button next to the parameter name, it will allow you to view the tag parameters members
4. In the Connections Window, in the Name box that reads New Connection, type the following:
Local:2:O.Ch0Data
NOTE: If a Red “X” appears next to this connection, it’s possible you typed the number “0” instead of the letter “O”.
For this application, the Auto_Cycle code module must be able to command the Drain and Fill pumps to run.
The Pump code module has been configured to have a public run command for both the Drain and Fill pumps.
Since the Auto_Cycle module must be connected to the Pump module, an output parameter must also be
configured for both the Drain and Fill pumps in the Auto_Cycle module. We will be configuring these
connections as well as explore some of the filter / search mechanisms throughout the next several steps.
38 of 145
7. Double-click the Parameters and Local Tags
So far, all connections that have been configured have been to Controller Tags (I/O). The next two connections will be
connections between two programs.
8. Highlight the parameter Out_DrainPump. In the tag properties window, expand Parameter Connections.
10. Once you click in the box, press the gray button on the right.
11. Press the drop down arrow when the tag selection pop-up appears.
39 of 145
12. Remove the checkbox on “Show Controller Tags”
14. In the “Show Parameters from other Program” dropdown, select Pump1.
NOTE: Your window should appear like the screen shot above. You are only viewing the Pump1 parameters that can be
connected to the Output parameter. All local tags and parameters that would make invalid connections are not visible.
15. Double-click on \Pump1.Cmd_PublicDrain. You may have to expand the name column to see the entire
parameter name.
40 of 145
16. Press OK.
17. Highlight the parameter Out_FillPump. In the tag properties window, expand Parameter Connections.
19. Once you click in the box, press the gray button on the right.
20. Press the drop down arrow when the tag selection pop-up appears.
21. In the upper left corner of the parameter selection pop-up, enter “PublicFill”.
NOTE: This can be a quick way to narrow down the parameters, especially if you know some key words in the tag name.
22. Double-click on \Pump1.Cmd_PublicFill. You may have to expand the name column to see the entire
parameter name.
41 of 145
Additional Information – Output Parameters
When to use Output Parameters
Output Parameters can be connected to Controller Scoped tags, Input Parameters, and Public Parameters.
This makes output parameters a great option for connecting a code module or object to an output card. It
also is a good option for configuring a code module or object to invoke operations (commands, settings, etc)
in other code modules or objects. Additionally, multiple connections can be configured for an output
parameter. This allows one code module or object to send multiple commands to multiple modules or
objects using one output parameter. This is often referred to as “fanning”.
Output Parameter General Information
• Output parameters (including members) can support multiple connections. For example, lets
assume you have a BOOL input parameter in Program A and Program B named Input1a and Input1b.
You are allowed to connect a single output parameter in Program C to Input1a AND Input1b. As stated
earlier, this is often referred to as “fanning”.
• Output Parameter values are refreshed AFTER each scan of a program. Updated output parameter
values will NOT be available to the parameters connected to that output parameter until the program
execution is complete.
• An Output parameter can ONLY be connected to an InOut parameter if both the Output and InOut
parameters are configured as Constants. InOut parameters will be discussed in the next section.
The primary reason for this requirement is InOut parameters are passed by reference, which functions
similarly to alias tags. In other words, the InOut parameter is merely a pointer to the original tag. If a
non-constant InOut parameter could be connected to a non-constant Output parameter, values written
to the InOut parameter would overwrite the value in the Output parameter. This is prohibited when the
InOut and Output parameters are configured as Constants which means the value cannot be changed
by logic. This would be a good technique for configuring a code module to monitor the output value of a
different code module.
42 of 145
Lab 3.3: InOut Parameters
This section will cover InOut parameters. The example application contains three code modules (Pump, Tank, and Auto_Cycle).
The code module interface has been defined and parameters are already created. This was done to conserve time. In this
section, you will be setting up several connections to InOut parameters.
Goals:
Create an InOut Parameter
Configure a connection
Understand when an InOut connection can be used
Let’s assume this system has a PLC5 that is running remotely at the tank location. That PLC5 has several
inputs that gather leak detection status of the tank area. This application will retrieve the leak detection status
from the PLC5 using a PLC5 Word Read MSG instruction. Message instructions must reside in the Controller
Tags. An InOut parameter can be used to connect directly to the Message instruction at the Controller scope.
This provides an extra layer of encapsulation. The following steps in this section will walk you through the
process of connecting a Message instruction to a program InOut parameter.
3. Highlight Pv_MSG_PLC5Read. This tag should have the Red “X”, which indicates an error.
43 of 145
4. Click in the box that says ‘New Connection’ in the tag properties window.
5. Once you click in the box, press the gray button on the right.
6. Press the drop down arrow when the tag selection pop-up appears.
9. Scroll down in the list and double-click the MSG_PLC5_Read Controller Tag.
44 of 145
10. Press OK.
If you look in the Parameters and Local Tags for Tank1, you will also see an input parameter named
Inp_LeakDetectionPLC5. Since Message instruction source and destination tags must also be at the controller scope, we
created an additional parameter to connect to the result (destination) of the Message instruction.
45 of 145
Lab 3.4: Public Parameters
This section will cover Public parameters. The example application contains three code modules (Pump, Tank, and Auto_Cycle).
The code module interface has been defined and parameters are already created. This was done to conserve time. In this
section, you will be setting up several connections to Public parameters.
Goals:
Create a Public Parameter
Configure a connection
Understand when a Public connection can be used
3. Click on the Edit Tags tab of the Parameters and Local Tags.
4. Click inside the usage box for Sts_AutoMode. Select the drop down arrow and select Public Parameter.
NOTE: This tag was originally configured as a Local Tag. It can easily be converted to a public parameter so other
programs can get access.
46 of 145
6. Click in the box that says ‘New Connection’ in the tag properties window.
7. Once you click in the box, press the gray button on the right.
8. Press the drop down arrow when the tag selection pop-up appears.
9. Use the search / filter options to find \Pump1.Inp_AutoMode and complete the connection. Set Show
Parameters from other Programs to Pump1.
10. Click inside the usage box for Sts_ManualMode. Select the drop down arrow and select Public Parameter.
47 of 145
13. Right-click on one of the column headers. Select Toggle Column and then select Connection.
Right-Click on
column header
Select Toggle
Column
Select Connection
14. Navigate (scroll right) to the Connection column. The two connections you just created should look like the
following screen shot. You may have to expand the width of the Connection column.
The remaining steps will demonstrate how to connect to members of a parameter. We will also observe how to quickly
identify how many total connections are configured for a parameter.
15. Navigate to the Parameters and Local Tags of the Tank1 Program.
16. Highlight Val_LeakDetection. Look at the Parameter Connections for this tag in the Properties window.
NOTE: Let’s do a quick review of what we discussed earlier in the lab. You can quickly identify the number of connections
for the parameter and its members by looking at the numbers between the brackets. The example above indicates that 0
connections are made to the parent parameter, which is Val_LeakDetection. However, 2 connections are made to one or
more members of the parent parameter. In this example, that would mean there are two connections to one or more of the
16 bits (INT data type) of Val_LeakDetection. The released 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.
48 of 145
17. Let’s create another connection to a member of the Val_LeakDetection parameter. Navigate to the
Parameters and Local Tags of the Pump1 Program.
19. Navigate to the Parameters and Local Tags of the Tank1 Program.
20. Highlight Val_LeakDetection. Look at the Parameter Connections for this tag in the Properties window.
Note how the {0:2} changed to {0:3}.
21. Navigate to the Parameters and Local Tags of the Auto_Cycle1 Program.
23. Navigate to the Parameters and Local Tags of the Tank1 Program.
24. Highlight Val_LeakDetection. Look at the Parameter Connections for this tag in the Properties window.
Note how the {0:3} changed to {1:3}.
25. The Connection column in the Parameters and Local Tags window will display the same information. You
may have to configure the Connection column to be visible.
26. Mouse over the connection box for the Val_LeakDetection Public Parameter.
The popup will show you all of the connections that are configured for a given parameter.
49 of 145
Additional Information – Public Parameters
When to use Public Parameters
Public Parameters can be connected to Input Parameters, Output Parameters, and InOut Parameters.
Public parameters have the look and feel of controller scoped tags, but at the program level. The key benefit
to using Public parameters over controller scoped tags is better encapsulation. If a code module or object
contains data that must be globally available to other code modules, then a Public parameter would be an
excellent option. Public parameters are updated as the source updates, so higher priority tasks that interrupt
a program during execution will have access to any updated values in the lower priority task. Additionally,
“fanning” is supported with Public Parameters. 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. Input parameters could be
used, but an individual input parameter would be required for each connection. In other words, 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. However, if the command is configured as a Public parameter, then all
10 code modules or objects could have an output connected to a single Public parameter.
Public Parameter General Information
• Public parameters can support MULTIPLE connections. You can configure connections to the base
Public parameter or any member of a Public parameter. This includes User-Defined Structures.
• Public parameters are updated when the source is updated. In other words, when a Public
parameter value updates, it is immediately available to any higher priorty tasks that are connected to
that parameter.
• Public parameters can be aliased to Controller Scope Tags. If this functionality is desired, it is
important to remember that the alias update will be asynchronous to program execution. The public
parameter will contain the real-time value of the controller scope tag.
50 of 145
Lab 3.5: Direct Access of Program Parameters
This section will cover the direct access of Program Parameters. You will be configuring logic and directly accessing several
program parameters.
Goals:
Configure logic to use direct access
Understand how direct access behaves in logic
2. Rung 2 should have an XIO instruction that is not tied to a tag. Double-click the “?” above this instruction.
NOTE: We want to make sure that we turn the Fill Pump off when the Tank is full. We can use direct reference to acquire
the value of the tank full status. The Auto_Cycle1 program can directly access the value of the Sts_TankFull parameter in
the Tank program without creating a physical connection.
51 of 145
3. Press the drop-down arrow. Use the filters to find and select \Tank1.Sts_TankFull.
NOTE: The Fill Pump will now shut off when the tank is full.
4. Rung 3 should have an XIO instruction that is not tied to a tag. Double-click the “?” above this instruction.
5. Press the drop-down arrow. Use the filters to find and select \Tank1.Sts_TankEmpty.
NOTE: The Drain Pump will now shut off when the tank is empty.
52 of 145
9. Select 192.168.1.7, 1769-L36ERM. You do not need to expand the controller. Press Download.
11. When prompted to change the controller back to Remote Run, Click Yes.
12. Make sure the switch at DI4 is turned to the RIGHT. This switch allows the user to select between Auto (Right)
and Manual (Left) Mode.
13. When the green light at DO0 is illuminated, the Fill Pump is ON.
14. When the red light at DO2 is illuminated, the Drain Pump is ON.
15. The Voltmeter at AO0 simulates the tank level. 0 volts indicates EMPTY, 10 volts indicates FULL.
16. Turn the AI0 Knob to 5. The potentiometer knob simulates the pump speed. As you turn the knob clockwise,
the pump speed will increase.
NOTE: You should notice the tank slowly filling and draining. As the voltmeter swings from left to right, the green light
should be illuminated (filling). As the voltmeter swings from right to left, the red light should be illuminated (draining).
18. Turn the DI4 switch to the LEFT position. This will put the system into Manual Mode.
NOTE: The Red and Green lights should both turn off. The voltmeter should stop moving. Since the system is now in
manual mode, you must manually operate the fill and drain pumps.
19. Press and HOLD the green button at DI0. This will manually turn the fill pump ON.
NOTE: You should notice the green light will turn ON and the voltmeter will being to increase. When the tank is full, the
green light should turn off even if the button remains depressed.
20. Press and HOLD the red button at DI2. This will manually turn the drain pump ON.
NOTE: You should notice the red light will turn ON and the voltmeter will being to decrease. When the tank is empty, the
red light should turn off even if the button remains depressed.
53 of 145
21. Go Offline with the controller.
22. Close Studio 5000 Logix Designer. If prompted to save the file respond with No.
Congratulations!
You have just finished this Lab
Click to Proceed to Contents
54 of 145
Lab 4: Introduction to the Logical Organizer <5 minutes>
This section will cover the Logical Organizer which is new with version 24. You will be organizing the application from Section 1
into logical groups.
Goals:
Organize the Section 1 application.
Understand the different options available within the Logical Organizer.
2. Navigate to C:\Lab Files\ L18 - Studio 5000 and Logix Advanced Lab\ Lab 4 Introduction to the Logical
Organizer
55 of 145
Using the Logical Organizer
NOTE: The Controller Organizer is used to organize programs into a task structure which defines how the logic will be
executed. This view doesn’t always present code modules in a logical format that is applicable to the machine or process
design. The Logical Organizer gives users a new way to group and view programs in an application. This can be extremely
helpful when viewing code modules that have been developed at the program level. The remainder of this section will walk
you through the Logical Organizer.
3. Right-click on the root folder (Logical Model Tank_Controller). Select Add => New Folder…
56 of 145
4. Name the folder Simulation_Logic.
NOTE: This folder will hold the simulation program used to fill and drain the tank.
5. Click OK.
6. Create two additional folders using the same steps. Name one folder Tank_Manager and the other Station_1.
NOTE: The Logical Organizer should look like the following screen shot.
NOTE: Now that we have some folders created, let’s move the programs around.
57 of 145
8. Click on the Station_1 folder and drag it to the Tank_Manager folder.
10. Click on the Pump1 Program and drag it to the Station_1 Folder.
58 of 145
11. Click on the Tank1 Program and drag it to the Station_1 Folder.
Congratulations!
You have just finished this Lab
Click to Proceed to Contents
59 of 145
Lab 5: 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.
We will be working in both the Controller and Logical Organizer windows. We will also be discussing the Partial Import Online
(PIO) functionality.
2. Open the project Tank_Controller.ACD from the C:\Lab Files\ L18 - Studio 5000 and Logix Advanced Lab\
Lab 5 Improving Efficiency Using Partial Import Online folder on the desktop.
5. Navigate to C:\Lab Files\ L18 - Studio 5000 and Logix Advanced Lab\ Lab 5 Improving Efficiency Using
Partial Import Online
60 of 145
NOTE: This may take up to a minute to open.
7. Size the Studio 5000 windows for Tank_Supervisor AND Tank_Controller so they look like the screen shot
below.
NOTE: Let’s assume that the Tank_Controller.ACD file is your company’s Code Module repository. This essentially means
the overall code library for your company is stored in an ACD file. For this example, we will assume you must roll out a tank
control system. We created a new ACD file called Tank_Supervisor. You’ve opened both projects, and now it’s time to
drag and drop some of our code modules from our library to the actual Tank_Supervisor ACD file.
8. Make sure you select the Controller Organizer for each application.
61 of 145
9. Select the 1769-IQ6XOW4/B module in the Tank_Controller.ACD file and drag / drop it into the
Tank_Supervisor.ACD file. Make sure you drop it onto the 1769 Bus.
10. Select the 1769-IF4OF2/A module in the Tank_Controller.ACD file and drag / drop it into the
Tank_Supervisor.ACD file. Make sure you drop it onto the 1769 Bus.
62 of 145
11. The I/O Configuration should look like the following screen shot in the Tank_Supervisor.ACD file.
13. Select the MainProgram in the Tank_Supervisor.ACD file and press Delete.
14. Select the Simulation_Logic folder in the Tank_Controller.acd file and drag / drop it into the Logical Model
for the Tank_Supervisor.
63 of 145
15. Select the Tank_Manager folder in the Tank_Controller.acd file and drag / drop it into the Logical Model for
the Tank_Supervisor.
NOTE: It is extremely easy and fast to drag and drop items between instances of Studio 5000 Logix Designer. Many users
will store their code libraries in an ACD file for this purpose. 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.
16. We are finished with the Tank_Controller.acd at the moment. Minimize the Tank_Controller.acd file, but do
not close it.
19. All programs should be in the “Unscheduled Programs / Phases” folder. Let’s create the Periodic Task for the
Simulation Logic.
64 of 145
21. Enter Sim_Logic into the name. Leave everything else at the default value, click OK.
22. Drag and drop the Simulation1 Program into the Sim_Logic Task.
23. Drag and drop the Pump1 Program into the MainTask Task.
24. Drag and drop the Tank1 Program into the MainTask Task.
25. Drag and drop the Auto_Cycle1 Program into the MainTask Task.
NOTE: This task/program structure should look nearly identical to the file we used in Sections 1 and 2. You created this
one from scratch extremely quickly using an ACD file that contains the same code modules (programs). This is one major
advantage to using modular coding design practices. Let’s download this file and make sure everything works as expected.
65 of 145
26. Click on Communications => Who Active at the top of the screen.
28. Select 192.168.1.7, 1769-L36ERM. You do not need to expand the controller. Press Download.
30. When prompted to change the controller back to Remote Run, Click Yes.
31. Verify the application works as expected (See Section 1 [pg. 29] if you need a reference).
66 of 145
Lab 5.2: Line Expansion Example
This section will demonstrate an example of using modular programming techniques to simulate a line expansion. Let’s assume
this application was already in operation in the field. During the design phase, we knew we would be adding a second Tank
Station after the initial startup. With that in mind, we made sure to include enough I/O to support the expansion. Let’s walk
through the process of adding the second Tank Station.
67 of 145
3. Right-Click on the Simulation_Logic folder. Select Add => Import Program.
NOTE: Additionally, you can left-click drag and drop components which will function similarly to copy/paste. Using right-
click drag and drop of components will give you a few more options on how the component is pasted / imported.
Navigate to C:\Lab Files\L18 - Studio 5000 and Logix Advanced Lab\Lab 5 Improving Efficiency Using Partial
Import Online\Library. Select the Simulation.L5X file.
NOTE: This file is an export of the Simulation_1 program. We will be using the PIO functionality to import this program into
our application.
68 of 145
5. The Import Configuration window will be displayed. It should look like the screen shot below.
NOTE: This window allows us to see the details about the import. We can view and correct collisions as well as make
changes to connections.
NOTE: The red flag indicates that an item is flagged for review. The user should investigate all flags prior to the import.
Let’s take a look at the flag listed above.
7. In the Configure Program Properties window, change the Final Name to Simulation2.
NOTE: This item was flagged because the program Simulation1 already exists in this application. By default, in this
scenario, the operation will overwrite the existing Simualtion1 program with the imported program. Since we are adding a
second line, we want to create a new simulation program.
69 of 145
8. Click in the Description box. Clicking in a different box will accept the name change.
NOTE: Notice how the flag disappeared and the operation changed to “Create”.
NOTE: This will schedule the Simulation2 program in the Sim_Logic Periodic Task.
10. The Configure Program Properties window should look like the screen shot below.
70 of 145
11. Click on the Connections folder in the Import Content window.
12. In the Configure Connections window, scroll to the right to view the Final Connection.
NOTE: This window will allow you to create new connections, change the connections on the imported tags, or disconnect
connections. For this example, you will notice all connections are tied to Pump 1 and Tank 1. Since we have not imported
Station 2, we should disconnect these four connections. They will be properly connected on the import of Station 2.
13. Click in the Operation box and select the drop-down. Select Disconnect for each connection.
15. The Simulation_Logic folder should now have a new program called Simulation2.
71 of 145
16. Expand the Tank_Manager folder.
17. Right-Click on the Tank_Manager folder. Select Add => Import Program.
NOTE: Additionally, you can left-click drag and drop components which will function similarly to copy/paste. Using right-click
drag and drop of components will give you a few more options on how the component is pasted / imported
18. Navigate to C:\Lab Files\ L18 - Studio 5000 and Logix Advanced Lab\ Lab 5 Improving Efficiency Using
Partial Import Online\Library. Select the Station.L5X file.
NOTE: This file is an export of the Station_1 folder. We will be using the PIO functionality to import this program into our
application.
72 of 145
19. Press the Open button.
20. The Import Configuration window will be displayed. It should look like the screen shot below.
21. In the Configure Program Properties window, change the Final Name to Station_2.
73 of 145
23. In the “Schedule In” drop-down, select MainTask.
NOTE: This will schedule all programs in the Station_2 folder in the MainTask.
24. The Configure Program Properties window should look like the screen shot below.
74 of 145
This is where the PIO feature can really start to improve efficiency. 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. In
this example, the Station_2 folder is the parent and the Pump2, Tank2, and Auto_Cycle2 programs are children. We will
have access to all connections from a single window. Since Station_2 must control an entirely different set of hardware, we
must make the applicable changes to several connections. The following steps will walk you through this process.
26. Widen the Import Configuration window and expand the Final Connection column so you can see the
Parameter Name AND the Final Connection.
75 of 145
27. Change the Final Connection for \Pump2.Out_DrainPumpON to \Simulation2.Inp_DrainPumpON.
NOTE: You will notice that this parameter is listed twice in the list. This is normal when “fanning” is implemented. Fanning
is when multiple connections are configured to one parameter.
NOTE: We are not changing the connection for \Pump2.Inp_PumpSpeed. We will connect to the same POT as
Station_1.
NOTE: We are not changing the connection for \Tank2.Inp_LeakDetectionPLC5. We will connect to the same
controller tags as Station_1.
76 of 145
37. The Final Connection column should look like the screen shot below.
NOTE: Verify that all final connections match the screen shot below. The red arrows indicate the connections that have
been changed.
NOTE: The tag MSG_PLC5_Read can only have one connection. You will need to create a new Message tag to
connect to the ‘Tank2.Pv_MSG_PLC5Read' parameter. The new message tag is not shown.
39. The Tank_Manager folder should now have a new folder called Station_2. Expand the Station_2 folder and
verify that the programs imported successfully.
77 of 145
40. Click on Communications => Who Active at the top of the screen.
42. Select 192.168.1.7, 1769-L36ERM. You do not need to expand the controller. Press Download.
44. When prompted to change the controller back to Remote Run, Click Yes.
45. Verify the application works as expected (See Section 1 [pg. 29] if you need a reference).
NOTE: The tag MSG_PLC5_Read can only have one connection. You will need to make a different Message
tag to connect to the ‘Tank2.Pv_MSG_PLC5Read' parameter.
NOTE: Station_2 should operate exactly like Station_1, only using different I/O. The POT will control the pump speed of
both Stations. Station_2 does not have a voltmeter, so you may have to verify tank level by looking at tags in the controller.
47. Close Studio 5000 Logix Designer. If prompted to save the file respond with No.
Congratulations!
You have just finished this Lab
Click to Proceed to Contents
78 of 145
Lab 6: User-Defined Data Types, UDT <10 Minutes>
Instantiate definition: To create such an instance by, for example, defining one particular variation of object within a class,
giving it a name, and locating it in some physical place. In layman's terms, that means create something reusable but each new
use of it gets configured with specific values unique to that use.
1. Go to the desktop and launch Studio 5000 using the Studio 5000 icon.
Note that you are running in a VM Ware environment and it will take a few moments to launch Studio
5000.
79 of 145
2. On the following screen Select Open Existing Project.
3. In the Open Project window, Browse to the C:\Lab Files\ L18 - Studio 5000 and Logix Advanced Lab\
Lab 6 Using User Defined Datatypes directory and open the Advanced_Base.ACD file. There is a
shortcut on the desktop to the Lab Files folder.
Note that you are running in a VM Ware environment and it will take a few moments to open this project.
80 of 145
4. Notice the folders listed below the Data Types folder in the Controller Organizer
81 of 145
5. Right Click on the User-Defined Folder and select New Data Type...
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
82 of 145
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.
83 of 145
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.
84 of 145
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.
85 of 145
16. The following window will appear. Be sure the Edit Tags tab is selected. Scroll to the bottom of the screen and Click on
the white space at the bottom in the Name column. Type Conveyor_1.
86 of 145
17. Move the mouse to the Data Type column in the Conveyor_1 row, by default the data type is DINT. Click the
white space, then on the Ellipses.
18. This will bring up the Select Data Type dialog. Scroll to the Conveyor data type or begin typing Conveyor
(the Auto Complete function will find Conveyor after the first few characters). Select OK. Then Hit the Enter
Key.
Note: A windows will popup warning you that data will be truncated or lost. Press OK.
87 of 145
19. Expand the + next to the newly created Conveyor_1 tag. 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, notice that
they are a light grey. This means that the "Parent" Data Type Conveyor had comments and they were
brought forward. After creating a new Data Type, 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. If you desire you could create multiple
instances each with a unique name or even an array of Conveyor data types.
88 of 145
20. Now that we have created this UDT called Conveyor_1 what does this all mean? First we created a new Data type
called Conveyor. This data type consisted of members that had nomenclature specific to operational tasks of a generic
conveyor. We then created a tag called Conveyor_1 of data type Conveyor. Now think about these few tasks from a
larger machine perspective, lets say a packaging machine, because a packaging machine would tend to have 1 or
more conveyors on it. By creating this UDT we have created a reusable piece of code that can help us build new
machines in a more productive manner. Using our new UDT we can now more easily create multiple conveyors for our
packaging machine, while leveraging existing work. We can take this one step further, let us say that we work for an
OEM who builds packaging machines. 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. In our example we could
develop code for a simple conveyor. Now think about a machine or a system that would have a conveyor, a pump, a
safety gate etc. on it, you could develop a UDT and associated ladder code for each of these machine parts. Reusable
code can be a great way to increase productivity.
Reusable Code can be a valuable tool to increase productivity and decrease engineering development time.
While a UDT is not a direct corollary to Object Oriented Design it is very similar. In Object Oriented Design
terms when we created the new data type Conveyor we created a Class. We then Instantiated an Object
called Conveyor_1. We could Instantiate multiple instances of the Class Conveyor by creating multiple
Objects each with a unique name, one object for each conveyor on our machine.
Study the diagram below to get a base understanding of our accomplishments
UDT Conveyor_1
New Data
Type
Conveyor Conveyor IN_Feed_Conveyor
89 of 145
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.
21. Open the Data Types User-Defined folder in the Controller Organizer and Double Click on the Conveyor UDT.
22. Add a new member call Part_Count with a Data Type of DINT. Click on OK when complete.
23. A warning screen will pop-up acknowledging that a tag and uses the Conveyor UDT will be changed. Press
Yes.
90 of 145
24. In the Controller organizer, Double Click on Controller Tags.
25. Expand the + next to the Conveyor_1 tag. Observe that are new Part_Count member has been added to our
Conveyor_1 tag.
91 of 145
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.
27. The following window will appear. Be sure the Edit Tags tab is selected. Scroll to the bottom of the screen and Click on
the white space at the bottom in the Name column. Type Conveyor.
Note: Start typing in the space shown below inside of the red box. Once you begin type a new row will be added for
the new tag.
28. Select the Conveyor UDT for the Data Type with a Dim 0 of 25. Press OK
92 of 145
29. The New Conveyor tag is shown below.
31. Expand the + next to the Conveyor tag. Expand the + next to the Conveyor[1] tag, Conveyor[2] tag, Conveyor[3] tag,
etc. Observe that the Conveyor UDT is used for each array index of the new Conveyor tag.
This is a very powerful tool to create multiple conveyor instances very quickly in Studio 5000 Logix Design. Each Conveyor
array index could point to an actual conveyor used in a system. 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.
93 of 145
Lab Summary
To be truly effective our new UDT would need some associated ladder code to go with it. In following reusable code principles
this code would be developed and saved for use in conjunction with our UDT. This UDT and ladder code would be capable of
being used on our current machine and all future machines. The ladder code specific to our conveyor will not be covered here. In
the spirit of reusable code this ladder code could be placed in an Add-On Instruction (AOI). AOIs will be discussed in greater
detail in the next Lab.
We have learned:
Some basic principles of the tag structure of a Logix controller.
How self-descriptive nomenclature can help us more quickly and easily develop a program.
Laid a foundation for the concept of reusable code.
Congratulations!
You have just finished this Lab
Click to Proceed to Contents
94 of 145
Lab 7: Add-On Instructions (AOI) <25 minutes>
Add-On Instructions may be created using the standard Ladder, Function Block Diagram, and
Structured Text editors already available in Studio 5000 Logix Designer. Once created, an Add-On
Instruction may then be used in any of the Studio 5000 Logix Designer editors without any additional
effort on your part. 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. Custom help for your instructions makes it easier for users to have a successful application
of the Add-On Instruction.
Finally, 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.
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. We will then use the Add-On instruction in another project to show how much time you can save with them. 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
95 of 145
AOI basics
This section provides an overview of the basic parts of an Add-On Instruction and their uses
1. General Information
The General tab contains the information from when you first created the instruction. You can use this tab to update the
information. The description, revision, revision note, and vendor information is copied into the custom help for the instruction. The
revision is not automatically managed by the software. You are responsible for defining how it is used and when it is updated.
2. Parameters
The Parameters define the instruction interface; how the instruction appears when used. The
Parameter order defines the order that the Parameters appear on the instruction call.
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.
96 of 145
3. 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.
4. Data Type
Parameters and Local Tags are used to define the data type that is used when executing the
instruction. The software builds the associated data type. The software orders the members of the
data type that correspond to the Parameters in the order that the Parameters are defined. Local Tags
are added as hidden members.
5. Logic Routine
The Logic routine of the Add-On Instruction defines the primary functionality of the instruction. 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.
97 of 145
6. Optional Scan Mode Routines
7. Change History
The Change History tab displays the creation and latest edit information that is tracked by the
software. The By: fields show who made the change based on the Windows user name at the time of
the change.
98 of 145
8. Help
The Name, Revision, Description, 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. The Instruction Help Preview shows how your instruction will appear in the
various languages, based on Parameters defined as Required or Visible.
9. Open CLX_S7_00.ACD using the File > Open menu browsing to C:\Lab Files\ L18 - Studio 5000 and Logix
Advanced Lab\ Lab 7 AddOn Instructions AOI folder.
a. Look at your demo case and determine what type of controller you have and what slot it is in. Note:
CompactLogix controllers do not use slots.
b. If your controller is not a 1769-L36ERM then you must change the processor type in the project to
match what you actually have.
c. If it is not in Slot 1 then you can re-configure the demo case to match the project.
11. From the Controller Organizer, expand the Conveyor program folder.
Currently each conveyor code section is made up of one Program and four Routines. By using an AOI we can
reduce all of this to one custom instruction that can be used anywhere in the application.
99 of 145
12. Right click on the Add-On Instructions folder and select New Add-On Instruction… from the drop-down
menu.
100 of 145
15. The instruction definition should open.
16. 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)
101 of 145
‘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.
17. 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.
102 of 145
18. Click the Local Tags tab and enter the tags as shown.
21. From the Controller organizer locate the C_Start_Stop routine and double-click it to open it.
22. From the toolbar menu select Edit > Select All.
This will select all the rungs in the routine.
24. Expand the Add-On Instructions folder if it is not already expanded in the Controller organizer.
103 of 145
27. Delete the empty rung.
28. All of the logic should now appear without any errors.
Note: Errors may occur if the tags were not typed in correctly in the definition of the AOI. A complete working
example is provided in the next step so don’t worry if errors exist at this point.
29. Close the file within Studio 5000 Logix Designer using File > Close. Respond with No if prompted to save the
file.
That’s it. We just created our first Add-On Instruction. 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.
In the next section we will open an existing program and begin working with a complete AOI.
30. Open CLX_S8_00.ACD using the File > Open menu browsing to C:\Lab Files\ L18 - Studio 5000
and Logix Advanced Lab\ Lab 7 AddOn Instructions AOI folder.
This file has the completed Conveyor_Core AOI already done for you. All three Routines that make up
one conveyor have been combined into one custom instruction.
31. Expand the AOI until you can see the Logic and Parameters.
104 of 145
32. Right click on Conveyor_Core and select Open_Definition.
This will open the definition so you can see all the tags that are now part of the instructions definition.
34. Notice which ones are marked REQ and VIS. This will determine how the instruction looks and acts
once we place it in an application.
36. You should see all the logic that was in the three routines we used to have. Ten rungs total.
105 of 145
Let’s use it
37. Open Conveyor_1 routine for editing by expanding the Main Task and Conveyor program and then
double clicking on the Conveyor_1 routine. (We created this Routine already to save time)
38. You should see a blank rung and a new Add-On menu choice.
39. Select the Add-On tab and then click the Conveyor button.
AOI tag structure: At this point the instruction behaves like any other Studio 5000 Logix Designer
instruction. It has inputs and outputs that need to be defined and other parameters that need to be
filled in – just like a Timer does.
106 of 145
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. These fields show the
current values of those parameters.
41. Right click on the first question mark and select New Tag.
Conveyor_Core
107 of 145
Note: Data Type is Conveyor_Core. This is what we named our AOI. This follows the same
conventions as any other built in instruction in Logix. If this were a TON instruction, the Data Type
would be Timer.
44. The rest of the arguments are inputs. We can assign some real I/O to these inputs the way we would
for any other input arguments.
45. Double click on the Motor_Overload_Input question mark and maneuver down to pick input 0 as
shown.
46. Do the same for the rest of the inputs, selecting sequential input points for each input in the
instruction, until all of the question marks are gone.
108 of 145
48. 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
49. Click on the Motor_Overload_Input address and type My_Motor_Overload. After you accept it you
should see Question marks for the value because the entered tag name does not exist yet.
109 of 145
50. Right click on the new tag name and select New “My_Motor_Overload”
51. Fill in the dialog as shown. Make sure you fill in the Alias part as shown by using the pull down menu
and selecting the correct I/O point.
110 of 145
Using an Add-On Instruction Output in Ladder
53. Create the rung pictured below to demonstrate how to access non-visible tags from an AOI programmatically.
How do you know what the internal elements are named? The AOI follows the same conventions as any other instruction does.
Tag Name
Parameter
54. Create a new Routine named Conveyor_2 by right clicking on the Conveyor Program and then
selecting New Routine.
55. Fill out the dialog as shown specifying Function Block as the Type and click OK button when you
are finished.
111 of 145
56. Double click on the new Conveyor_2 routine to open it.
57. Select the Add-On tab and click the Conveyor button. The Conveyor instruction will be added to
the page.
The pins associated with parameters designated as Visible in the instruction definition are visible on
the instruction by default.
The data tag for the instruction Conveyor_Core_01 has already been created. This conforms to the
behavior of any instruction created in the Function block environment.
The Nub at the end of the input pin is an indication that this parameter requires a connection. The
instruction will not successfully verify until all “Required” parameters have connections.
112 of 145
58. Click the Input Reference (IREF) button six times as the AOI requires six inputs.
59. 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.
60. Select unused addresses for all the IREF’s as shown below for the required input points.
You could use an Alias here just like we did for the RLL instruction.
61. The instruction will now verify. Notice the is gone from the upper left corner.
113 of 145
Re-using an AOI
Remember in Lab 3 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. In this section we will also apply security to a
routine and an AOI.
1. Continue working with CLX_S8_00.ACD file. (should be the file that you currently have open)
2. From the Controller organizer in our Conveyor application, right click on the Conveyor_Core AOI and
select COPY.
3. 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. Begin a new file by selecting New Project from the Quick Start page.
114 of 145
5. Select a Logix Controller. For this example we selected a 1756-L75. Enter the Name AOI_LAB
7. Fill in the resulting dialog box as shown below: Use the latest version of Logix
115 of 145
9. From the Controller organizer right click on Add-On Instructions and pick Paste.
10. The Conveyor_Core AOI should now be present and ready for our use in the new program.
11. Close this instance of Studio 5000 Logix Designer. Respond with No if prompted to save the file.
AOI Signatures
Copying and Pasting requires you to have two instances of Studio 5000 Logix Designer open at the same time. This
is fine if you are using your own AOI’s. How do you send someone else a copy of the AOI? What if you want to
apply security to the AOI? Perhaps you want the other user has edited the AOI?
AOI Signatures allows the application developer to monitor changes to an AOI. The AOI signature value can be
monitored to record “version” of AOI that was created. Users can view AOIs with Signatures, but they will need to
remove the Signature to edit the AOI. .
116 of 145
Applying Signatures
1. Continue using the CLX_S8_00.ACD file. Before we export the Conveyor_Core AOI we will apply a signature to it. Then
we will import it into a new ACD file.
2. In the Controller Organizer, Navigate to the Conveyor_Core AOI. Double Click on the AOI to display it’s
properties. Navigate to the Signature tab, shown below.
4. A warning message will be displayed. Press Yes to confirm and generate the instruction signature.
117 of 145
Note: AOIs with Signatures cannot be modified. The AOI signature will need to be removed before the
AOI can be modified. There is not any security on removing AOI signatures, so anyone can remove the
Signature and change the AOI. But, if a new AOI signature is created it will not match the original
signature.
6. In the Controller Organizer, the icon for the Conveyor_Core AOI has now changed since a Signature has been
added. The blue dot in the icon indicates that the AOI has a signature.
118 of 145
Export AOI
Now, we will export the AOI and then import it into a new Studio 5000 Logix Designer application.
7. In the Controller Organizer, Right Click the Conveyor_Core AOI and Select Export.
Note: Include all referenced Add-On Instructions and User-Defined Types checkbox in the Export AOI
dialog box that is unchecked. If we had referenced other AOI’s (nested) we would have wanted to
check this box.
119 of 145
8. Enter a File Name for the AOI and then Press Export.
Note: Remember the folder name that you exported the AOI to.
12. 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
13. Begin a new file by Selecting New Project from the Quick Start page.
120 of 145
14. Select a Logix Controller. For this example we selected a 1756-L75. Enter the Name AOI_LAB
16. Fill in the resulting dialog box as shown below: Use the latest version of Logix
121 of 145
18. In the Controller Organizer, Right Click on the AOI Folder and Select Import Add-On Instruction.
19. Browse to Conveyor_Core.L5X file that you created above and Press OK.
20. This will bring up the Import Configuration Wizard. Our Operation is to Create a new AOI in this new
application.
22. Now you can view the imported AOI in the new Studio 5000 Logix Designer application.
122 of 145
23. You can also compare the AOI Signature values in each of Studio 5000 Logix Designer application. They will
match.
10. 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. 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 saw that we can develop complex code segments and ship them to customers that need. We can
apply signatures to AOIs that will allow customers to view and change the code inside, but give use indication that
something has changed.
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.
Congratulations!
You have just finished this Lab
Click to Proceed to Contents
123 of 145
Lab 8: Using a SD card with a Logix Controller <10 minutes>
Note: Get a pre-loaded SD card from one of your lab instructors before beginning
the lab.
Opening an Existing Controller Project
In this section of the lab, we load the controller project.
2. Navigate to the link below and double-click the project named CLX_S13_00.ACD to open it in Logix Designer.
You can find the project in this directory: C:\Lab Files\ L18 - Studio 5000 and Logix Advanced Lab\ Lab 8 Using a SD
card with a Logix Controller
NOTE: This may take up to a minute to open.
a. The project was written for a 1769-L36ERM controller.
i. Look at your demo case and determine what type of controller you have and what slot it is in.
Note: CompactLogix controllers do not use slots.
ii. If your controller is not a 1769-L36ERM then you must change the processor type in the project to
match what you actually have.
iii. If it is not in Slot 1 then you can re-configure the demo case to match the project.
124 of 145
4. Expand the Ethernet/IP Driver AB_ETHIP-1
5. Select 192.168.1.7, 1769-L36ERM. You do not need to expand the controller. Press Download.
8. If not prompted, changed the controller mode to Remote Run in Studio 5000 Logix Designer.
Note: SD card Logix functions are the same as the CompactFlash function used
in prior Logix controllers.
Note: All of the current Logix controller us SD cards. An SD card comes shipped
with every controller.
125 of 145
9. Double Click to open Controller Tags in the project tree.
10. Expand the + symbol next to the tag CF_RW_functions and expand the + symbol next to
CF_RW_functions.strings array member. Make sure you are Monitor Tags and not Edit Tags.
126 of 145
12. Names of files and directories found on the SD card are displayed in the
CF_RW_Functions.string’ array members.
The 8 function is a list command. Equivalent to a DOS ‘dir’ or Unix ‘s’ command. It lists all files and
directories. Using the ‘name’ member you can search for specific file or directories. Simply set the
tag ‘name’ to *o* and it will display all files with an ‘o’ in the name.
13. Enter a 1 in the command member. It will disappear and so will result and string values.
The 1 function is a clear command. It clears all values for arrays used to message the controller. It
does not send any messages to perform SD card operations.
127 of 145
14. Enter a 9 in the command member. It will disappear, and in the ‘string’ values, we see the list of
files with attributes listed and sizes in Kbytes.
The ‘9’ function is useful for viewing files and their attributes including size.
Create a Directory
15. Enter a 10 in the command member. It will disappear, and in the ‘string’ values, we see the list
of directories on the SD card.
16. Enter NewDirectory in the CF_RW_functions.name member. Set the Command value to 7.
You have now created a directory called ‘NewDirectory’.
17. To verify this result, set the Command to 1 and then set to 10.
128 of 145
Create, Edit, and Delete a File
18. Set the Name member to mistake.tx. Set the REQ_Length to 235 and then Set Command to 3.
20. To verify this result set Command to 1 then to 8. You will see mistake.tx in list of files on the SD
card.
21. Now we will rename this file since we have a mistake in the file extension. Set name member to
mistake.tx. Set newname member to correctedmistake.txt and then set Command to 6.
22. Check the result and see that the name was changed. Set Command to 1 then to 8. The name
has changed in the list.
23. To delete the file, Set Name member to correctedmistake.txt and Set the Command to 5.
24. Check the result and see that the file was deleted from the SD card. Set Command to 1 then to
8.
Note: You may have additional files on your SD card.
129 of 145
Read Data from SD card
25. Now you will read data from the SD card and compare to how the file looks on a PC. Open
Fivek.txt in notepad by browsing to C:\Lab Files\ L18 - Studio 5000 and Logix Advanced Lab\
Lab 8 Using a SD card with a Logix Controller\Files to be placed on SD folder in windows
explorer. It is simply a repeating pattern of alphabetic characters.
26. Revert back to Studio 5000 Logix Designer and the controller tags window. Set Name member to
fivek.txt. Set REQ_Length member to 200 and the Command to 2. Expand the
CF_RW_functions.data array and set Style to ASCII. Compare this to the data we see in
Notepad.
130 of 145
27. Set the Offset member to 990 and then set Command to 2. Array elements 7-9 are now ‘X’, ’$r’,
and ‘$I’. In Notepad, this corresponds to the end of the tenth line, where control characters
represent Carriage Return and Line Feed. The offset is the number of bytes from the start of the
file, where the code starts to read. Since all the lines in the text file are exactly 100 characters,
that means just before the end of the tenth line.
28. In Studio 5000 Logix Designer, expand the Check_CFcode program and double click to monitor
the Parameters and Local Tags. Use the +, to expand the active_recipe tag. Fill in some
names and values or use the ones provided.
Note: Names and values where already populated. You can change them to verify that then are
loaded on the SD card in a latter step.
131 of 145
29. Open the Recipe_Handling routine and trigger rung 0 (toggle the bit store_recipe2recipe1). It
will immediately reset back to 0. Switch back to Controller Tags (CTRL-Tab) or double click
Controller Tags again to see that DN_Length and Result are both equal to 216.
30. Return to Check_CFcode and double click on Parameters and Local Tags again. Change
some names and values in the active_recipe tag.
31. Open the Recipe_Handling routine and trigger rung 2 (toggle the bit load_recipefromrecipe1).
32. Check the values by double clicking on Parameters and Local Tags. The values were read back
from the recipe 1 file.
132 of 145
33. Open the Recipe_Handling routine and trigger rung 1 (toggle the bit store_recipe2recipe2).
34. Switch back to our Controller Tags window. Set Command to 1 then to 8. Two extra files called
recipe1 and recipe 2 have been created on the SD card.
35. If a SD card reader has been provided, you may want to view the files. Please remove the
controller and carefully place the SD card into the reader. Please feel free to view the files you
created and how the data appears.
133 of 145
Lab Summary
Use of an industrial SD card is recommended (part number 1784-SD1; 1GB Capacity) for reading and
writing data. One must make sure the card is formatted correctly to accept file reads and writes. This
open interface to read and write data allows the user a number ways in which to use this feature.
Warning: The life expectancy of flash media is strongly dependent on the number of write cycles that are
performed. Even though flash media controllers use wear leveling, users should prevent frequent writes.
This is particularly important when logging data. The best approach is to log data to a buffer and write that
buffer data to the SD card.
Congratulations!
You have just finished this Lab
Click to Proceed to Contents
134 of 145
Lab 9: Controller Change Log <10 minutes>
2. Navigate to the link below and double-click the project named CLX_S14_00.ACD to open it in Logix
Designer.
You can find the project in this directory: C:\Lab Files\ L18 - Studio 5000 and Logix Advanced Lab\ Lab 9 Controller
Change Log
NOTE: This may take up to a minute to open.
a. The project was written for a 1769-L36ERM controller.
i. Look at your demo case and determine what type of controller you have and what slot it is in.
Note: CompactLogix controllers do not use slots.
135 of 145
ii. If your controller is not a 1769-L36ERM then you must change the processor type in the project to
match what you actually have.
iii. If it is not in Slot 1 then you can re-configure the demo case to match the project.
5. Select 192.168.1.7, 1769-L36ERM. You do not need to expand the controller. Press Download.
8. If not prompted, changed the controller mode to Remote Run in Studio 5000 Logix Designer.
136 of 145
9. Expand the Tasks folder in the controller organizer the project tree to reveal the following
MainProgram and its associated routines.
12. Toggle the Start bit by right clicking the XIC and selecting Toggle Bit or select the XIC and press
Ctrl-T on Rung 1. This starts the initialization routine preconfigured in the code that configures
message instructions for the proper slot number of the controller. This will ensure that all of the
message instructions will have the correct path.
137 of 145
13. Double click to open the Counters routine. Each rung has a different Get System Value or Set
System value associated with the Controller logging. Each of the GSV instructions works as
described below.
Total Entry Count Number of entries added to the log since the last time the value was reset.
Unsaved Entry Count Number of entries in the controller RAM not yet written to the SD card.
Exec Modify Count Number of entries that are related to modifications to the behavior of a running controller such as
program/task properties change, online edit, controller timeslice modification, and I/O & SFC forces
(optional).
138 of 145
Rungs 4 and 5 allow us to programmatically set or reset the Modify execution Count and Total
Entry Count values via Set System Value (SSV) instructions.
14. Turn the controller key switch on the demo box to Program mode. Now switch the controller
back to Run mode. The ControllerLogTotalEntryCount is incremented by 2, because the
change to Program mode is logged and then change to Run mode is logged.
15. Double click to open the Commands routine. It contains a series of message instructions to
configure when and how often the controller writes to the SD card. Additionally, a user may
choose to add/remove the logging of program forces and also the ability to create a custom log
message. Rung 1, when toggled true, will write from internal controller memory to the SD card.
This is currently done on command by toggling the Write bit.
Note: The write message will error out if no SD card exists in the controller.
16. Rung 2 is a message that can be used to turn on and off the automatic write to a SD card. Rung
3 is a GSV that reads that status back. By setting the Controller to Automatically Write Entries to
the SD card, at 80% of the controller’s internal memory the log entries will be automatically be
copied to the SD card.
Using the MSG instruction to read back the results of a MSG to set a value is good programming
practice to see that your configuration message was received.
139 of 145
Rung 4, 5, and 6 are to configure whether you log I/O forces or Sequential Function Chart forces that
take place in the program. Rung 4 is the configuration bit which is messaged to the controller. Rung
5 is the message instruction that sends that configuration bit to the Controller. Rung 6 is a MSG that
reads that status information back.
17. Rungs 7 and 8 are to configure a custom log entry. In addition to the default types of changes
that will be logged automatically, a user is able to configure custom messages to be logged. In
this case, Rung 7 triggers the CustomEntryFormatting subroutine which populates a tolerance
value into a string. Rung 8 is used to message the formatted string structure to the controller to
be placed into the log file.
18. Custom Entry Logging will allow a user to setup a number of different entries to be triggered in
the user program. Parameter changes, I/O state changes, or custom process related alerts are
examples of log entries that could be useful to a programmer to troubleshoot or track important
information for a system. The log entries are limited to the ideas of the programmer.
19. Toggle the SendCustom bit by right clicking the XIC and selecting Toggle Bit or select the XIC
and press Ctrl-T on Rung 8.
20. Open the MSG properties by clicking the ellipsis button on Rung 8.
140 of 145
21. The message configuration tab comes into view. Under the Service Type drop down selection
you can view all the Controller Logging Message types. In this instance, Log Add Entry type,
we see that CustomLog is the source element which is messaged to the controller.
22. Select the communications tab in the CIP message path to the controller. 1 is the default start to
any message instruction to point to the backplane of the rack and 0 is the slot of the controller.
141 of 145
All of the message instructions were setup by the program when we set the Start bit in the Main
Routine. If we want to configure a message to point at a specific controller then select the browse
button and point it to our controller. Notice it shows our path of 1,0 by selecting the controller from
the project tree.
24. Let’s create a few log entries to look at when we open our log entry file. In the Online Tool Bar at
the top left, Select and Enable All I/O Forces then Disable All I/O Forces.
25. Again, In the Online Tool Bar at the top left Select and ‘Enable All SFC forces’ then Disable All
I/O Forces.
142 of 145
26. Next, Open the Controller Properties. Then click on the Advanced tab.
27. Change the System Overhead Time Slice to a different number like 20%. Click OK button.
28. Minimize Studio 5000 Logix Designer. Right click and open the file ControllerLogSample.txt
with Notepad or Microsoft Excel contained in C:\Lab Files\ L18 - Studio 5000 and Logix
Advanced Lab\ Lab 9 Controller Change Log folder.
a. Or if you have a SD card reader for you lab computer you can view the log file. It is a
.TSV file that is stored on the root directory of the SD card.
Note: For lab simplification we may not be able to read an SD card with the lab computer. The file
provided is a replica of what we might find after making the changes performed in the lab.
The top left corner specifies the type of file, date of file, type of controller, serial number, and firmware
revision of the controller.
143 of 145
In each controller log entry a sequential record number and time are recorded. An entry description
details what occurred. A windows PC user name is associated with the workstation that the changes
were made from. If the plant software is using a FactoryTalk application then a logged in Factory Talk
user is also tied to the change. Finally, any extended information like the tolerance values for our custom
machine out of tolerance message are shown.
Lab Summary
You should now have a better understanding of how to implement Controller Logging and the features available. Knowing and
understanding changes that were made to a controller aid in troubleshooting field issues in a variety of applications.
Congratulations!
You have just finished this Lab
Click to Proceed to Contents
144 of 145
Copyright© 2014 Rockwell Automation, Inc. All rights reserved.
145 of 145