Studio 5000 Logix Designer Basic Lab Manual
Studio 5000 Logix Designer Basic Lab Manual
This documentation, whether, illustrative, printed, “online” or electronic (hereinafter “Documentation”) is intended for use only as a learning aid
when using Rockwell Automation approved demonstration hardware, software and firmware. The Documentation should only be used as a
learning tool by qualified professionals.
The variety of uses for the hardware, software and firmware (hereinafter “Products”) described in this Documentation, mandates that those
responsible for the application and use of those Products must satisfy themselves that all necessary steps have been taken to ensure that each
application and actual use meets all performance and safety requirements, including any applicable laws, regulations, codes and standards in
addition to any applicable technical documents.
In no event will Rockwell Automation, Inc., or any of its affiliate or subsidiary companies (hereinafter “Rockwell Automation”) be responsible or
liable for any indirect or consequential damages resulting from the use or application of the Products described in this Documentation.
Rockwell Automation does not assume responsibility or liability for damages of any kind based on the alleged use of, or reliance on, this
Documentation.
No patent liability is assumed by Rockwell Automation with respect to use of information, circuits, equipment, or software described in the
Documentation.
Except as specifically agreed in writing as part of a maintenance or support contract, equipment users are responsible for:
• properly using, calibrating, operating, monitoring and maintaining all Products consistent with all Rockwell Automation or third-party
provided instructions, warnings, recommendations and documentation;
• ensuring that only properly trained personnel use, operate and maintain the Products at all times;
• staying informed of all Product updates and alerts and implementing all updates and fixes; and
• all other factors affecting the Products that are outside of the direct control of Rockwell Automation.
Reproduction of the contents of the Documentation, in whole or in part, without written permission of Rockwell Automation is prohibited.
Throughout this manual we use the following notes to make you aware of safety considerations:
Identifies information 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.
Contents
Before you begin ......................................................................................................................................... 5
Section 7: Downloading the Project from the Computer to the Controller ............................................... 57
In this section of the lab you will download the project. ................................................................................................................ 58
Section 11: Creating and Using User Defined Data Types (UDT) .............................................................83
Creating User Defined Data Types ............................................................................................................................................... 83
Add the UDT Tag to an Instruction ............................................................................................................................................... 86
Monitoring UDT Tags .................................................................................................................................................................... 89
Notes ........................................................................................................................................................142
B. ControlLogix hardware (same as above) with an HMI faceplate, all located in cloud (e.g. onCourse)
C. Emulated Logix controller (FactoryTalk Logix Echo) with an HMI faceplate – local or cloud-based (e.g. onCourse)
Studio 5000 software includes the Logix Designer application for the programming and configuration of Allen-Bradley
ControlLogix and CompactLogix programmable automation controllers. Logix Designer is the progression of RSLogix 5000
software, and will continue to be the package you use to program Logix5000 controllers for discrete, process, batch, motion,
safety, and drive-based systems. Logix Designer offers an easy-to-use, IEC61131-3 compliant interface, symbolic programming
with structures and arrays and a comprehensive instruction set that serves many types of applications. It provides ladder logic,
structured text, function block diagram and sequential function chart editors for program development as well as support for the
S88 equipment phase state model for batch and machine control applications.
CompactLogix brings together the benefits of the Logix platform — common programming environment, common networks,
common control engine — in a small footprint with high performance. The CompactLogix platform is perfect for tackling smaller,
machine-level control applications, with or without integrated motion, with unprecedented power and scalability. CompactLogix
is ideal for systems that require standalone and system level control over EtherNet/IP, or DeviceNet. Think CompactLogix when
you need economical, reliable control.
Learn more at rok.auto/CompactLogix5380
ControlLogix controllers support intensive process applications and provide fast processing of motion instructions in a single
integrated solution.
ControlLogix provides modular network communications that let you purchase only what you need. Interface using ControlLogix
communication modules via a ControlLogix gateway, without the need for a processor in the gateway chassis, or interface
directly to a ControlLogix controller.
The ControlLogix solution also provides time synchronization capabilities, which is particularly useful in first fault and process
sequencing applications.
A GuardLogix controller is a ControlLogix controller that also provides safety control. The GuardLogix controller is used with a
safety partner to achieve SIL 3/PLe/Cat. 4. A major benefit of this system is that it is still one project, safety, and standard
together. The safety partner controller is a part of the system, is automatically configured, and requires no user setup.
1. Double-click on the Studio 5000 icon on the Desktop to launch Studio 5000 software.
▪ Select V34
▪ Select 1756-A7 7-Slot ControlLogix Chassis
▪ Select Slot 0
▪ Select No Protection
▪ Add a project description ‘Logix Basic Lab’
▪ Click Finish
Instructions
Tasks, Programs, toolbar
and Routines
Controller
Organizer User Defined and
Predefined Datatypes
I/O Configuration
Programming
area
In this section of the lab you will add code for a simple motor start/stop seal-in circuit. You will experience the ease of
programming with Studio 5000 software. During the labs we will only utilize ladder logic programming, but Logix controllers
also can be programmed using function block, sequential function charts, and structured text. This allows selection of the
programming language that best fits an application.
1. In the Controller Organizer expand the MainProgram folder by clicking on the arrow . Once expanded, the
MainRoutine will appear as shown below:
3. From the instruction toolbar, left click and hold on the Examine On (XIC) instruction.
4. Drag the XIC onto rung 0 until the green dot appears. Release the mouse button at the location you wish to
place your instruction.
5. From the instruction toolbar left-click and hold on the Examine Off (XIO) instruction.
6. Drag the XIO onto rung 0 to the right of the XIC instruction. Again a green dot will appear to the right of the XIC
instruction indicating where your new instruction will be inserted. Release the mouse button at the location you
wish to place your instruction.
Note - If you place an instruction in the wrong location on a rung, simply click and hold on the instruction
and drag it to the correct location.
7. From the instruction toolbar, left click and hold on the Output Energize (OTE) instruction.
8. Drag the OTE onto rung 0 to the right of the XIO instruction. Again a green dot will appear to the right of the XIO
instruction indicating where the OTE instruction will be inserted. Release the mouse button at the location you
wish to insert the instruction.
12. Place the branch over the green dot and release the mouse button.
13. From the instruction toolbar, left click and hold on the XIC instruction.
14. Drag the XIC onto your newly created branch until the green dot appears and release the mouse button.
15. Save the program by clicking on the Save icon on the toolbar. This will save the program in the default
directory, which is C:\Users\Labuser\Documents\Studio 5000\Projects
As you can see the free form editing in Studio 5000 can help speed development. You do not have to place
an instruction and tie an address to it before you add the next instruction.
In this section of the lab, you will create the tags needed for the program. In older traditional PLCs, a physical memory address
identifies each item of data, for example N7:0. In Logix controllers, there is no fixed numeric format. Tags are used instead and
can be given any name.
1. First create the tag Motor_Start. To do this, right-click on the ? of the first XIC instruction. It will be
highlighted blue. Select New Tag.
New Parameter or Tag - When you create a tag there are several attributes for a tag. The main attributes
we are interested in for this lab are as follows:
Usage: Defines a Local Tag or a Parameter Tag. We will use Local.
Type: Defines how the tag operates within the project
Base: Stores a value or values for use by logic within a project
Alias: A tag that represents another tag
Produced: Send data to another controller
Consumed: Receive data from another controller
Alias For: Only applies when the tag “type” is Alias. Defines the tag which the alias tag will reference.
Data Type: Defines the type of data that the tag stores. Example: Boolean, Integer, Real, String, etc.
Parameter Connection: Shows and allows selection of the parameter connected to this tag.
Scope: Defines how the data is accessed in the project. It is either controller scoped, global data
accessible throughout the controller or program scoped, data accessible for a specific program.
External Access: Defines the access external applications (HMIs) will have with the tag.
Read/Write: External application can read and write to the tag.
Read Only: External application can only read the tag.
None: External application cannot read the tag or write to the tag
Style: Display the tag value has Binary, Octal, Decimal, or Hex.
Constant: If checked, that tag cannot be changed programmatically.
Sequence: Allows Equipment Phase input/output tags to be used with FactoryTalk Batch Server.
Open Configuration: Opens the configuration wizard for complex tags (MSGs, PIDs, etc)
Open Parameter Connection: Opens the Connection Configuration window.
4. Right-click on the “?” of the XIO instruction and select New Tag.
For the XIC instruction in the branch we do not have to create a tag. You will use the tag Motor_Run.
10. Left click and hold the mouse button over the tag Motor_Run on the OTE instruction.
11. Drag the Motor_Run tag to the XIC instruction until a green dot appears next to the “?” and release the mouse
button.
The rung should now appear as shown below. Notice the “X” next to rung 0 has disappeared and that the rung color is no
longer red. This indicates that the rung passes auto verification and no errors are present.
Studio 5000 software verifies each rung automatically to make programming easier!
You will see if there are any errors in the output window.
This is useful to locate errors or incomplete rungs in larger projects that may have hundreds or thousands of
rungs!
Note that the output windows displays a combination of errors, warnings and messages. There might be
thousands of lines in the output window when working with larger projects, so the three filtering buttons and
the Search field might become very useful
14. Save the program by clicking on the Save icon on the toolbar.
The tag database of Logix versus a traditional PLC’s fixed memory addresses help you create self-
documenting code. This means you do not have to use address descriptions or symbols to make code
easy to read.
In this section of the lab, we will review the Tag Monitor/Editor in Studio 5000. The concept of Controller, Parameter, and
Program Local tags will be covered.
Notice that there are no tags present even though you just created three tags. These tags were created
at the Program Scope.
Notice a field in the upper left corner of the Tag Editor window labeled Scope. Earlier in the lab we talked
briefly about Controller and Program scoped tags. Currently the selection is Intro_Lab_Control_Project,
which will show controller scoped tags.
Local tags are isolated from other programs. Routines cannot access the Local tags of another program.
Thus you can re-use Local tag names across multiple programs.
We will not go into greater detail in this lab. Parameters are covered in the advanced lab.
The Tag Editor now has switched views to the program level and you see the tags you created earlier.
We will now configure I/O for the project. To communicate with I/O modules you must add modules to the I/O Configuration
folder (also referred to as the I/O tree).
This part of the lab covers adding 1756 I/O using the equipment at your lab station or virtual chassis.
1. In the I/O Configuration folder, right-click on 1756 Backplane and select New Module.
7. Click OK.
Electronic Keying – Keying determines what checks are performed between the controller configured I/O
tree and the module before an I/O connection is made. This helps guard against improper operation by
verifying the hardware matches with what is configured.
The following data is read and compared:
Vendor, Product Type, Catalog Number, Major Revision, Minor Revision.
The user may select one of the following module keying options during the initial module configuration:
- Exact Match – All of the parameters described above must match or the inserted module will reject the
connection.
- Compatible Module – The module determines if the settings are compatible. Generally, the IO module
checks the Module Type, Catalog Number, and verifies the revision of the hardware is equal to or
greater than that configured.
- Disable Keying – No keying used at all. This is not typically used.
Connection -- Input only modules use “Data”. Modules that include outputs use “Output”.
Data Format -- Determines the data structure for the tags that are associated with the module. With the
modules in this lab, the format used for digital input module is Timestamp Data.
15. Click on OK and then on Yes to “Change module definition” and close the Module Definition window.
17. In the Select Module Type window, type in “IF8” into the filter box and select the 1756-IF8I module.
21. Select the Voltage radio button and select the Input Range: 0V to 10V.
27. Select the Voltage radio button, and select the Output Range: 0V to 10V.
If necessary, drag
column to the right to
increase the size of the
Tag Name field. This will
allow you to view the
entire Tag Name.
Notice by looking in the upper-left corner of the tag editor that Controller Scope is selected. All I/O module tags are created in
the Controller Scope. Modules that reside within the controller chassis are called “Local”.
The above entries are tag structures for the modules you added. They contain more tags than are actually
displayed. Note the arrow next to the tag name. This indicates that you can expand the tag structure to see
more information.
Aliasing
An Alias tag lets you create one tag that represents another tag.
Both tags share the same value
When the value of one of the tags changes, the other tag reflects the change
Use Aliases in the following situations:
-Program logic in advance of wiring diagrams
-Assign a descriptive name to an I/O device
-Provide a simpler name for a complex tag
-Use a descriptive name for an element of an array
The Tag Properties window for Motor_Start will appear. Currently the tag is defined as a Base tag.
3. Select Alias as a type and notice that the Tag Properties window changed.
The view on the screen will change to view only your controller-scoped tags
Motor_Start will now be aliased to Local:3:I.Pt[0].Data, which is the first input point on the 1756-IB16IF module.
9. When you are finished the ladder code should appear as follows:
10. Save the program by clicking on the Save icon on the toolbar.
In this lab, we will learn to configure a driver in FactoryTalk Linx Network Browser. We will complete the following steps:
▪ Launch FactoryTalk Linx Network Browser
▪ Configure a communications driver
1. Minimize Logix Designer and then Double-click on the FactoryTalk Linx Network Browser icon
on the desktop to launch the communication software to bring up the FactoryTalk Linx Network Browser
window.
Ethernet/IP driver is created automatically during the FactoryTalk Linx installation process. This means that
it is not necessary to create one.
The steps below show ow to create another Ethernet/IP driver, which might be necessary when
communicating with different networks.
4. Change the name of the driver from the offered one to AB_ETHIP-LAB as shown and in the Discovery method
drop-down list select Broadcast.
The images below describe the parts of the different versions of lab station that you might work with:
A. ControlLogix 1756-L85E demo box
B. ControlLogix hardware with an HMI faceplate, all located in cloud (e.g. onCourse)
C. Emulated Logix controller (FactoryTalk Logix Echo) with an HMI faceplate – local or cloud-based (e.g. onCourse)
If your controller was in the RUN mode prior to the download, you may be prompted to return to the RUN
mode:
6. If the following prompt appears, click Yes to change the controller mode to Remote Run.
I/O Mapping
For the lab there are push buttons and lights. Depending on the lab format you use, these are
• either on the physical demo box,
• or within the FactoryTalk View client (HMI running on the desktop)
or
The push buttons and lights are mapped as follows:
Motor_Start = DI0
Motor_Stop = DI1
Motor_Run = DO0
1. If not already in run mode, click the Controller Faceplate and select Run Mode.
• If using Emulator, the status can be seen in FactoryTalk Logix Echo Dashboard
Open the Device Status pane [1] and expand the properties of emulator CLX5580_slot00 [2]:
The controller state can also be verified through Studio 5000 by viewing the controller faceplate.
2. From the Controller Organizer expand the MainProgram by clicking on the arrow .
You will now see the ladder logic. Notice the green power rails on both sides of the ladder. This indicates you are online and
the routine is executing.
Notice that the XIO instruction Motor_Stop is green. This means that this instruction is in the ‘true’ or ‘on’ state. This is
because the Motor_Stop pushbutton is not pressed.
This correlates to the XIO instruction for Motor_Stop. Notice the instruction is no longer green while the DI1 button is pressed,
because the instruction is no longer true.
6. Verify that output DO0 (Motor_Run) stays illuminated when you release pushbutton DI0 (Motor_Start).
The ladder logic you have just written is a simple 3-wire control or motor start/stop seal-in circuit.
4. Double-click the ‘?’ by the source in the MOV instruction and select Local:5:I.Ch[0].Data by double-clicking the
tag. You might have to scroll down to find the Channel data tags.
1. Select rung 0. Right click in the blue highlighted area to the left of rung zero and select Start Pending Rung
Edits.
The rung with the lowercase ‘i’s on the power rails is the rung you will perform the edits on.
3. From the Instruction Toolbar click on the Timer/Counter tab, click the Timer On (TON) icon.
A timer is inserted into the code to the right of the OTE instruction.
In Studio 5000 Logix Designer you can string output instructions together in series. Branches are not
required.
4. On the timer instruction right-click in the blue area next to the word Timer and select New Tag.
6. Verify that the tag has been created in the timer instruction as shown below:
In Logix the Timer Preset is a 32-bit DINT which means the maximum value for your timers can be:
2,147,483,647
9. Press Enter. The TON instruction should now appear as shown below.
The Preset value is now 32767 milliseconds (= 32.767 seconds). Leave the accumulated value set to zero. You are now ready
to verify the edits you made.
2. Verify that DO0 (Motor_Run) illuminates and the Timer accumulator starts increasing.
5. Turn (or Slide) the AI0 (or AIN0) potentiometer half way.
6. Verify that the AO0 (or AOUT0) meter reads approximately 5 Volts.
7. Turn (or Slide) the AI0 (or AIN0) potentiometer all the way to the right (MAX).
This will be done online with the program from the previous Lab.
Alternatively, you can start by downloading project file C:\Lab Files\_1_Basics Logix\Completed Lab Files\Intro_Lab_9.ACD
to controller
Trending
Basic trending in Studio 5000 allows you to view data sampled over a time period in a graphical display.
Data is sampled at a periodic rate that is configurable from 1 milliseconds to 30 minutes. Studio 5000 will
allow you to create a trend and save it as part of your project file.
Basic trending has these constraints: you can trend data elements of type BOOL, SINT, INT, DINT, and
REAL, you are also limited to sampling eight unique data elements in a single trend.
1. From the Controller Organizer, under Assets, right click on Trends and select New Trend.
3. Click Next.
The New Trend Add/Configure tags window appears.
This will allow the trend to monitor the input from AI0.
5. Let’s also trend the timer accumulator value. The timer the tag was created in the Program Scope, so we must
select the MainProgram tags as shown below. Select the Select tag drop down arrow.
7. Select Timer.ACC and then click the Add button. This will add the tag Timer.ACC to the Tags to Trend list.
8. Click on Finish.
The Trend window will now appear.
11. Change the Chart time range - Time span from Second(s) to Minute(s).
14. Press the DI1 pushbutton then push the DI0 and watch the trend capture the data of the Timer.ACC.
15. Try moving the AI0 slider input and verify that you see the trend recording the input:
By default, each tag will be independently scaled to its observed min/max values. If desired, the scaling
options can be changed under the chart properties - Y axis tab.
There are also other options in the trend properties such as a start and stop trigger and pen colors.
16. When you are finished investigating the trend, click Stop and close the trend window.
This lab section covers creating and using custom data structures.
▪ Create a User Data Defined Type (UDT)
▪ Create a tag from a UDT
▪ Use the tag in an instruction
▪ Use the tag monitor/editor to see the tag
1. Right-click Data Types under Assets in the Controller Organizer and select New Data Type…..
3. Fill in the description field with “Holds gallons and the equivalent in liters” as shown.
5. Double-click the Data Type field on the same row and type in REAL.
7. Click Apply.
9. Double-click on Parameters and Local Tags under the MainProgram as shown to open the tag window.
11. On the blank row, type in “Gallons_to_Liters” for the tag name.
12. On the same row, select “Gallons_to_Liters” for the Data Type as shown and click OK.
13. Click on a different row or tag to make sure the tag is accepted. The data type column for the
Gallons_to_Liters tag will turn gray when it is accepted.
3. Find the Compute/Math tab on the instruction tool bar and click on the MUL instruction.
Note: the Gallons_to_Liters tag will need to be expanded to select the Gallons member.
5. Enter ‘3.785’ for Source B (the conversion constant to convert gallons to liters).
6. Double-click on the “?” in the destination field and select the Gallons_to_Liters.Liters tag as shown.
Notice that the values of the tags are shown on the instruction. The multiply instruction converts the number in gallons to
liters.
8. Click on the number 0 just below gallons, type “34” or any desired value, and press enter. Notice that the Liters
value updates automatically.
1. Double-click the Parameters and Local Tags under the MainProgram and expand the Gallons_to_Liters tag.
Notice the values are also shown here. Make sure to select the Monitor Tags tab.
2. The values for gallons can be modified directly in the monitor screen by changing the value in the Value column.
Change the gallons value and watch that liters updates to corresponding value.
The UDT allows associated data to be stored under a single main tag instead of using completely separate
tags. This makes it easier to keep track of data and keep it more organized. The UDT name itself can
document what the data is for.
3. In the upper-left portion of the Echo interface, click the ‘hamburger’ icon to open the Devices menu:
Notice that you have the option to Add Controller manually or Add Controller from ACD. Select Add Controller
from ACD:
4. Navigate to C:\Lab Files\_1_Basics Logix\Completed Lab Files and open the Intro_Lab_11.ACD file.
7. Exploring the Logix Echo interface further, on the right-side, you can see a vertical toolbar with buttons for various
functions.
o Click the Device Status button near the middle of the toolbar to open the Device Status pane, and
then
o Click the small triangle to the left of your Intro_Lab_Control_Project device to expand it:
8. Leaving Logix Echo open, launch Studio 5000 from the desktop shortcut:
9. Select Open > Existing Project > Project File
10. In the Open Project dialog box, navigate to C:\Lab Files\ _1_Basics Logix\Completed Lab Files and double-click
Intro_Lab_11.ACD to open it (alternatively, you can open the project you previously saved):
With our ACD file opened, we now need to set the Communications Path to the Logix Echo controller we created previously.
11. Select Communications > Who Active from the menu bar. Expand the Ethernet, EmulateEthernet branch and
select our Logix Echo controller: 127.0.0.1, 9310-WED300ENT, Emulate 5580 Controller:
12. Click Download and then confirm again by clicking Download to download your project file to the Logix Echo
controller.
13. When the download operation completes, the controller will remain in Rem Prog mode.
Change the controller to Run Mode and confirm your change by clicking Yes when prompted:
Notice that you were able to directly load an L85 Project to the Echo Controller without any modifications and now you
can interact with the emulated Echo L85 controller, just as if it was a physical L85 controller.
Congratulations! You have completed the Studio 5000 Logix Designer Basic lab! If
time permits, feel free to explore additional topics in the Appendices section below.
In this lab, we will learn to add and configure a periodic task and add a program and routine with some logic. This will also be
done while online with the controller. It will be shown that multiple tasks are running.
The New Task window appears. In this window we can configure the properties of a task.
3. Click OK.
Logix controllers have three task types: Continuous, Periodic, and Event.
Continuous – Runs at the lowest priority of any task and can be interrupted by other tasks. The continuous
task is designated by a symbol with a circular arrow. There can be a maximum of 1
continuous task.
Periodic – Executes at regular intervals and can be assigned different priorities. It is designated by a blue
clock symbol. There can be multiple periodic tasks.
Event – Triggers on specific events. This allows code to execute as quickly as possible
when some event happens. For example, a counting instruction can quickly be executed whenever a
photeye turns on to get an accurate count of parts.
4. Right-click on the My_Periodic_Task_50ms folder, select Add and then select New Program….
7. Right-click on the My_Push_Buttons_Program folder and select Add and New Routine.
Routines are where the code resides. Different kinds of language routines can be created. The Logix
platform supports Ladder, Function Block Diagram, Structured Text, and Sequential Function Chart as the
types of routines that can be created.
9. Click OK.
14. Double-click on the My_Push_Buttons_Routine to open the routine. It should look like the following.
15. Create the following two rungs using the lessons previously learned. Use input point 2 to drive output 2 and
input point 3 to drive output 3 as shown.
17. Try pushing the DI2 and DI3 buttons. They should light up while pressed.
Notice that the motor start and stop buttons still work as they did before. This demonstrates that both
programs are running! The controller is running two tasks, one as “continuous”, and another as a 50ms
periodic task.
Note: Notice the ability to make many kinds of changes while the controller is running and controlling.
We did these changes while online with a ‘live’ controller that was currently controlling our ‘machine’.
18. Exit Logix Designer and optionally save your project if prompted to do so.
In this lab, an AOI instruction will be added to the project. AOI’s cannot be created or modified online (although they can be
imported online). The AOI will be created offline, code added, and downloaded to the controller to see it execute.
1. In the Logix Designer window, click the save icon -> yes to save the project and tag values, then Go Offline.
2. In the Controller Organizer, right-click on Add-On Instructions folder located under Assets folder and select
New Add-On Instruction.
4. Click OK.
The Add-On Instruction Definition window appears. In this window we can configure the properties of the AOI.
The Parameters tab is where the inputs and outputs of the instruction are defined.
The Local Tags tab contain tags that are only used by the AOI for internal data storage.
The required checkbox indicates a tag will need to be filled in on the instruction.
The usage INPUT means the AOI will operate on a copy of the tags data. OUTPUT means the AOI will copy the
result to the tag. There is also an INOUT usage, this passes tag by reference, and the tag is read from and written to
directly while the AOI executes.
7. Click Apply.
The following Logic window appears (you can close the Add-On Instruction Definition window if it stays open).
10. Add a tag name to the left TON instruction by right-clicking on Timer ? and selecting New Local Tag as shown
11. Enter Timer1 on the new Add-On Instruction Parameter or Local Tag window that appears. Click OK.
13. Now add Timer2 to the remaining TON instruction and create it as a local tag as well.
15. Add an XIO instruction of Timer2.DN as shown after the XIC My_Signal_Input instruction.
16. Add a second rung with an XIC of Timer1.DN and an OTE instruction of My_Signal_Output as shown.
We have finished creating the AOI definition and logic! We will now add the AOI into the program to have it flash a light.
AOI’s allow logic to be embedded into a single instruction. This allows new custom instructions to be tailored to the
specific application. This also allows code to be easily reused between applications since AOI’s can be imported and
exported.
18. Click and drag the My_Signal_Light Instruction folder from the tree to the rung as indicated by the next two
pictures.
The local tag being created is called the AOI’s backing tag. This is the tag the AOI uses to store its status and local
tag values.
24. Toggle the DI4 input switch and watch what happens to the DO1 light.
Every time the DI4 input switch is on (turned right), the DO1 light blinks at a 500 millisecond rate.
AOI’s allow code to be encapsulated into a single instruction. This allows common code and functionality to be clearly
defined and easily reused. The AOI can be reused as many times as desired. Each AOI should typically have a
unique backing tag.
The Logical Organizer will be used in this lab to group the code to model the demo box. This will demonstrate how the Logical
Organizer can be used to group code regardless of the layout of the Controller Organizer. In this case, we will model it after our
machine, the demo box. The Logical Organizer allows programs to be grouped in any manner desired, but grouping them by
machine physical or logical function is typical.
By default, all of the programs in the Controller Organizer are shown as an ungrouped list. Only the programs, and not the
tasks, are shown. We can use the organizer to group the programs. We will typically use a “folder” object to group the
programs.
Notice that we can also add programs here as well as in the Controller Organizer. If we add a program here, the configure
window will allow us to pick which Controller organizer task the program is scheduled in.
4. Click and drag the MainProgram onto My_Demo_Box so that the MainProgram is grouped under the
My_Demo_Box folder.
Notice that the two programs we are using to run the demo box are now grouped together. Anyone looking at the Logical
Organizer will have a better idea that both programs are being used to run the demo box.
6. Click on the Controller Organizer and notice that the programs and tasks haven’t changed.
Notice that Logical Organizer layout does not affect code execution, but should provide a better idea how
programs are used to run the physical process. In general, grouping controller code parts in Logical
Organizer is used to model the physical or logical application.
In this optional section of the lab, you will create a new User-Defined Datatype (UDT) and an Add-On Instruction.
You will be using the ACD file located in C:\Lab Files\_1_Basics Logix\ folder.
2. Right-click on User-Defined in the Controller Organizer under Data Types and select New Data Type…
7. Follow the same steps to enter the next three rows of members as shown below.
The data type of the members of the User Defined Data Type do not have to be the same. The User
defined data type allows users to combine any of the existing data types.
8. Click Apply.
9. Notice the Data Type Size field is updated to reflect the new members.
Add-On Instructions allow code to be encapsulated into a single instruction. This allows common code and
functionality to be clearly defined and easily reused.
NOTE:
Add-On Instructions cannot be created or modified online. However, they can be imported while online.
10. Right-click on the folder Add-On Instructions under Assets and select New Add-On Instruction….
The Parameters tab is where the inputs and outputs of the instruction are defined and configured.
The Usage Input means the AOI will operate on a copy of the tag’s data. The Usage Output means the AOI
will copy the result of the operation to the tag.
There is also an InOut usage type, which passes a tag by reference. The tag is read from and written to
directly while the AOI executes.
The Required (Req) checkbox determines whether the parameter requires an argument.
To read more about the other columns in the Parameter tab, you can click the Help button.
The Local Tags tab is where tags are defined that are used by the logic within Add-On Instruction. The local
tags are not visible outside of the Add-On Instruction unless an alias parameter is defined.
Note: In this lab, we will create the local tags later, when we create the logic for the Add-On Instruction.
The Scan Modes tab provides access to optional scan mode routines. The Add-On Instruction logic routine
is executed when the EnableIn is true. However, there are three other modes that can be used to execute
the instruction. For each mode, you have the option to define a custom routine that can be programmed
specifically for that mode.
21. Verify that the Open Routine checkbox is checked. Then, click OK.
25. Add an XIC instruction with the tag Pump_start_cmd to rung 0. The rung should appear as follows.
26. Add an Output Latch to rung 0 and enter the tag name ‘Pump_startup_process’.
28. Click OK in the New Add-On Instruction Parameter or Local Tag window.
29. Add a new rung and add an XIC instruction with the tag Pump_startup_process.
31. Right-click in the Timer field of the TON instruction and select New Local Tag…
The New Add-On Instruction Parameter or Local Tag window will appear.
33. Double click in the Preset field of the TON instruction, and type ‘5000’ and press Enter.
35. Add an XIC instruction to the branch, and set the tag to Pump_start_delay.DN as shown.
37. Add another rung to the Logic and add an XIC instruction. Set the tag to Reset.
38. Add an Output Unlatch instruction to the rung you just created and set the tag to
Pump_startup_process.
Your completed AOI should match what is shown below.
40. In the Add-On Instruction Definition window, click the Signature tab.
The Add-On Instruction Signature allows for the instruction to be uniquely identified and sealed, prohibiting
changes to the logic, rung comments, tag descriptions, and any instruction documentation.
The Signature consists of an ID number and date/timestamp that identifies the contents of the Add-On
Instruction at a given point in time. Once generated, the instruction is sealed, preventing edits.
Note: The Generate button is enabled only when offline.
The ID and Timestamp are generated. Additionally, the Add-On Instruction icon now has a blue mark next
to it indicating the instruction is sealed.
Note: Your ID and timestamp will be different than what is shown in the screenshot below.
The [Enter] Signature History [Description] field will update with the entry.
The Change History tab shows the time and date that the Add-On Instruction was created as well as the
user identity. The date and time of the most recent edit is captured as well as the identity.
In the Help tab, you can add additional text to describe the Add-On Instruction and preview the Instruction
Help.
Add-On Instructions allow logic to be encapsulated into a single instruction. AOIs provide an easy way to
reuse code within an application or import into another application.
56. Scroll to the end of the program and add a new rung.
57. Right-click on the new rung and select Add Ladder Element…
58. In the Add Ladder Element window, scroll to find the Add-On folder and expand it.
Each Add-On Instruction requires a unique backing tag. The backing tag is used to store the AOI status and
local tag values.
63. Add Local:3:I:PT[3].Data as the tag for Pump_start_cmd, and Local:3:I:Pt[1].Data as the tag for Reset.
68. Open the Control_LAD program and scroll to find the Pump_Startup instruction.
69. Right-click on the Pump_Startup instruction and select Open Instruction Logic.
After 5 seconds, the Pump_ON tag is set, and the DO3 output turns on.
71. Press the DI1 input button. This corresponds to resetting the process and the DO3 output is cleared.
73. Double-click on Logic under the Pump_Startup Add-On Instruction in the Controller Organizer.