Вы находитесь на странице: 1из 155

RAOTM 2010 Lab 11

Understanding Advanced Programming


Techniques in Logix

For Classroom Use Only!

February 2010

Copyright 2010 Rockwell Automation, Inc

Understanding Advanced Programming Techniques


in Logix

Contents
Before you begin......................................................................................................................................... 6
About this lab ................................................................................................................................................ 6
Tools & prerequisites .................................................................................................................................... 6
Lab 1: Using Multi-Tasks/Multi-Programs in Logix <10 minutes> ........................................................ 8
About This Lab .............................................................................................................................................. 8
The Traditional PLC method. ........................................................................................................................ 9
Using multiple Tasks/Programs in Logix..................................................................................................... 11
Task Properties ........................................................................................................................................... 14
Program Properties ..................................................................................................................................... 16
Lab 1 Summary ......................................................................................................................................... 18
Lab 2: Laying Out the Tag Database in a Logix Controller <10 minutes> .......................................... 20
About This Lab ............................................................................................................................................ 20
Looking at a Traditional Database Layout .................................................................................................. 20
Looking at UDT layout................................................................................................................................. 22
Using the Conveyor UDT ............................................................................................................................ 25
Lab 2 Summary ......................................................................................................................................... 29
Lab 3: Code Re-use <10 minutes> .......................................................................................................... 30
About This Lab ............................................................................................................................................ 30
Data Scoping............................................................................................................................................... 30
Using Copy and Paste ................................................................................................................................ 31
Using the Partial Import/Export Tool ........................................................................................................... 33
Lab 3 Summary ......................................................................................................................................... 36

3 of 155

Lab 4 Design Tools Add-On Instructions <25 minutes> .................................................................... 38


About This Lab ............................................................................................................................................ 38
AOI basics ................................................................................................................................................... 39
Creating an Add-On Instruction (AOI)......................................................................................................... 42
Using the AOI in RLL (Ladder Logic) .......................................................................................................... 47
Using the AOI in a Function Block (FB) Routine......................................................................................... 54
Re-using an AOI.......................................................................................................................................... 57
Export / Import Security............................................................................................................................... 59
Lab 4 Summary ......................................................................................................................................... 66
Lab 5 Add-On Instruction Online Tools <10 minutes>.......................................................................... 67
About This Lab ............................................................................................................................................ 67
Looking at the Data Context........................................................................................................................ 68
Looking at the definition logic...................................................................................................................... 69
Online Monitoring an AOI............................................................................................................................ 71
Lab 5 Summary ......................................................................................................................................... 72
Lab 6 Add I/O at runtime <10 minutes> .................................................................................................. 74
About this lab .............................................................................................................................................. 74
Add 1756 Module while in Run mode ......................................................................................................... 75
Lab 6 Summary ......................................................................................................................................... 78
Lab 7 Importing code During Runtime<10 minutes> ............................................................................ 80
About This Lab ............................................................................................................................................ 80
Import a Routine.......................................................................................................................................... 82
Import an Add-On Instruction ...................................................................................................................... 84
Lab 7 Summary ......................................................................................................................................... 87
Lab 8 - Data Preserved Download Tool <10 minutes> .......................................................................... 88
About This Lab ............................................................................................................................................ 88
Lab 8 Summary ......................................................................................................................................... 93

4 of 155

Lab 9 Using a CompactFlash Card with a Logix Controller <10 minutes> ...................................... 94
About This Lab ............................................................................................................................................ 94
Opening an Existing Controller Project ....................................................................................................... 94
Using code to list files and directories......................................................................................................... 95
Create, Edit, and Delete a File .................................................................................................................... 98
Read Data from CompactFlash ................................................................................................................ 100
Storing and Loading Recipe Data ............................................................................................................. 101
Lab 9 Summary ....................................................................................................................................... 104
Lab 10 Controller Change Logging <10 minutes>............................................................................ 105
About This Lab .......................................................................................................................................... 105
Opening an Existing Controller Project ..................................................................................................... 105
Lab 10 Summary ..................................................................................................................................... 114
Lab 11: Device Based Alarms in RSLogix5000 <15 minutes>........................................................... 115
About This Lab .......................................................................................................................................... 115
ALMD Instruction....................................................................................................................................... 115
ALMA Instruction....................................................................................................................................... 120
Lab 11 Summary ..................................................................................................................................... 123
Lab 12 Device Based Alarms FactoryTalk View SE <15 minutes> .................................................... 125
Configure Historical Alarm and Event Logging ......................................................................................... 126
Create FactoryTalk View Graphics interface ............................................................................................ 131
Creating FactoryTalk View Client file ........................................................................................................ 134
Lab 12 Summary ..................................................................................................................................... 136
Lab 13 Observe Device Based Alarming <10 minutes> ...................................................................... 137
Observe FactoryTalk Alarms & Events within SE Client application ........................................................ 140
Lab 13 Summary ..................................................................................................................................... 145
Appendix A Useful AOI Information...................................................................................................... 146
Appendix B Useful FactoryTalk Alarms and Events Information ...................................................... 152

5 of 155

Before you begin

About this lab


Welcome to this Hands-On Lab series! This session provides you with an opportunity to explore
advanced concepts within the Logix platform. The following sections explain what youll be doing in this
lab session, and what you will need to do to complete the hands-on exercises.
Learn how to take full advantage of core Logix programming features that set it apart from traditional
programmable controllers. You will take advantage of the Multi-Tasking/Multi-Program model, memory
layout, and learn editing and programming tips to increase your productivity. This lab also introduces
users to FactoryTalk Alarm and Events.
This lab takes approximately 2.5 hours to complete from start to finish. 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. NOTE: To ensure proper lab execution the VMWare
image should be reset to the correct snapshot prior beginning the lab. Labs 1 4 are purely offline and
do not require any hardware.

Tools & prerequisites


This hands-on lab is intended for individuals who:

Are familiar with programming SLCs, PLC5s, or Logix controllers.


Have completed the Introduction to Logix Lab.
Are familiar with RSLogix5000 software.

Software
RSLogix5000 programming software v17
RSLinx Classic v2.54
FactoryTalk View SE V5.0
RSLinx Enterprise v5.0
MS SQL Server2005 Express
Files required:
This hands-on lab uses the following files located in the Lab Files Folder on the computer desktop:
CLX_S1_00.ACD CLX_S16_00.ACD; Look_Up_A_Bar_Code.ACD
Conveyor_Core_1_01.L5X
ControllerLogSample.txt, fiveK.txt, Folder named Files to be placed on CompactFlash
Alarm Banner.gfx, Log Viewer.gfx, Menu Bar.gfx, Overview.gfx, Valve1 Detail.gfx
ClientKeys.key
Startup.mcr
FTAE_done.cli
Hardware devices required: 1796-CL11 demo box.

6 of 155

7 of 155

Lab 1: Using Multi-Tasks/Multi-Programs in Logix <10 minutes>

About This Lab


In this lab we will explore the Multi-Task/Multi-Program model in Logix. You will look at the traditional way
of laying out a controller and then look at the same code configured to take advantage of Logix features
of Multi-Tasks/Multi-Programs. The existing program contains ladder code for 3 conveyor segments and a
temperature loop.
Launching a Project in RSLogix5000 Programming Software
In this section of the lab, you will launch the RSLogix5000 software, which will allow you to program the
project.

1. From the computer desktop, double-click on the shortcut to Lab Files.


Understanding Advanced Programming Techniques in Logix subfolder

and then select the

2. Double-click on the existing project called CLX_S1_00.ACD.


3. This will launch the project in RSLogix5000. The Controller Organizer appears on the left side of the
RSLogix5000 window, with a Controller folder called Controller CLX.

8 of 155

Controller Organizer
The Controller Organizer is a graphical representation of the contents of your controller
file. This display consists of a tree of folders and files that contain all of the information
about the programs and data in the current controller file. The default main folders in this
tree are:
Controller Project Name - contains controller-scoped tags, controller fault handler and
the power up handler.
Tasks - tasks are shown in this folder. Each task shows its own programs with routines
and program-scoped tags.
Motion Groups - Underneath the Motion Groups folder, you find groups of axes
associated with each other gathered into groups. In addition, you find Ungrouped Axes,
which are axes that have yet to be assigned to any particular group. You can assign
these axes to specific motion groups via the Axis Assignment tab of the Motion Group
Properties dialog.
Add-On Instructions contains Add-On Instructions, their routines, and tag collections.
Data Types - shows predefined and user-defined data types. User-defined data types
are created in this folder.
Trends - trends are shown in this folder.
I/O Configuration - contains the information about the hardware configuration of this
controller file. It holds a hierarchy of modules with which the controller is configured to
communicate.
In front of each folder, there is a square containing a + sign or a - sign. The + sign
indicates that the folder is closed. Click on it to expand the tree display and display the
files in the folder. The - sign indicates that the folder is already open and its contents are
visible.

The Traditional PLC method.


After looking through the Controller Organizer you notice that your engineer did not take advantage of the
advanced features of a Logix controller and configured the program as if it were a traditional PLC. You
remember from past experience that this made coding, troubleshooting, and adding additional conveyor
segments difficult.
Tasks in Logix Controllers
The Logix controllers can utilize 3 types of tasks: Continuous, Periodic, and Event. You
can define up to 32 tasks in a ControlLogix controller.
- The continuous task runs in the background. Any controller
execution time not allocated to other tasks or operations (motion, periodic tasks, event
tasks, communications, or diagnostics) is used to execute the continuous task. The
continuous task runs all the time. When it has completed execution of a full scan, it
restarts. A project does not need to contain a continuous task. If used, a project can
only contain one continuous task. A traditional PLC used this type of scan model.
Typical Use: If you want the code to scan all the time.
- A periodic task performs a task at a specified period. You can
configure the execution rate from 0.1ms to 2000s. Whenever the period for the periodic
task expires, the periodic task will interrupt any lower priority task, execute one time, and
return control to whatever task it interrupted. Typical Use: If you want to execute code at
a constant period or multiple times within the continuous tasks scan.

9 of 155

- An event task performs a specific function based on an event or


trigger. Triggers can be a digital input, an analog input, motion operations, a consumed
tag, or an event instruction. When the event occurs the event task will interrupt any
lower priority task, execute one time, then return control to whatever task it interrupted.
Typical Use: If you want to execute code as soon as an event or trigger occurs.
4. From the Controller Organizer, expand the MainProgram folder by clicking on the +.
Once the MainProgram is expanded it will appear as follows:

The first thing to notice is everything is lumped in one big program. Some questions you may have:
When does it run? What calls the routines? If you double-click on the MainRoutine, you can see
that the engineer was trying to segment the program by using JSRs to go to the conveyors and
temperature loop. If you then double-click on the Conveyor_1 routine you will notice that there are
JSRs to the routines that deal with that conveyor. This is the way a traditional PLC does program
segmentation and is confusing if you are trying to troubleshoot this application. This is not taking
advantage of Logix.

10 of 155

Look at the routine called Temperature_Loop. Notice that the temperature loop is coded in the
MainTask which is a continuous task. Traditionally you programmed a PID by using a timer to trigger
the PID instruction at a known rate.

Logix controllers have periodic tasks so you can take advantage of a timed task. This application
would be much better suited to a Periodic task. We will see this later on.
5. Close the file within RSLogix5000 using File > Close. Respond with No if prompted to save the file.
Now lets look at the same code written to take advantage of multiple tasks / programs offered with Logix
controllers.

Using multiple Tasks/Programs in Logix


6. Open CLX_S2_00.ACD using the File > Open menu browsing to C:\Lab Files\Understanding
Advanced Programming Techniques in Logix folder. Notice how the application is configured.

11 of 155

7. Click on the + sign next to Conveyor_1 to expand it.


8. Notice that all the Conveyor_1 code is now organized into one program.

9. Notice that Conveyor_2 and Conveyor_3 are also in separate programs.


10. Notice that the PID loop has been moved into a new Task.

11. Expand the Temperature_Loop task if it is not already expanded.


12. Expand the PID_Loop Program.

12 of 155

13. Double click on the Temperature Loop Routine to view it.


In a periodic task the timer is no longer needed because you can schedule the task to execute based
on a time period. The PID instruction will only be scanned when the task executes.

Lets explore some things.


Every Logix task type has a hierarchy that has to be followed no matter what type of task you use.
The hierarchy is as follows:
Task
Program
Routine

Every task must have at least one Program and every program must have at least one routine to
function. In the above example the Main Task is one of three tasks. The Main Task contains 3
programs, Conveyor_1, Conveyor_2, and Conveyor_3. Each Conveyor program has 4 routines,
Conveyor_1, C1_Alarm_Status, C1_Energy_Manag, C1_Start_Stop.
Back to the questions we asked before. When does it run? How do the routines get called?
Lets explore the properties of each to answer the questions.

13 of 155

Task Properties
14. Open the continuous task properties by right clicking on Main Task and selecting Properties.

15. Click the Configuration tab to view the top level task properties.

Task Dialog Box


From this window you configure the properties of a task. This window changes based on
the type of task you choose. There are two configuration options for every task type
(starting with RSLogix5000 V12):
Disable Automatic Output Processing to Reduce Task Overhead - At the end of
a task output processing is performed. The controller goes through the I/O tree and
updates the state of outputs affected by the task. By disabling output processing the
task will execute faster. If you have a periodic task that is only doing data
manipulation and has no outputs you would want to disable output processing. Or, if
you have only a few outputs that are manipulated by the task you may want to
disable output processing and use the Immediate Output instruction (IOT) which
immediately processes outputs.

Inhibit Task - This feature allows you to prevent a task from executing. This may be
used during system commissioning to isolate and test a specific task by inhibiting
other tasks.

14 of 155

16. Click the Program/Phase Schedule tab.

Program Scheduling
Program scheduling allows you to determine the order in which the Programs in a Task
are executed. In this figure, the execution order would be Conveyor_1, Conveyor_2, and
then Conveyor_3. You can change the execution order by highlighting a program and
using the up and down move arrows. Unscheduled programs are still downloaded to the
controller, but not executed.

17. Click Cancel to close the dialog.

15 of 155

Program Properties
Every program must have a Main routine. To view or set this we must view the program properties.
18. Open the Conveyor_1 Program properties by right clicking on the Conveyor_1 program in the
controller organizer and selecting Properties.

19. Click on the Configuration tab.

16 of 155

20. Click the Pull Down and look at the routines. You could pick any of the routines in the Program as the
main routine. Set it back to Conveyor_1 and click OK button.
There is no correlation between the Program named Conveyor_1 and the Routine
named Conveyor_1. We just happened to pick the same name.

Main and Fault Routines


For a Program you can assign two types of routines: Main and Fault. You must always
assign a Main Routine. A Fault Routine is optional.
Main Routine: first routine that is executed when the program is executed. For example,
in our case, when the Conveyor_1 is executed it will start with the Conveyor_1 routine.
This is equivalent to a MCP for a PLC5 or File 2 for a SLC.
Fault Routine: lets you use code to clear specific faults and let the controller resume
execution.

17 of 155

21. Open the Main routine for Conveyor_1. At this point it will look similar to a traditional PLC with JSR
instructions.

22. Here are the answers to the questions we asked before:

How do the Routines get called? Each Routine is called from the Main routine. The Main
routine is defined in the Program Properties.

When does it run? The programs are Scheduled in the Task Properties.

23. Close the file within RSLogix5000 using File > Close. Respond No if prompted to save the file.

Lab 1 Summary
In this lab we looked at an existing project programmed using techniques typically used in traditional
PLCs. We then compared them to a project programmed to take advantage of using Multi-Tasks /
Multiple-Programs in Logix.

18 of 155

19 of 155

Lab 2: Laying Out the Tag Database in a Logix Controller <10 minutes>

About This Lab


In a traditional PLC you had to use a memory address for your user program such as N7 or B3. In
addition to this you had to type a description for each one so you knew what it was for. This took
considerable time and could be confusing if you forgot to type a description. A Logix controller is TAG
based meaning that you are free to call the operands in your project what you want. This allows very
descriptive names for each element of your project. In this lab, we will show how to layout the tag
database using tags and to organize them using User Defined Data Types.
In this lab, you will:

Learn about the advantages of using UDTs

Learn how to optimize the layout of UDTs

Opening an Existing Controller Project


In this section of the lab, you will open an existing project.
1. Open CLX_S3_00.ACD using the File > Open menu browsing to C:\Lab Files\Understanding
Advanced Programming Techniques in Logix folder.

Looking at a Traditional Database Layout


2. From the Controller Organizer, double-click on Controller Tags.

The Tag Editor will appear. You notice that the Tag Data base has the look and feel as if it was a
traditional PLC.

20 of 155

Logix Tag Database


In a traditional PLC a physical address identifies each item of data, such as N7:0 or
B3:0/0. Without using address comments or symbols, it was very difficult to read logic.
In Logix controllers there is no fixed memory, N7:0 or B3:0/0. The Logix memory is a tag
based system. The tag name itself identifies the data. This lets you organize your data
to mimic your machine. You can actually document your code with the tag names you
assign, for example Nozzle_1_Temperature.
3. Click on the + next to N7 in the tag editor.
This will expand the array N7 to show all the elements. You notice, from the Descriptions entered,
that addresses N7[0] through N7[7] are used and then again from N7 [20] through N7 [27] and N7
[40] through N7 [47]. These areas are for each of the 3 conveyors, a traditional PLC data table
layout.

21 of 155

Between each of these blocks of memory is a large block that is not used. Assume that three
different engineers created these Conveyor programs and they had to leave room for expansion or to
add something later. This used more memory in the controller than was necessary.

Since we looked at how to reorganize the program layout to take advantage of Logix, we can also look at
a better way to organize the data layout.
We already said the Logix controller is Tag based instead of Address based. Just typing a descriptive
name alone will save development time. It is still possible to waste memory with Tag based memory but
we will show you how to avoid this as well.
In this section of the lab will show you how to make full use of the Logix controller and use User Defined
Data Types for your Conveyor data.
User-Defined Data Types
User Defined Data Types also known as UDTs are structures that let you organize or
group data logically, so all of the data associated with a device can be grouped together.
For example, each conveyor has 8 Integer values, 3 Real values, 2 Timers, and 11
Booleans associated with it. In a traditional PLC, 4 different data tables would be
needed. When you have multiple conveyors you would need to map out the conveyors
into each data table. This becomes hard to manage.
UDTs allow different data types to be grouped (Integer, Real, Timer, Boolean, etc), in a
User-Defined Data type. You can then create an array of that UDT type. This makes
programming, documenting the code, and tracking of the data easier.

Looking at UDT layout


4. From the Controller Organizer under the Data Types folder, click on the + next to User-Defined.

22 of 155

You will notice a UDT called Conveyor (Creation of the UDT was started for you).

5. Double-click on Conveyor.
This will open the UDT editor for the Conveyor data type. As you can see, the UDT is a mixture of
different data types. This is a very useful tool when programming.

Guidelines for User-Defined Data Types

Multi-dimensional arrays are not permitted in UDTs.

Grouping like data types together creates a more compact UDT and uses less
memory.

The two examples below have the same number and type of elements inside. The
example on the right has them grouped together. Grouping BOOLs together has the
greatest impact on reducing memory usage. The right side example uses four less
bytes than the one on the left.

23 of 155

Look at the UDT in the program. Notice that like data types are not grouped together. BOOL and
REAL data types are mixed. The size of the UDT is currently 52 bytes. This can be reduced by
grouping the BOOLs together.
6. To do this, click to the left of Motor_Overload. This will select the entire row.

7. Click the Move Up button.


This moves the Motor_Overload tag up in the UDT.

24 of 155

8. Repeat this with the other BOOL tags until they are all grouped together.
9. Click on Apply.
Notice the size of the UDT now. You have saved 12 bytes.

You now have a completed UDT that defines a conveyor in the program.
10. Click on OK button to close the UDT editing window.
11. From the File menu select Close. You will be asked to save changes made to the file, select No.

Using the Conveyor UDT


You will now use a UDT for the Conveyor routines we looked at earlier. Using the UDT will help optimize
the tag database and make it easier to troubleshoot and develop code.
12. Open CLX_S4_00.ACD using the File > Open menu browsing to C:\Lab Files\Understanding
Advanced Programming Techniques in Logix folder.
13. From the Controller Organizer under the Data Types folder, click on the + next to User-Defined.

You will notice a UDT called Conveyor.

25 of 155

14. Double-click on Conveyor.


You will see that we have added a few elements into the UDT. We took all the descriptions from N7
and added them as members into this UDT so we could use it for all of the Conveyor Programs.

Lets see how we used it:


15. From the Controller Organizer, double-click on Controller Tags.
This will open the Tag Editor.

Looking in the tag editor you see a new tag in the database, Conveyor_1.

26 of 155

16. Click on the + next to Conveyor_1 to expand the tag.


You notice that the tag has the same format as the UDT. This is confirmed by looking in the Data
Type column.
The Data Type is now Conveyor. This is how you use a UDT.

17. From the Controller Organizer, open Conveyor_1 Program in the Continuous Task by clicking on the

+ symbol.

27 of 155

18. Below is a reminder of what the Start_Stop Routine looks like with traditional PLC addressing.

19. Double-click on the routine C1_Start_Stop.


This will open the routine for viewing and editing.

28 of 155

20. Now displayed is the ladder file C1_Start_Stop.


You notice that the addressing for Conveyor_1 is using the UDT. As you can see, the code is now
self-documenting and the tag name describes what it is. You do not need to add a description to the
address like you do in traditional PLCs. There are some older style addresses still in the code, we
will change them later.

21. Close the file within RSLogix5000 using File > Close. Respond with No if prompted to save the file.

Lab 2 Summary
In this lab we looked at using UDTs to make a controllers memory more compact and easier to use.
We will cover how to save time when creating code and troubleshooting later on.

29 of 155

Lab 3: Code Re-use <10 minutes>

About This Lab


In this lab you will:

Re-use a program multiple times in the project through copying and pasting

Re-use ladder code in the project through the Partial Import/Export tool

First we need to cover the concept of Data Scoping for tags. This lab will use Program scoped data tags.
Up to this point we have been using Controller scoped tags.

Data Scoping
When you create a tag, you define it either as a controller tag (global data) or a program
tag (local data) for use within a specific program.

A Logix controller lets you divide your application into multiple programs with program
scoped tags that avoids conflicting tag names between programs. This makes it easier to
re-use both code and tags names in multiple programs.
Tags are either Controller scoped or Program scoped. A Controller scoped tag is
considered a Global tag and any Routine in any Program in any Task can access it.
Data at the Program scope is isolated from other programs. Routines cannot access
data that is at the Program scope of another program which allows the re-use of tag
names for Program scoped tags in multiple programs.

30 of 155

Using Copy and Paste


You observe that in every system design there is always one temperature loop and 2 or more conveyor
segments. You decide to create a rough template of a project to use as a starting point. It contains one
temperature loop and one conveyor segment. You will use this template project to create the code for a
system with 10 conveyor segments.
From the Controller Organizer you see the baseline program: one Conveyor program and the
Temperature_Loop Task. You will need to add 9 conveyor segments to get to the total of 10 specified for
the project.
Opening an Existing Controller File
1. Open CLX_S5_00.ACD using the File > Open menu browsing to C:\Lab Files\Understanding
Advanced Programming Techniques in Logix folder.
2. From the Controller Organizer, right click on the Conveyor program and select Copy.

31 of 155

3. From the Controller Organizer, right click on the MainTask and select Paste.

This added in a copy of the original conveyor segment code and incremented the program name.
Repeating this process would allow you to create the required programs for 10 Conveyor segments.

4. Open the Program tags for Conveyor. Then open the Program tags for Conveyor 1.

5. Notice they contain the exact same tags.


This illustrates how Program Scoped tags can save time and effort by not conflicting with other
Programs tags.
6. Close the file within RSLogix5000 using File > Close. Respond with No if prompted to save the file.

32 of 155

Using the Partial Import/Export Tool


Sometimes in a system, you may need to use some type of different code than is contained in your
template code. You could add it into the template code, but you would then have to delete this code from
everywhere it is not used.
Before, you have used the scrap file method by cutting rungs of ladder and saving them as scrap files on
the desktop. But when you pasted the scrap files back in, you would have to spend time creating all the
tags. You are looking for something easier and faster.
Partial Import/Export Tool
This feature introduced with version 13 of RSLogix5000 provides the ability to extract
specific rungs of code from a project and store them in an external file (L5X). Later, you
can import the code back into any RSLogix5000 project. The significant difference is that
the Partial Import/Export feature is not limited to just the ladder rungs, like scrap files.
The export file contains all the tag definitions, UDTs, and associated comments. As a
result of this capability, when the file is imported, everything is created and the result is
code that verifies with no errors.
Extending this even further, RSLogix5000 provides a dialog listing all the associated tags,
UDTs, and descriptions so you can modify them before the import occurs. This helps to
avoid potential tag naming collisions.
Version 17 RSLogix5000 introduced the use of this tool online at runtime, further
enhancing your development and troubleshooting capabilities.
Opening an Existing Controller File
In this section of the lab, you will open an existing program that contains the code you want to add into
the first conveyor segments code.
Using the Partial Import/Export Tool to Export to a L5X File
7. Open Look_Up_A_Bar_Code.ACD using the File > Open menu browsing to C:\Lab
Files\Understanding Advanced Programming Techniques in Logix folder.
8. From the Controller Organizer, double click on the MainProgram folder to expand it. This is where
the Bar Code Station code is located.
Once the MainProgram is expanded it will look like the following.

9. Double-click on the MainRoutine to open the ladder editor.


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

33 of 155

11. Right click to the left of rung zero and select Export Rungs.
12. When the Export Rungs window appears, save to C:\Lab Files\Understanding Advanced
Programming Techniques in Logix folder and enter the File name as shown below. Finish by
clicking the Export button.

13. Close the file within RSLogix5000 using File > Close. Respond with No if prompted to save the file.
14. Open CLX_S6_00.ACD using the File > Open menu browsing to C:\Lab Files\Understanding
Advanced Programming Techniques in Logix folder.
15. From the Controller Organizer, double-click on the Conveyor program folder to expand it.
This is where we will add the Bar Code station code. Once Conveyor is expanded it will appear as
follows:

34 of 155

16. Double click on the Conveyor Routine to open it.

17. Right click over the end rung and select Import Rungs.

18. When the Import Rungs window appears, click on the file Look_Up_A_Bar_Code.L5X and then click
the Import button.

35 of 155

19. The Import Configuration window will appear.

20. Click on OK to start the Import. In addition to the ladder code all tags are created in the correct
scope.
21. You should see the same ladder you exported now complete in your existing program. There should
not be any edit rungs present.

We could have put this logic anywhere in the existing application. We could have created
a new routine to keep it separate. It doesnt matter where we put it although we do need
to be careful to avoid potential tag names conflicts with existing ones.
This is known as a Deep Export/Import. This means that all backing data and structures
are exported and imported with the ladder code.
Remember in Version 17 you are able to do this in Run mode as well not only with rungs
but also with entire Programs and Routines as well. We will explore importing at runtime
later.
22. Close the file within RSLogix5000 using File > Close. Respond with No if prompted to save the file.

Lab 3 Summary
You just realized that it took you less than 15 minutes to create your core program. This used to take a
few hours. You would have had to copy code, change addresses, document the addresses, and verify
everything was done correctly. Using advanced features in RSLogix5000 can allow you to do this quickly
and easily.

36 of 155

37 of 155

Lab 4 Design Tools Add-On Instructions <25 minutes>

About This Lab


Version 16 of RSLogix5000 introduced the concept of reusable code objects called Add-On Instructions.
Add-On Instructions allow you to encapsulate your most commonly used logic as sets of reusable
instructions, similar to the built-in instructions already in the Logix controllers. This saves you time by
allowing you to easily re-use sets of your commonly used instructions in your projects and promotes
project consistency because commonly used algorithms will all work in the same manner, regardless of
who is implementing the project.

Add-On Instructions may be created using the standard Ladder, Function Block Diagram,
and Structured Text editors already available in RSLogix5000. Once created, an Add-On
Instruction may then be used in any of the RSLogix5000 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 Instructions 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 security to AOI
Export / Import AOI with security

38 of 155

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.

39 of 155

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.

40 of 155

6. Optional Scan Mode Routines (Refer to Lab Appendix for an explanation of when you would want to
use these)

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.

41 of 155

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.

Creating an Add-On Instruction (AOI)


In this section of the lab we will take one section of the conveyor code we worked with in the last lab and
use it to create part of our AOI.
In this section of the lab, you will open an existing program and create the AOI.
1. Open CLX_S7_00.ACD using the File > Open menu browsing to C:\Lab Files\Understanding
Advanced Programming Techniques in Logix folder.
2. 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.

42 of 155

3. Right click on the Add-On Instructions folder and select New Add-On Instruction from the dropdown menu.

4. Complete the New Add-On Instruction dialog as follows:

5. Click OK button to accept.

43 of 155

6. The instruction definition should open.

7. 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.

44 of 155

The Parameters tab is a tag database editor window for parameters specific to this AddOn 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)
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.
8. 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.

45 of 155

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

10. Click Apply


11. Click on OK to close the dialog.
Entering the Logic
We are going to cheat and just copy the logic we already have. We could enter the logic from scratch but
since this is about saving development time we will do it the easy way.
12. From the Controller organizer locate the C_Start_Stop routine and double-click it to open it.

13. From the toolbar menu select Edit > Select All.
This will select all the rungs in the routine.
14. Right click on Rung 0 and select Copy Rung
15. Expand the Add-On Instructions folder if it is not already expanded in the Controller organizer.

16. Double click on Logic to open it.

46 of 155

17. Right click on the End rung and select Paste

18. Delete the empty rung.


19. All of the logic should now appear without any errors.
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 dont worry if errors exist at this point.
20. Close the file within RSLogix5000 using File > Close. Respond with No if prompted to save the file.
Thats 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.

Using the AOI in RLL (Ladder Logic)


Add-On Instructions may be created using the standard Ladder, Function Block Diagram, and Structured
Text editors already available in RSLogix5000. Once created, an Add-On instruction may then be used in
any of the RSLogix5000 editors without any additional effort on your part.
In this section of the lab, you will open an existing program and create the AOI.
21. Open CLX_S8_00.ACD using the File > Open menu browsing to C:\Lab Files\Understanding
Advanced Programming Techniques in Logix 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.
22. Expand the AOI until you can see the Logic and Parameters.

47 of 155

23. 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.
24. Click the Parameters tab.
25. Notice which ones are marked REQ and VIS. This will determine how the instruction looks and acts
once we place it in an application.

26. Click on the Logic button to open the logic.

27. You should see all the logic that was in the three routines we used to have. Ten rungs total.

48 of 155

Lets use it
28. 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)

29. You should see a blank rung and a new Add-On menu choice.

30. Select the Add-On tab and then click the Conveyor button.

31. This will add a Conveyor instruction to the rung.

49 of 155

AOI tag structure: At this point the instruction behaves like any other RSLogix5000
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.

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.
32. Right click on the first question mark and select New Tag.

33. Complete the New Tag dialog as shown

50 of 155

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.

34. Click OK to accept.


35. 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.
36. Double click on the Motor_Overload_Input question mark and maneuver down to pick input 0 as
shown.

37. 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.
38. Verify the routine by clicking on the Verify icon.

51 of 155

39. 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.

Lets create an Alias address like the one shown


40. 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.

52 of 155

41. Right click on the new tag name and select New My_Motor_Overload

42. 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.

43. Click OK to accept it.


The instruction should now have your Alias filled in.

53 of 155

Using an Add-On Instruction Output in Ladder


44. 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.

Using the AOI in a Function Block (FB) Routine


45. Create a new Routine named Conveyor_2 by right clicking on the Conveyor Program and selecting
New Routine.

46. Fill out the dialog as shown specifying Function Block as the Type and click OK button when you
are finished.

54 of 155

47. Double click on the new Conveyor_2 routine to open it.

48. 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.

55 of 155

49. Click the Input Reference (IREF) button six times as the AOI requires six inputs.

50. Drag the IREFs to align roughly with the nubs of the FB instruction on the sheet and wire them to the
Motor_Overload_Input connectors.

51. Select unused addresses for all the IREFs as shown below for the required input points.
You could use an Alias here just like we did for the RLL instruction.

52. The instruction will now verify. Notice the

is gone from the upper left corner.

56 of 155

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 AOIs 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.
Storing your Instructions
There are two ways to store and use a group of instruction definitions together.
Keep them in a project file (.ACD file) and then use Copy/Paste feature to use them
Export them to an .L5X file and then import them as you need them
Copy and Paste
53. Continue working with CLX_S8_00.ACD file.
54. From the Controller organizer in our Conveyor application, right click on the Conveyor_Core AOI and
select COPY.

55. Open a second instance of RSLogix5000 using the shortcut for RSLogix5000 on the desktop or the
button selecting Programs\Rockwell Software\RSLogix5000 Enterprise
Series\RSLogix5000.
56. Begin a new file by selecting New Project from the Quick Start page.

57 of 155

57. Fill in the resulting dialog box as shown below:

58. Click OK when finished.


59. From the Controller organizer right click on Add-On Instructions and pick Paste.

60. The Conveyor_Core AOI should now be present and ready for our use in the new program.

61. Close this instance of RSLogix5000. Respond with No if prompted to save the file.

58 of 155

Export / Import Security


Copying and Pasting requires you to have two instances of RSLogix5000 open at the same time. This is
fine if you are using your own AOIs. How do you send someone else a copy of the AOI? What if you
want to apply security to the AOI? Perhaps you do not want the other user to have the ability to edit the
AOI or perhaps even be able to see the code? Source Protection allows password protection to be
applied to routines and AOIs. The password(s) are stored in a Source Key that may be provided to allow
other users access to your secured routines or AOIs.
Source Keys
Source keys are text strings that follow IEC-1131 naming conventions. Specifically, this
convention states that an identifier must be a string of letters, digits, and underline
characters which begin with a letter or underline character. Underlines are significant in
identifiers (e.g., A_BCD is interpreted differently than AB_CD). Multiple leading or
multiple consecutive embedded underlines are not allowed, trailing underlines are not
allowed, and letter case is not considered significant. The source key can be any text
string that follows these rules and consists of up to 40 characters.
In this section of the lab we will:

Apply security to the Conveyor_1 routine to allow the user viewing of the code
but disable code editing.

Apply security to the Conveyor_Core AOI removing both editing and viewing

Export the files

Explore what occurs when Source key is not available

Applying Security
62. Continue using the CLX_S8_00.ACD file. Before we export the Conveyor_Core AOI we will apply
password security to it and to the Conveyor_1 a routine.
63. Select Configure Source Protection which is available under Security which is found in the Tools
pulldown menu.
NOTE: Source Protection is enabled by running RS5KSrcPtc.exe file which is provided with
RSLogix5000 source media.

59 of 155

64. The first time Source Protection is configured the Source Key file (sk.dat) location must be
specified. Enter the Source Key file location as pictured below and click the OK button. Respond
with YES if prompted to create a new file.

65. The Configure Source Protection dialog box lists the components to which security may be applied:

66. Select the Conveyor_1 routine, click the Protect button and configure the Source Key as shown
checking the box to allow viewing of components:
Click OK button when completed applying security to Conveyor_1

60 of 155

67. Select the Conveyor_Core AOI, click the Protect button and configure the Source Key as shown;
leave the Allow viewing of component(s) checkbox unchecked this time.
Click the OK button when completed applying security to Conveyor_Core

68. Click the Close button to exit the Source Protection Configuration dialog box.
Export Files
69. From the CLX_S8_00.ACD file, right click on the Conveyor_1 routine and select Export Routine

61 of 155

70. Choose Export button from the following dialog after specifying C:\Lab Files\Understanding
Advanced Programming Techniques in Logix

71. In a similar manner right click on Conveyor_Core under Add-On Instruction folder within the
Controller Organizer and select Export Add-On Instruction. Select the same destination folder for
the export.

62 of 155

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 AOIs
(nested) we would have wanted to check this box.

72. Start a new instance of RSLogix5000 and create a new project with a 1756-L63 controller called
new in slot 1 of a 7 slot chassis.
73. To simulate what occurs when the source key is not provided with a file we will change the location
RSLogix5000 looks for the Source Key file. Select: Tools > Security > Configure Source
Protection

74. Select the Specify button within the Source Protection Configuration dialog box to change the
location of the Source Key file.
75. Instead of C:\ specify the location as C:\temp. Answer Yes if prompted to create the file and
directory. Click the OK button and then the Close to exit Source Protection Configuration

63 of 155

76. Right click on Main Program; select Import Routine highlight the Conveyor_1 routine we just
exported and click the Import button.

77. Select Operation: Create and click OK button. NOTE: red flags are expected for Tags because the
new project does not have the I/O modules defined that are referenced.
78. At this time both the Conveyor_1 routine and Conveyor_Core AOI are available for use. This is a
result of the import / export process being a Deep Copy. The Conveyor_Core AOI was imported in
the same step as the Conveyor_1 routine because the routine referenced it. But we do not have full
access because the security file sk.dat found at c:\temp does not have the correct passwords
included. When the files are selected within the Controller Organizer Source Protection indicates
Source not available (Viewable) or Source not available depending on the security applied.

64 of 155

79. Double click on the Conveyor_1 routine; we allowed viewing when Security was configured. The
protected routine Conveyor_1 may be used; however, when the Source Key is unavailable the code
itself is not editable. NOTE: rungs show errors because no I/O modules are defined in the I/O tree.

65 of 155

80. Double click on the Conveyor_Core AOI. The dialog box below appears. The Logic button is not
visible because the Source Key is not found.

81. Both the protected routine and AOI may be used within an application with restricted access.
Correcting the Source Key path allows full access to the routine and AOI that were imported.
82. Close the instance of RSLogix5000 with the controller named new. Close the CLX_S8_00.ACD file
within the instance of RSLogix5000 using File > Close. Respond with No if prompted to save the file.

Lab 4 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 regenerating the code again and again. We saw that we can develop complex code segments and ship
them to customers that need it with security where desired to lock the instructions preventing users from
changing the code inside or even viewing it by applying Source Protection.
In the first 4 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.

66 of 155

Lab 5 Online Tools <10 minutes>

About This Lab


So far we have been working offline. All of these labs have been showing how the advanced features of
Logix can save time in the design phase. This lab will move to the online phase. Now that your program
is designed, how can Logix make the troubleshooting phase easier? We will do two different things in this
lab. We will explore AOIs further and look at how to monitor them online.
Online Monitoring of AOIs
Once an Add-On Instruction has been defined and used in a program it is helpful to view the definition
during operation for debugging and commissioning. To accommodate these activities, a provision
has been made to view the definition and tag structure from a particular context. While these same
tools are available for off-line use, their greatest utility is in the on-line capacity.
NOTE: For this lab several rungs of logic and some tags have been added to the AOI
definition. The Add-On Instruction input points have been changed from 1756 I/O to tags
for I/O module simulation.

In this section of the lab, you will open an existing program and download it into the controller.
1. Open CLX_S9_00.ACD using the File > Open menu browsing to C:\Lab Files\Understanding
Advanced Programming Techniques in Logix folder.
2. The project is written for a 1756-L63 controller in slot 1. (Remember, Logix chassis start with slot 0)
3. Look at your demo case and determine what type of controller you have and what slot it is in.
4. If your controller is not a 1756-L63 then you must change the processor type in the project to match
what you actually have.
5. If it is not in Slot 1 then you can re-configure the demo case to match the project.
6. Click Download from Controller Status

67 of 155

7. The Ethernet driver in RSLinx and the project should already be configured but if it is not or you are
having problems downloading you can configure it as follows.

From the Toolbar menu, select Communications > Who Active

Browse until you find the controller in Slot 1.

Click on the controller.

Click Download.

If you still have a problem downloading see an instructor for help.

8. Select Yes to place the controller in Run mode or use the key switch.

Looking at the Data Context


9. Open the tag database by double-clicking on the Program Tags in the Conveyor Program.
10. Click on the Scope selector to view the list of available tag scopes.

Here, Add-On Instructions have been added to the list to easily navigate to the individual AOI
definitions parameters.
11. Select Conveyor_Core from the Scope selection drop-down menu.

68 of 155

12. Click on the Data Context selector to view the list of available contexts for the
Conveyor_1(Conveyor) instruction.
The list contains the instruction definition and all of the instances of the instruction
currently in the controller. By selecting any of the instruction instances the view will
reflect the values of that instance of the instruction.

13. Click the Data Context selector again and this time select Conveyor_Core_02. Notice the values
change. These are the values for the Function Block version of the instruction. If we had used the
instruction 20 times in the application there would be 20 different entries in Data Context view, one
for each usage.

Looking at the definition logic


14. Double click on Conveyor_1 to open the routine for viewing.

69 of 155

15. Right click on the instruction and select Open Instruction Logic.

The running logic for this specific instruction instance is now shown. From this view all of the
specifics of the logic for this instruction instance are available to the user: tag values, instruction
properties, etc.

Note: portions of the view are grayed out indicating they can not be changed; white
areas are editable.

70 of 155

16. Click on the Data Context drop down menu to display all of the available instances of this instruction
in the controller project. Note that the base definition is one of the choices. From here the user can
directly focus on the logic of any instance. Try it.

Online Monitoring an AOI


17. Go back to Conveyor_1 routine. (Double click on the routine to open it)
18. Make sure the following input values are set to 1.

C1_Entrance_PE

C1_Exit_PE

C1_Stop_PB

Notice the Start_Command output is off.

If an input is not set to 1, place the cursor on the actual value and type a 1 into the field. Press Enter
key to accept value change.
19. Make the Start_Push_Button input true by entering a 1 in the value field.

71 of 155

20. Notice the conveyor is now running. The Conveyor_Running output is now on.

Lets look at the code for this now.


21. Right click on Conveyor_Core and then pick Open_Instruction_Logic like we did before. Notice
that it matches the instruction and we can see what is happening if something was not working.
22. Go back to the Ladder routine and make Entrance_PE, Exit_PE, and Start_Push_Button 0.
23. The Start_Command output should go off after 20 seconds. Why?
24. Go back to the definition and find the line of code that caused it to go off.

26. Now go and look at the other instances of the code. Use the Data Context dialog. Notice they are in
a different state than this one. This is all to show that even though there is only one instance of the
code, each usage has its own data.
27. Feel free to experiment by changing the feedback values on Rung 2 and watch the instruction
operate; for example increasing Conveyor_1.Motor_Feedback to a value > 1000 will cause the
Motor_Over_Speed output to be activated when the Conveyor is running.
28. Close the file within RSLogix5000 using File > Close. Respond with No if prompted to save the file.

Lab 5 Summary
In this lab you got the opportunity to experience the online monitoring capabilities of AOIs. Now you
should have a better appreciation for how AOIs can also ease the troubleshooting phase of your project
deployment in addition to the gains in using them for developing, transporting, and securing your
applications.

72 of 155

73 of 155

Lab 6 Add I/O at runtime <10 minutes>

About this lab


In this section the 1756-OF6VI module located in slot 7 of the demo box chassis will be added to the I/O
tree in addition to the existing 1756-OB16D and 1756-IB16D modules.
Adding 1756 I/O modules in local or ControlNet or Ethernet/IP connected chassis at
runtime to a ControlLogix processor was introduced with V15. Version 17 firmware and
software expands the functionality to also include Powerflex 4 and 7 Drives over
Ethernet. A system installation expanding rapidly at startup or a system that is
undergoing expansion will not require a download to setup and configure a new drive.
Opening an Existing Controller Project
In this section of the lab you will open an existing project.
1. Open CLX_S10_00.ACD using the File > Open menu browsing to C:\Lab Files\Understanding
Advanced Programming Techniques in Logix folder.
2. The project was written for a 1756-L63 controller in slot 1. (Remember, Logix chassis start at the left
with slot 0)
3. Look at your demo case and determine what type of controller you have and what slot it is in.
4. If your controller is not a 1756-L63 then you must change the processor type in the project to match
what you actually have.
5. If it is not in Slot 1 then you can re-configure the demo case to match the project.
6. Click Download from Controller Status

74 of 155

7. The Ethernet driver in RSLinx and the project should already be configured but if it is not or you are
having problems downloading you can configure it as follows.

From the Toolbar menu, select Communications > Who Active

Browse until you find the controller in Slot 1.

Click on the controller.

Click Download.

If you still have a problem downloading see an instructor for help.

8. Select Yes to place the controller in Run mode or use the key switch.

9. Currently the I/O tree contains two modules. The purpose of this lab is to add the 1756-OF6VI
module located in slot 7.

Add 1756 Module while in Run mode


10. To add the module right click on the 1756 Backplane, 1756-A10 and select New Module

75 of 155

11. The module selection box is displayed. Expand the Analog module section and select the 1756OF6VI module as shown.

12. Similar to what would occur if working offline you are prompted to Name the module, specify the Slot
number and configure Electronic Keying. Complete the popup dialog box as shown below. Select
the OK button to continue.

76 of 155

13. You are presented with a dialog box reminding you that you are working online. Select Yes button to
create the module online. Do not check the Inhibit module connection(s) checkbox.

14. The module configuration dialog box is then presented with the Connection tab opened and ?? in the
RPI field. NOTE: if this module were located in a ControlNet rack an additional checkbox would be
visible to specify whether the module would Use a Scheduled Connection over ControlNet.
Unchecking the box allows the module to function immediately without rescheduling the ControlNet
network.

77 of 155

15. Set RPI = 80 ms for the 1756-OF6VI module. We will use the default configuration but feel free to
explore the options available on the other Tabs. Select the OK button to continue. Click Yes when
prompted by the popup box resulting from the addition of the module.

16. Youve just added a module to the I/O tree at runtime. Notice that the 1756-OF6VI module is now in
the I/O tree with the 1756-OB16D and 1756-IB16D modules.

Lab 6 Summary
In this lab we added a 1756 analog module to the I/O tree of a ControlLogix controller while online and in
run mode. This feature allows ControlLogix systems to be expanded without interruption. This feature is
available with local or ControlNet or Ethernet/IP connected 1756 I/O modules and PowerFlex 4 and 7
drives on Ethernet/IP with ControlLogix processors.

78 of 155

79 of 155

Lab 7 Importing Code During Runtime<10 minutes>

About This Lab


In this lab a Routine is imported at runtime to allow the controller to monitor connection status to modules
in the I/O tree. RSLogix5000 V17 introduced features of importing Routines and Add-On Instructions at
runtime will be utilized. NOTE: entire programs may also be imported at runtime.
The system design applied to standard Logix controllers causes Input data to remain in
the last state in the event that a module fault or module inhibit occurs; Inputs that were
ON will remain ON in the database. To determine if the input data is current a GSV
instruction can be used to gather the connection status.
NOTE: This does not apply to GuardLogix safety controllers which monitor connection
status. In the event of a diagnostic failure safety inputs and safety outputs are set to the
safe state (OFF) with GuardLogix safety controllers.

Opening an Existing Controller Project


In this section of the lab you will open an existing project.
1. Open CLX_S11_00.ACD using the File > Open menu browsing to C:\Lab Files\Understanding
Advanced Programming Techniques in Logix folder.
2. The project was written for a 1756-L63 controller in slot 1. (Remember, Logix chassis start at the left
with slot 0)
3. Look at your demo case and determine what type of controller you have and what slot it is in.
4. If your controller is not a 1756-L63 then you must change the processor type in the project to match
what you actually have.
5. If it is not in Slot 1 then you can re-configure the demo case to match the project.

80 of 155

6. Click Download from Controller Status

7. The Ethernet driver in RSLinx and the project should already be configured but if it is not or you are
having problems downloading you can configure it as follows.

From the Toolbar menu, select Communications > Who Active

Browse until you find the controller in Slot 1.

Click on the controller.

Click Download.

If you still have a problem downloading see an instructor for help.

8. Select Yes to place the controller in Run mode or use the key switch.

V17 adds the ability to import a new Routine to an offline or an online project as well as overwrite
an existing Routine in an offline or online project.
Offline Import a new Routine
Overwrite an Existing Routine
Online Import a new Routine
Overwrite an Existing Routine
The import of Routines necessarily includes the ability to add and modify tags. Since a Routine
contains no tags of its own any tags referenced within the Routine must either already exist or be
created upon import.

81 of 155

Import a Routine
9. Lets import the routine to gather the I/O tree module status information. Right click on Conveyor
program and select Import Routine

10. Browse to the C:\Lab Files\Understanding Advanced Programming Techniques in Logix folder;
select the IO_Module_Status.L5X file and click the Import button. NOTE: a shortcut to the Lab Files
folder is located on the Desktop.

11. Click on Tags to see the tags being created. Notice the Data Type Module_Info. This is a UDT that
the routine uses to contain the diagnostic information for each slot. The routine gathers status
information from Slot 0, 2, and 7. Select the OK button when youre ready to import the routine.

82 of 155

Import Logic Edits as Pending: Leave the imported logic as pending edits in the
controller. This is the safest option since none of the imported logic will be running after
the import operation.
When importing a routine or program, the logic will be left in the Pending Edits state.
The user must then go into the routine to accept/test/finalize.
Accept Program Edits: Accept the imported logic edits. When importing a routine or
program, the logic will be left in the Accepted state. The user must then go into the
routine to test/finalize.
Finalize All Edits In Program: The imported logic edits will be finalized as part of the
import. This option is the same as Finalize All Edits in that it will download the logic and
finalize the edits so that it is complete and running as a result of the Import operation.
12. You are prompted on how the Program Logic Edits will be imported. This is displayed whenever an
imported entity contains logic which could potentially be running as soon as the import process is
finished, namely, Routines and Programs. This dialog gives the user the ability to select the state of
the imported logic. Select Finalize All Edits In Program and click the OK button.

13. Now that the Routine is imported we need to add a JSR for it in the Main Routine. Double click on
the Main Routine to open it and add a JSR for the IO_Module_Status routine.

83 of 155

14. Click the Finalize All Edits In Program button shown here:
15. Select Yes when prompted with Finalize All Edits In Program? dialog box.
16. Double-Click on the IO_Module_Status routine to view the application code. The comment applied
to rung zero documents the possible Entry Status values returned by modules. Rung 1 is associated
with the module located in slot 0. Get System Value (GSV) instructions are used to gather the
EntryStatus, FaultInfo and FaultCode connection status information.

17. Verify that the controller I/O status LED is solid green indicating no errors are present; expected value
for Entry_Status = 16384 Decimal for each of your module connections. If you have errors that you
are unable to resolve ask for assistance.

Import an Add-On Instruction


18. Now that the diagnostic information needed for the updated Add-On Instruction has been added to
the code the next step is to import the new Add-On Instruction.
19. Right click on Add-On Instructions and select Import Add-On Instruction

20. Browse to the C:\Lab Files\Understanding Advanced Programming Techniques in Logix folder
and select the Conveyor_Core_1_01.L5X file and select Import button.

84 of 155

21. In this case the Add-On Instruction being imported has the same name as an existing one.
Acknowledge the situation by clicking on the OK button.

22. As a user you are presented with a dialog box that allows you to change the Final Name of the AddOn Instruction being imported which will change the Operation from Use Existing to Create New.

23. Change the Final Name to Conveyor_Core_1_01 as shown below and then click the Operation
area and now the software will allow the Add-On Instruction to be created because no name collision
exists. Select the OK button to complete importing the updated Add-On Instruction.

24. In the Controller Organizer the Add-On Instructions folder should indicate two instructions are
available: Conveyor_Core and Conveyor_Core_1_01

25. Lets add a new conveyor line using the updated Add-On Instruction which uses the diagnostic
information gathered via the IO_Module_Status routine. Right click on Conveyor Program and
select New Routine. Name the routine Conveyor_3 with type Ladder Diagram. Double click the
newly added Conveyor_3 routine to start editing rung 0.

85 of 155

26. As expected there are two Add-On Instructions to select from. Place the mouse pointer over an AOI
to see additional information as shown in the image below.

27. Select the Conveyor_Core_1_01 v1.1 Add-On Instruction and configure the input parameters as
shown below creating a new tag Conveyor_3 with type: Conveyor_Core_1_01.

28. Now that the code for the additional conveyor is configured in the controller it needs to be called by
the application. Double click on the Main Routine and add a JSR for the new routine Conveyor_3

as was done previously


and Use the Finalize All Edits in Program button
with the IO_Module_Status routine. Edits to the Conveyor_3 and Main routines are both finalized.
29. When completed your Main routine should appear as below:

30. Flip the switch labeled DI13 to the right to set Local_2:I.Data.9 = 1; this is configured as the
Conveyor_3.Stop_Push_Button input parameter.

86 of 155

31. Double click on the Conveyor_3 routine to allow monitoring. In the demo box push the button
labeled DI1/DO3 which is connected to Local:2:I.Data.1 pin specified as the Start_Push_Button for
Conveyor_3 AOI. The instruction should appear as below indicating that the Conveyor_Running
and Motor_Under_Speed bits are active for 20 seconds after that it Conveyor_Running will turn off
similar to the original AOI. NOTE: To restart Conveyor_3 push Start_Push_Button DI1/DO3 while
leaving Entrance and Exit PE = 0 and Stop_Push_Button high. Start_Push_Button must be high
for at least 500 microseconds.

32. Right click on Conveyor_Core_1_01 and select Open Instruction Logic. Notice that this AOI has
an extra input parameter Input_Module_OK. Information for this tag is gathered from the
IO_Module_Status routine. This version of the Conveyor AOI uses the status information gathered
from the Input module to stop the Conveyor in the event that the controller experiences an error
communicating with the input module.

33. Lets test it. Start both conveyors and notice the difference when you pull the input module from the
chassis to cause a fault to occur.
NOTE: it may be helpful to add a new window to allow simultaneous monitoring of Conveyor_1 and
Conveyor_3 routines. To start Conveyor_1 set Entrance and Exit PE = 0 and toggle
Start_Push_Button tag high.
34. If your configuration is correct both Conveyor_1 and Conveyor_3 should start as expected;
however, when the 1756-IB16D module is removed from the chassis while the conveyors are running
Conveyor_1 will continue running and Conveyor_3 will stop running.

Lab 7 Summary
Good engineering practice calls for monitoring I/O modules connection status and implementing
application code to take appropriate action in the event that a controller connection fails. In this case the
appropriate action is to stop a conveyor immediately; in other cases the appropriate action might be to
decrease conveyor speed and sound an alarm.
This lab demonstrates the ability of Logix controllers to monitor I/O modules connections while leveraging
the power of online editing available with v17 RSLogix5000. You should now have a better
understanding of the capabilities available for system monitoring, expansion and editing.

87 of 155

Lab 8 - Data Preserved Download Tool <10 minutes>

About This Lab


One tool included with RSLogix5000 in Version 17 allows the ability to download a project without
overwriting the previous values contained in the controller. The Data Preserved Download Tool is
contained within RSLogix5000 and is installed as an option upon initial install. The tool preserves
previously downloaded values and will allow additional tags and logic created to be downloaded.
Opening an Existing Controller Project
In this section of the lab, we will download a project and update data. Then perform a download of offline
values to see if that data changes.
1. Open CLX_S12_00.ACD using the File > Open menu browsing to C:\Lab Files\Understanding
Advanced Programming Techniques in Logix folder.
2. The project was written for a 1756-L63 controller in slot 1. (Remember, Logix chassis start with
slot 0)
3. Look at your demo case and determine what type of controller you have and what slot it is in.
4. If your controller is not a 1756-L63 then you must change the processor type in the project to
match what you actually have.
5. If it is not in Slot 1 then you can re-configure the demo case to match the project.
6. Click Download from Controller Status

7. The Ethernet driver in RSLinx and the project should already be configured but if it is not or you
are having problems downloading you can configure it as follows.

From the Toolbar menu, select Communications > Who Active

Browse until you find the controller in Slot 1.

Click on the controller.

Click Download.

If you still have a problem downloading see an instructor for help.

88 of 155

8. Select Yes to place the controller in Run mode or use the key switch.

9. Maximize RSLogix5000. Make sure the project is online with the controller.
10. First, we need to make sure the Controller Path is correct in the project. It should be:

11. Open the routine CustomEntryFormatting.


12. Change the tag ToleranceValue to 19 on Rung 0 as shown.

13. Go offline and close the project. Do not save the project!
14. Open the project CLX_S12_00.ACD.
15. Make sure the path is setup the same as it was before in step 2.

89 of 155

16. Open the routine CustomEntryFormatting. The ToleranceValue tag is now back at its
program default of 3.

17. Create a simple, new rung like below as rung 1. This will allow us to confirm that the download
did indeed take place. The tags Input1 and Output1 already exist, so it is not required to
create them.

18. Click on Tools menu and select RSLogix5000 Data Preserved Download Tool.

Note: An error will occur if more than one instance of RSLogix5000 is open.

90 of 155

19. Click OK to change the controller mode to Remote Program.

20. The Data Preserved Selection Form appears with three radio buttons. Since we want to
preserve the tag values inside our contoller, select the Preserve Tags radio button and then OK
to the warning:

Preserve Tags Downloads a copy of the program, but preserves the current online
values
Skip Data Preservation Downloads values in the off-line file to the controller
Recover previously preserved data a Comma Separated Variable (.CSV) file which
contains a previous set of values from a preserved tag download. It allows you to recall a
past set and download those initial values.

21. The window will begin to show progress with status messages for the download.

91 of 155

22. After the download is complete, change the controller to Remote Run by clicking OK.

23. Once the process completes, a window with Update process completed successfully
message should appear. Click the OK button on the information window to exit the RSLogix5000
Data Preserved Download Tool.

24. In our RSLogix5000 offline project CLX_S12_00.ACD, our ToleranceValue tag is 3.

92 of 155

25. Now go Online with the controller:

26. The ToleranceValue tag is 19 just as it was when it was updated online and the new rung that
was added exists online.

Lab 8 Summary
If this was a large production system with numerous process variables a quick download of a program
with old values may cause issues. No manual actions are required to make sure the tag preservation
occurs. Additionally, the new tags and logic in a new download are added with their offline value.

93 of 155

Lab 9 Using a CompactFlash Card with a Logix Controller <10 min>

About This Lab


A few Logix Controllers have a CompactFlash slot designed to read and write data to a CompactFlash
card. This allows critical process data or recipes to be saved external to the memory of the controller.
Custom message instructions are used to do file operations on the CompactFlash card. The messages
are used to create, write, read, and delete both files and directories on the CompactFlash card.

Before you Begin


This lab requires that a Compact Flash card be installed in the controller. Availability of cards maybe
limited please contact your instructor if you wish to complete this section of the lab.
Using a compact flash card reader connected to the PC copy files from C:\Lab Files\Understanding
Advanced Programming Techniques in Logix\Files to be placed on Compact Flash onto your
Compact Flash card. Your controller will accept a Compact Flash card either in the front of the module
which is a Series B controller or by removing the controller and inserting on the bottom which is a Series
A controller.

Controllers that allow CompactFlash card read and write:


1756-L61, 1756-L62, 1756-L63, 1756-L64, 1756-L65 and 1769-L35E*
*1769-L35E CompactLogix support of this functionality was started in Fall 2009.
Previous versions did not meet EMI specifications with CompactFlash installed. 1769L32E CompactLogix processors are expected to support this functionality in Spring 2010.

Opening an Existing Controller Project


In this section of the lab, we load the controller project.
1. Open CLX_S13_00.ACD using the File > Open menu browsing to C:\Lab Files\Understanding
Advanced Programming Techniques in Logix folder.
2. The project was written for a 1756-L63 controller in slot 1. (Remember, Logix chassis start with
slot 0)
3. Look at your demo case and determine what type of controller you have and what slot it is in.
4. If your controller is not a 1756-L63 then you must change the processor type in the project to
match what you actually have.

94 of 155

5. If it is not in Slot 1 then you can re-configure the demo case to match the project.
6. Click Download from Controller Status

7. The Ethernet driver in RSLinx and the project should already be configured but if it is not or you
are having problems downloading you can configure it as follows.

From the Toolbar menu, select Communications > Who Active

Browse until you find the controller in Slot 1.

Click on the controller.

Click Download.

If you still have a problem downloading see an instructor for help.

8. Select Yes to place the controller in Run mode or use the key switch.

Using code to list files and directories


The code used in this section messages at the lowest level to perform operations on the CompactFlash
card. The interface will be numerical commands to the add-on-instructions and routines developed to
interface to the CompactFlash. You will enter numeric commands and see results displayed in the tags of
the controller.

Functions to Write and Read CompactFlash


1 Clear data from UDT
2 Read data from file with offset
3 Write data to file with offset
4 Append Data to file
5 Delete file/directory
6 Rename file/directory
7 Create directory
8 List files/directories with search pattern
9 List file attributes
10 List directories only

95 of 155

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.

11. In CF_RW_functions.command member, set it to a value of 8. After the number is entered,


Press Enter on the keyboard. This completes the write to the controller tag. It will disappear
immediately. Look at the value of CF_RW_Functions.result. When positive, it displays the
number of files found. When negative an error has occurred performing an operation.
If you have an issue that results in a negative error value please alert the instructor.

96 of 155

12. Names of files and directories found on the CompactFlash 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 CompactFlash operations.

97 of 155

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 CompactFlash card.

The 10 function is used to list directories only.


16. Enter NewDirectory in the CF_RW_functions.name member. Set the Command value to 7.
You have now created a directory called NewDirectory. To verify this result, set the Command
to 1 and then set to 10.

The 7 function creates a directory on the CompactFlash card.

Create, Edit, and Delete a File


17. Set the Name member to mistake.tx. Set the REQ_Length to 235 and then Set Command to 3.

98 of 155

The 3 function creates a file on the CompactFlash card.


18. You have now created a file called mistake.tx. To verify this result set Command to 1 then to 8.
You will see mistake.tx in list of files on the CompactFlash.

19. 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.
The 6 function renames a file on the CompactFlash card.
20. Check the result and see that the name was changed. Set Command to 1 then to 8. The name
has changed in the list.

21. To delete the file, Set Name member to correctedmistake.txt and Set the Command to 5.
The 5 function deletes a file on the CompactFlash card.
22. Check the result and see that the file was deleted from the CompactFlash. Set Command to 1
then to 8.

99 of 155

Read Data from CompactFlash


23. Now you will read data from the CompactFlash card and compare to how the file looks on a PC.
Open Fivek.txt in notepad by browsing to C:\Lab Files\Understanding Advanced
Programming Techniques in Logix folder in windows explorer. It is simply a repeating pattern
of alphabetic characters.

24. Revert back to RSLogix5000 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 Radix to ASCII. Compare this to the data we see in Notepad.

The 2 function reads a file on the CompactFlash card.

100 of 155

25. 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.

Storing and Loading Recipe Data


26. In RSLogix5000, expand the Check_CFcode program and double click to monitor the Program
Tags. Use the +, to expand the active_recipe tag. Fill in some names and values or use the
ones provided.

101 of 155

27. 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.

28. Return to Check_CFcode and double click on Program Tags again. Change some names and
values in the active_recipe tag.

29. Open the Recipe_Handling routine and trigger rung 2 (toggle the bit load_recipefromrecipe1).

30. Check the values by double clicking on Program Tags. The values were read back from the
recipe 1 file.

102 of 155

31. Open the Recipe_Handling routine and trigger rung 1 (toggle the bit store_recipe2recipe2).

32. 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 CompactFlash card.

33. If a CompactFlash reader has been provided, you may want to view the files. Please remove the
controller and carefully place the CompactFlash card into the reader. Please feel free to view the
files you created and how the data appears.

103 of 155

Lab 9 Summary
Use of an industrial CompactFlash card is recommended (part number 1784-CF64 or 1784-CF128)
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 dependant 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 CompactFlash.

104 of 155

Lab 10 Controller Change Logging <10 minutes>

About This Lab


The Controller Change Logging feature allows a developer to implement controller level change
management. A probable scenario for implementation is for a machine developer, such as an OEM, who
would like to understand what controller changes occurred with a machine that has been put into service
for a customer. To view the diagnostic information in the log file a user removes the CompactFlash card
then uses a CompactFlash card reader to view a log file in TSV (Tab Separated Variable) format on a PC.
The changes are logged to internal memory and include:

Download

Online edits occurred

Forces enabled/disabled

Mode changes (Program, Run)

Major faults.

The Logix Controller will temporarily store up to 100 log entries in its internal memory which is separate
from the user (RSLogix5000 project) memory. When the Log file is 80% full in the controller it can
automatically write to a file on a CompactFlash card or a user can force a write to the CompactFlash
using a message instruction. In the event of a power loss (without battery backup) or a controller
firmware update, the log files are erased.
In this section, you will view sample code that is provided as a resource with the RSLogix5000 Version 17
release to develop an understanding of how change management is configured.

Before you Begin


This lab does not require that a Compact Flash card be installed in the controller. But, one maybe used
to view the results of this lab procedure. Availability of cards maybe limited please contact your instructor
if you wish to complete this section of the lab.
Your controller will accept a Compact Flash card either in the front of the module which is a Series B
controller or by removing the controller and inserting on the bottom which is a Series A controller.

Opening an Existing Controller Project


In this section of the lab, we load the controller project.
1. Open CLX_S14_00.ACD using the File > Open menu browsing to C:\Lab Files\Understanding
Advanced Programming Techniques in Logix folder.

105 of 155

2. The project was written for a 1756-L63 controller in slot 1. (Remember, Logix chassis start with
slot 0)
3. Look at your demo case and determine what type of controller you have and what slot it is in.
4. If your controller is not a 1756-L63 then you must change the processor type in the project to
match what you actually have.
5. If it is not in Slot 1 then you can re-configure the demo case to match the project.
6. Click Download from Controller Status

7. The Ethernet driver in RSLinx and the project should already be configured but if it is not or you
are having problems downloading you can configure it as follows.

From the Toolbar menu, select Communications > Who Active

Browse until you find the controller in Slot 1.

Click on the controller.

Click Download.

If you still have a problem downloading see an instructor for help.

8. Select Yes to place the controller in Run mode or use the key switch.

106 of 155

9. Expand the Tasks folder in the controller organizer the project tree to reveal the following
MainProgram and its associated routines.

10. Open the MainRoutine


11. Scroll down to Rung 1.
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.

107 of 155

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.

GSV Attribute

Description

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 CompactFlash card.

Exec Modify Count

Number of entires 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).

108 of 155

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 Total Count and Unsaved count are 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 CompactFlash 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
CompactFlash card. This is currently done on command by toggling the Write bit.

Note: The write message will error out if no CompactFlash 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 CompactFlash
card. Rung 3 is a GSV that reads that status back. By setting the Controller to Automatically
Write Entries to the CompactFlash, at 80% of the controllers internal memory the log entries will
be automatically be copied to the CompactFlash Card.

109 of 155

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.
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.

110 of 155

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 is 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 1 is the slot of the controller.

111 of 155

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,1 by selecting the controller from
the project tree.

23. Close the Message Configuration dialog.


24. Lets 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.

112 of 155

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 RSLogix5000. Right click and open the file ControllerLogSample.txt with Microsoft
Excel contained in C:\Lab Files\Understanding Advanced Programming Techniques in Logix
folder or if you have a Compact Flash Card installed in the controller remove it and place it in the
Compact Flash card reader to view the log file it contains which will be a .TSV file stored on the
root directory.
For lab simplification a Compact Flash card may not be installed in the controller. The file provided is a
replica of what we might find after making the changes. The top left corner specifies the type of file, date
of file, type of controller, serial number, and firmware revision of the controller.

113 of 155

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
where 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 10 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.

114 of 155

Lab 11: Device Based Alarms in RSLogix5000 <15 minutes>

About This Lab


This lab steps through the configuration steps associated with developing a RSLogix5000 application
with Device Based Alarms Instructions ALMD and ALMA.
To monitor alarms in a Logix5000 controller, a Rockwell Automation Device Server
(RSLinx Enterprise) is added to a FactoryTalk View SE application. The device server
subscribes to alarms in the controller and publishes the alarm information to FactoryTalk
Alarms and Events services.
The diagram below describes how device-based alarm monitoring works:

ALMD Instruction
In this section of the lab, you will open an existing RSLogix5000 application and add ALMD and ALMA
instructions to a new Program called Alarms.
1. Open CLX_S15_00.ACD using the File > Open menu browsing to C:\Lab Files\Understanding
Advanced Programming Techniques in Logix folder.

115 of 155

2. This will launch the project in RSLogix5000. In the left pane, expand the folders Tasks > Main Task
> Conveyor. Right Click on Conveyor and select New Routine

3. Enter Alarms as the name of the new Routine and click OK button

4. Double-click on the Alarms routine which will open the ladder editor. Configure the first rung with an
XIC (Examine if Closed) contact and an ALMD (Alarm Digital) instruction. Alarm instructions are
available from the Alarms tab of the Language Element toolbar, whereas the XIC instruction can be
found on the Bit tab.

116 of 155

5. Right click the ? over the XIC instruction and select New Tag. Enter Valve1FTO_Alm_Trig as the
tag name selecting BOOL as the data type and Scope of CLX this should be a controller scoped tag.

6. Inside the ALMD instruction, right-click the ? and select New Tag. Enter Valve1_FTO as the new tag
as shown. Specifying the tag to be Controller scoped. Click the OK button when completed
configuring the new ALMD tag.

117 of 155

7. Configure the ProgAck, ProgReset, ProgDisable, ProgEnable tags with the tags associated with
the Valve1_FTO ALMD structure.
The completed rung should appear as:

ProgAck, ProgReset, ProgDisable, ProgEnable tags may also be associated with tags
outside of the ALMD instruction tag which is useful for acknowledging all alarms at once
with one tag.

8. Select the

on the ALMD instruction to view the Valve1FTO ALMD instruction properties.

Configure as shown below. Use the


button to create controller scoped Associated Tags
Valve1Position type DINT and Valve1Flow type REAL

118 of 155

ALMD configuration options:


Minimum Duration: specifies the minimum amount of time that the alarm condition
must be true (the Input=1 in this case) before the alarm condition goes In Alarm. This
setting is used to minimize false alarms.
Alarm Class: To help group alarms, you might want to classify alarms that relate to
each other in ways that do not include severity or priority. For example, you might want to
group together alarms by function, such as those that monitor for valves that fail to open
or close, pressure, temperature, equipment running, or tank levels. The alarm class is a
text string of up to 40 characters that you enter when configuring an alarm.
At run time, the value of the alarm class is recorded in the Alarm and Event History Log
and can also be displayed in the Alarm and Event Summary or Alarm and Event Log
Viewer. The contents of the Alarm and Event Summary or Alarm and Event Log Viewer
can also be filtered based on the value of the alarm class.
FactoryTalk View Command: A command of up to 1000 characters can be associated
with any alarm. The command is executed from the Alarm and Event Summary or Alarm
and Event Banner when the operator selects an alarm and then clicks a button. A
common use for the FactoryTalk View command is to display a screen that shows a
detail of the equipment related to the alarm.
Associated Tags: Specify up to four tags that contain pertinent data when alarm
conditions occur. A snapshot of the values in these tags is stored whenever the .In
condition changes to the In Alarm state or other alarm state changes occur. The stored
values are transmitted to the alarm subscribers. The stored values may also be
embedded in the alarm message.

9. In the ALMD Properties dialog box, select the Status tab where the In Alarm Time and Return To
Normal Time may be monitored online.

119 of 155

10. Click OK to close the ALMD properties dialog box.

ALMA Instruction
Continue working offline in RSLogix5000 with the CLX_S15_00.ACD file. In this section of the lab we will
add an ALMA (Alarm Analog) instruction to the Alarms routine.
11. Create a new rung below the rung just created with the XIC and ALMD instruction. On the new rung
insert an ALMA instruction with no conditions because we want to monitor the input value every time
the Alarms routine runs.

12. Right click on the ? to the right of ALMA and select New Tag. Create a Controller scoped tag
named Line1Pressure_ALM. Click OK button to finalize creation of the new tag.

120 of 155

13. Right click on the ? to the right of In and select New Tag. Create a new Controller scoped tag
named Line1Pressure_IN with type REAL. This is the value that the ALMA instruction will monitor
and alarm when outside of the defined boundaries. Select the OK button to finalize the creation of
the new tag.

14. Configure the ProgAckAll, ProgDisable, ProgEnable tags with the associated ALMA
Line1Pressure_ALM structure tags similar to how the ALMD is configured in rung 0.
button within the ALMA instruction to open the ALMA Properties dialog box. Configure
15. Click the
the ALMA instruction as shown.

121 of 155

16. Select the Messages tab of the ALMA instruction and enter the messages as shown; click OK to
accept the changes.

ALMA configuration options:


Alarm conditions: can be enabled or disabled using the checkboxes to the left of the
corresponding condition name.
Input Rate of Change: Rate of Change alarm conditions are disabled when their limits
are set to 0. For this lab, the rate of change alarm will not be configured.
Deadband: With certain kinds of measured values, such as line pressure, input values
can fluctuate rapidly above and below a critical limit. Where such conditions exist, you
can create a deadband as a buffer zone to prevent the fluctuations from re-triggering
unnecessary alarms. For the High and High High alarm conditions, the tag value must
drop below the alarm limit minus the deadband before the alarm condition goes Normal
(Out of Alarm). For the Low and Low Low alarm conditions, the tag value must go above
the alarm limit plus the deadband before the alarm condition goes Normal.
The following diagram shows how deadband settings affect an alarm's transition between
In Alarm and Normal states.

122 of 155

17. The Alarms routine should now contain 2 rungs. One including an ALMD and the other an ALMA as
shown below.

Lab 11 Summary
You should now have a better idea of how easy it is to configure Device Based Alarm instructions within a
RSLogix5000 project and an awareness of the functionality associated with these instructions.

123 of 155

124 of 155

Lab 12 Device Based Alarms FactoryTalk View SE <15 minutes>


In this lab the process of creating a new application in FactoryTalk View SE to monitor Device Based
Alarms (ALMD and ALMA) configured in a RSLogix5000 application.
button followed by selecting Programs\Rockwell
1. Start FactoryTalk View Studio from the
Software\FactoryTalk View\FactoryTalk View Studio
2. When prompted select Site Edition (Local) as the application type to configure and click the
Continue button.

3. Select the New tab when prompted in FactoryTalk View Studio with the New/Open dialog box; enter
FTAE as the application name. Specify English as the Language and click the Create button.
NOTE: it will take a minute or so for the new application to be created and opened.

125 of 155

4. If prompted on which Faceplates to import click the Clear All button followed by the OK button.

Configure Historical Alarm and Event Logging


FactoryTalk Alarms and Events can log alarm and event information to a database so
that the information can be viewed or reported on at a later date. Microsoft SQL Server
2005 Express has been installed for this lab.
The Alarm and Event Log Viewer object is used to view the historical alarm and event
information in a simple grid view.
5. In the Explorer window, expand the folders System > Connections > Databases folder. We will
create a new database named FTAE_History. Right-click on Databases and select New Database.

126 of 155

6. Configure the Alarm and Event Historian Database Properties dialog box as shown:

7. Click on the Advanced tab. The system will attempt to create the database and the user account. On
the Database does not exist dialog box, click the Yes button.
Before switching tabs, the system checked if the database already existed. Because the
database did not exist, the following operations were performed:
1)
The database named FTAE_History was created.
2)
The database user account FTAE_Historian was created and assigned database
ownership access to the database.
3)
The tables necessary to store the alarm and event information were created.

127 of 155

8. In the Advanced tab, change the Log events to database every 100 events to 1 event.

This change is just for testing purposes so that we do not have to wait for information to
be logged to the database.
The Log events to database every settings control how many events are cached before
sending them to the database. This makes writing to the database more efficient. The
events are cached to a file located on the computer hosting the alarm server that is
generating the alarm and event information.
If the connection to the database is lost, alarm and event information will continue to be
cached to files. Once the connection is restored, the cached information will be sent to
the database.
The Limit database buffering to settings control how much information will be cached if
the database connection is lost for a long period of time. Once the limits are reached the
oldest information is overwritten.
9. Click OK to save the Database Definition.
10. When completed there should be at least two databases FTAE_History which was just created and
FTAE_done which is used elsewhere.

128 of 155

11. In the Explorer window of FactoryTalk View Studio, right-click FTAE displayed under the topmost
entry
(CORE) and select Add New Server. Select Rockwell Automation Device Server
(RSLinx Enterprise).

12. The properties are then displayed; keep the default name RSLinx Enterprise

13. Select the Alarms and Events tab and configure as shown below; click OK button when
configuration is completed.

129 of 155

You have just configured the RSLinx Enterprise server to send its Alarm & Event
information to the database.
The Log language setting is related to the Language Switching feature which allows you
to configure multiple languages for user defined strings that can be switched between at
runtime. The combo box allows you to select the language to log alarm messages in.
(The alarm and event log is limited to a single language).

14. The new Device server RSLinx Enterprise is added to the FTAE application

15. Create a shortcut to our ControlLogix controller by double-clicking on RSLinx Enterprise to expand it
and then double click on Communication Setup.
16. The Communication Setup dialog box allows us to Add a shortcut named CLX and browse over the
Ethernet network with the provided driver to our ControlLogix demo box.

You have just added a Rockwell Automation Device Server and configured it to subscribe
to Alarms and Events from the ControlLogix controller in the demo box. When the alarm
server starts, RSLinx Enterprise will connect to the controller, upload the state of all
alarms (ALMD and ALMA) configured within that controller and publish this information to
the FactoryTalk Alarm and Event system. The alarm server will start automatically when
the operating system initializes.
17. Click OK button to complete the Communication Setup.Click Yes to apply changes to the CLX
shortcut you have just configured.

130 of 155

Create FactoryTalk View Graphics interface


In this section of the lab we will create an interface for the FactoryTalk View application
18. If you have not already done so, maximize the FactoryTalk View Studio window
19. In the Explorer window, right-click Displays (located under the Graphics folder) and select New

20. Resize the resulting blank display to occupy the full width of the display and about 2/3 of the
workspace height.
21. On the Objects menu, point to Alarm and Event, and then click Summary (or on the toolbar, click
the Summary button, shown outlined in red:
). The mouse pointer
changes to the Object drawing cursor.
22. Using the mouse, drag the rectangle to fill the display. Start in the upper left corner, drag down to the
lower right and then release the left mouse button.
The Alarm and Event Summary object should appear in the display as follows:

23. On the Edit menu, click Display Settings.

131 of 155

24. On the Properties tab, make the following changes (see image below for details):

Under Cache After Displaying, select Yes and specify the Always Updating check box.
Clear the Title Bar check box.
Select the Size to Main Window at Runtime check box.

Cache After Displaying keeps the display in memory when you close the Alarm and
Event Summary display, and shortens the time required to re-open the graphic display.
When the cached display is not visible and the Always Updating check box is selected,
the Alarm and Event Summary continues to be updated with changes in alarm statein
the same way that your e-mail client continues receiving email even when it is minimized.

25. Click OK button to save Display Settings changes.

132 of 155

26. Save the display by clicking the Save button


on the toolbar. In the Save dialog box, type Alarm
Summary for the name of the display and then click OK.

27. Close the newly created Alarm Summary Display by clicking the X close button in the upper right.
28. In addition to creating displays from scratch FactoryTalk View also allows displays to be imported.
Right click on Displays under the Graphics folder and select Add Component into Application

29. Click the Desktop shortcut from the left and click on the Lab Files shortcut. Select all the gfx files
using Shift key and click the Open button to import the associated *.gfx files.

30. Similarly right click on Macros, and Client Keys and add the preconfigured components from C:\Lab
Files\Understanding Advanced Programming Techniques in both instances. Importing standard
preconfigured displays saves development time and eases standardization.

133 of 155

Startup Macro calls three displays:


Menu Bar (Docked to the Top), OverView, and
Alarm Banner (Docked to Bottom)

Client Keys is associated with F5 function key:


Aborts the existing Client displays and calls the
same three displays as at Startup. This is useful
for updating Client displays without closing and
reopening the entire Client application.

Creating FactoryTalk View Client file


31. Initiate the FactoryTalk View Studio SE client file creation using the Windows
button and
selecting Programs\Rockwell Software\FactoryTalk View\FactoryTalk View Site Edition Client

32. Click New button in FactoryTalk View SE Client Wizard

33. Enter the name FTAE for the client file to create; selecting the default location to store the application
file: C:\Documents and Settings\All Users\Documents\RSView Enterprise\SE Client and click
the Next button

134 of 155

34. Select Local for the type of SE application file the client will connect to and click Next button.

35. Specify the FTAE FactoryTalk View Studio application file to connect to and click the Next button.
Note: it may take a few moments to transition to the next step

36. Specify the Client Keys file and Startup Macro as shown in the image below. Note: an initial
display is not required because the Startup Macro calls the displays required and defines the docking
locations for the Menu bar <top> and Alarm Banner <bottom>. Click the Next button when completed.

135 of 155

37. Enter an appropriate name within the Title bar and check the check box for Maximize Window.
Click Next to continue to the next step of the client file creation.

38. Leave Auto log out disabled. Click Next to continue.

39. Select Save configuration and exit. We will download the controller application file prior to starting
the FactoryTalk View SE client.

Lab 12 Summary
You should now have a better understanding of what it takes to create a FactoryTalk View SE application
to receive and display Device Based Alarms configured in a Logix controller.

136 of 155

Lab 13 Observe Device Based Alarming <10 minutes>


In this lab you experience Device Based Alarming in a functioning demo. This lab utilizes files based on
those covered in the previous labs.
1. Open CLX_S16_00.ACD using the File > Open menu browsing to C:\Lab Files\Understanding
Advanced Programming Techniques in Logix folder.
The project was written for a 1756-L63 controller in slot 1. (Remember, Logix chassis
start addressing with slot 0). If the controller is not in Slot 1 then you can re-configure the
demo case to match the project.
2. Click Communications from the toolbar of RSLogix5000 and select Who Active

3. Browse to the 1756-L63 processor in slot one of your ControlLogix chassis and select Download.
Request assistance if you have any difficulties.

137 of 155

4. Select Yes to place the controller in Run mode when prompted or use the processor key switch to
enter Remote Run mode.

5. Right-click on the controller in the Controller Organizer and select Properties to access
Controller properties

6. Select the Date / Time tab and select the Set Date, Time and Zone from Workstation to verify that
the Date and Time is configured correctly.

In this dialog, the Adjust for Daylight Saving option indicates if the Date and Time
parameter is adjusted for Daylight Saving or not. You must intentionally alter this option; it
is not automatically adjusted by the controller. In other words, if the current controller is in
daylight saving time, the Time Zone is (GMT-05:00), and Adjust for Daylight Saving
(+01:00) is on. When the controller is out of daylight saving time, the Adjust for Daylight
Saving (+01:00) in the controller is still on.
It is your responsibility to turn the Daylight Saving Time option off. Turn off the Adjust for
Daylight Saving on the Controller Properties Date/Time tab. When the Adjust for Daylight
saving box does not have a checkmark, the Daylight Saving Time option is off.

138 of 155

7. Click the OK button once the controller Date and Time have been verified. This step is important
because Time stamping for Device Alarms is defined by the processor.
8. Expand the Conveyor program within the Main Task and double-click on the Alarms routine. Notice
that an ALMD instruction has been added associated with the 1756 I/O modules controller connection
status that are associated with this lab (slots 0, 2, and 7)

9. Select the

button on the ALMD and ALMA instructions to explore their configurations.

10. Shown above is the Status tab of the ALMA instruction. Notice the different status information
available: current alarm condition, acknowledgement status with time stamping and alarm counts.
Also note the commands that are available: Acknowledge, Reset Alarm counts, Disable and
Suppress. The same functionality and status is available within FactoryTalk View SE applications
which are explored next. The status tab of the ALMD instruction is very similar.
11. Minimize RSLogix5000 and leave the software online with the processor.

139 of 155

Observe FactoryTalk Alarms & Events within SE Client application


12. Double click on the FTAE_done.cli file found in the C:\Lab Files\Understanding Advanced
Programming Techniques in Logix folder. This will launch a FactoryTalk View Studio client file that
has been configured to monitor the Device Based Alarm instructions configured within the
ControlLogix processor.
NOTE: it may take several minutes for the client application file to start.

Menu Bar

Overview

Alarm Banner

140 of 155

13. On the Menu Bar display located in the upper portion of the SE client application, click the Alarm
Summary button. The Alarm Summary display should appear in the FactoryTalk View SE Client.

14. Move your mouse pointer across the shortcuts of the Alarm Summary to view their descriptions as is
shown above for the

shortcut which is for Ack selected alarm.

15. On the Menu Bar display, click the Trigger Digital Alarm button followed by the Clear Digital Alarm
button. Observe that no alarm appears in the list. This is due to the Minimum Duration setting which
in this case requires that the alarm input (Valve1FTO_alm_trig) be equal to 1 for 3 seconds before the
alarm will trigger. Minimum Duration configuration is useful for minimizing false alarms.
16. Click the Trigger Digital Alarm button again but this time do not click the Clear Digital Alarm button
and wait 3 seconds. The digital alarm should appear in the Alarm and Event Summary and Alarm
Banner at the bottom of the SE Client window as shown below

17. Select the Valve1 alarm in the Alarm Summary list and view its attributes in the Details Pane. Use
the Details Pane toggle shortcut

in the Alarm Summary display if the Details Pane is not visible.

Observe the values for the Severity, Alarm Class, Tag 1 Value and Tag 2 Value attributes that we
configured for the digital alarm.
Also notice the Alarm Count. This attribute indicates the number of times the alarm has entered the
In Alarm state. The Alarm Count can be reset from RSLogix5000 and from the Alarm Status Explorer within
the SE Client application. The shortcut
to the Alarm Status Explorer is available in the Alarm Summary.
This same information is available in RSLogix5000 on the status tab of the ALMD instruction.

141 of 155

18. Double-click on a Valve1 alarm message within the Alarm Banner at the bottom of the client display
to experience a FactoryTalk Command embedded within an ALMD instruction. In this case the
ALMD instruction has been configured to display a detail graphic for Valve1. If no Valve1 alarm
message is visible create one using the Trigger Digital Alarm button from the Menu Bar. The
Valve1 Detail allows the user to view the current position, flow and alarm status for Valve1.

19. Click the Close button on the Valve1 Detail popup dialog box when completed.
20. On the Menu Bar display, click the Trigger HI Alarm button to trigger the High alarm condition which
will then appear in the Alarm and Event Summary.

21. Select the alarm in the list and view its attributes in the Details Pane. You may need to scroll or
resize the Details Pane to see all the information. Note that this is the same information that was
listed on the Status tab of the ALMA instruction.

22. Experiment with the SE Client application using the Menu Bar display to trigger different alarm types.
and
buttons to experience the deadband of 2 that is configured for the ALMA
Use the
instruction. For example selecting the Trigger HI Alarm button from the Menu Bar sets the value the
to
ALMA instruction is monitoring = 82 when the HI Alarm is configured for 80. Use the
decrease the ALMA monitored value by one for each click. The alarm stays active until the value =
77 because the deadband = 2. The Deadband setting can be used to prevent fluctuations in analog
values from re-triggering unnecessary alarms.

142 of 155

23. Click the Alarm Status Explorer shortcut the within the Alarm Summary display.

24. The Alarm Status Explorer dialog box appears showing three entries that RSLinx Enterprise as the
configured Device Alarm Server recognizes from the ControlLogix controller accessed via the [CLX]
shortcut.

[CLX] which is associated with controller status alarms such as the controller changed to program
mode diagnostic that you may have noticed when first starting the client application.
[CLX]Line1Pressure_ALM associated with an ALMA instruction configured in the ControlLogix
application
[CLX]Valve1FTO associated with an ALMD instruction configured in the ControlLogix application

The Alarm Status Explorer is useful for troubleshooting and design time as it provides information for all
alarms in a FactoryTalk system.
The Alarm Status Explorer shows all alarms in a FactoryTalk system and allows the user to:
- Enable the selected alarm
- Disable the selected alarm
- Unsuppress the selected alarm
- Suppress the selected alarm
- Show details for the selected alarm

143 of 155

FactoryTalk Security can be used to control who can perform these operations.
The list of alarms can be filtered based on alarm name as well as the status of alarms.
Rockwell Automation Device Servers (RSLinx Enterprise) generate diagnostic alarms relating to Logix5000
controllers that are producing alarms in a FactoryTalk Alarms and Events system. These alarms are
referred to as controller status alarms and they indicate a problem with the connection to a controller or the
status of a controller. A single controller status alarm is produced for each shortcut that is configured with
alarms and events enabled.
The following conditions cause a controller status alarm to go In Alarm:
Unable to connect to the controller
Unable to get a list of alarms contained in the controller because there is no program or program
download in progress
Unable to subscribe to one or more alarms in the controller because the controller has insufficient
memory to create subscription
Connection to the controller is lost
Controller was switched to Program Mode
Program download
Non-recoverable program fault
Recoverable program fault
Controller status alarms have the same name as the shortcut that references the controller. The alarm
message is not user configurable and the severity for all status alarms is configured in the system-wide
severity settings.
25. Select the Close button to exit Alarm Status Explorer.
26. Clear all alarms from Alarm Summary and Alarm Banner by using the provided Clear Digital Alarm
and Clear Analog Alarm buttons within the Menu Bar at the top of the client application. In addition
to clearing the alarm conditions all the alarms must be acknowledged. Notice the options to
acknowledge alarms: individually with and without comment and an option to acknowledge an entire
page of alarms at once.
27. Pull the 1756-IB16D module in slot 2 out from the backplane to break the controllers connection to it.
Since were monitoring the status of the controller connection this also produces an alarm. Reseat
the module in the chassis when youve completed this step.

144 of 155

28. The FactoryTalk View SE client application is configured with a database that logs all alarm events.
Click on the Log Viewer button on the Menu Bar to view the Alarm and Events Log summary.
Notice that even when the Alarm Summary and Alarm Banner show no alarms currently active or
unacknowledged that the history of alarms is available with details on what happened, when it
happened, etc

29. Close the file within RSLogix5000 using File > Close. Respond with No if prompted to save the file.
30. Close the FactoryTalk View SE client application when completed.

Lab 13 Summary
In this lab you worked explored the use of Device Based Alarms within a FactoryTalk View Client
application. You should now have a better understanding of how Device Based Alarming functions in an
application and some of the features available.
This ends the Understanding Advanced Programming Techniques in Logix Hands on Lab. Feel free to
explore further if time allows. When you are finished please close all applications and cleanup your work
area.

145 of 155

Appendix A Useful AOI Information


Add-On Instructions have many choices you can choose that affect the operation of the instruction. If
you have extra lab time you can choose to look through the following information. It is a subset of the
Logix5000 Controllers AOI publication 1756-PM010.
Using a Routine versus an Add-On Instruction
You can write your code in three basic ways: to run in-line as a main routine, using subroutine calls,
or as Add-On Instructions. The following table summarizes how each of these ways has its
advantages and disadvantages.

Aspect

Main Routine

Subroutine

Add-On Instruction

Accessibility

N/A

Within program (Multiple


copies,

Anywhere in controller (single


copy for the entire project.

one for each program)


Parameters

N/A

Pass by value

Pass by value via Input and


Output Parameter or by
reference via InOut Parameters

Numeric
Parameters

N/A

No conversion, user must


manage

Automatic data type conversion


for Input and Output parameters

Parameters data
types

N/A

Atomic, arrays,
structures.

Atomic for any Parameter Array


and structures must be an InOut
Parameter

Parameter
checking

N/A

None, user must manage

Verification checks that correct


type of argument has been
provided for a Parameter.

Data encapsulation

N/A

Add data at program or


controller scope

Local data is isolated (only


accessible within instruction)

Monitor/debug

In-line code with its


data

Mixed data from multiple


calls, which complicates
debugging

Single calling instance data,


which simplifies debugging.

Supported
programming
languages

FBD, LD, SFC, ST

FBD, LD, SFC, ST

FBD, LD, ST

Callable from

N/A

FBD, LD, SFC, ST

FBD, LD, SFC via ST, ST

Protection

Locked and View


only

Locked and view only

Locked and view only

Documentation

Routine, rung,
textbox, line

Routine, rung, textbox,


line

Instruction, revision info, vendor,


rung, textbox, line, extended
help.

146 of 155

Aspect

Main Routine

Subroutine

Add-On Instruction

Execution
performance

Fastest

JSR/SBN/RTN
instructions add
overhead. Indexed
reference impact

Call is more efficient. InOut


parameters are passed by
reference, which is faster than
copying data for many types.

Memory use

Most

Compact

More than subroutine

Edit

Online/Offline

Online/Offline

Offline only

Import/Export

Only LD rungs with


referenced
tags/UDTs

Only LD rungs with


referenced tags/UDTs

Full instruction definition

Instruction Size
Add-On Instructions have one primary Logic routine that defines the behavior of the instruction when
executed. This Logic routine is like any other routine in the project and has no additional restrictions
in length. The total number of Input Parameters plus Output Parameters plus Local Tags can be up to
512. There are no limits on the number of InOut Parameters. The maximum data instance supported
(which includes Inputs, Outputs, and Local Tags) is two megabytes. The data type size displays on
the bottom of the Parameter and Local Tabs in the Add-On Instruction Definition.

Nesting Add-On Instructions


Add-On Instructions can call other Add-On Instructions in their routines. This provides the ability to
design more modular code by creating simpler instructions that can be used to build more complex
functionality by nesting instructions. The instructions can be nested to seven levels deep.
Programmatic Access to Data
Input and Output Parameters and Local Tags are used to define an instruction-defined data type.
Each Parameter or Local Tag has a member in the data type, although Local Tag members are
hidden from external use. Each call to an Add-On Instruction utilizes a tag of this data type to provide
the data instance for the instruction's execution.
The Parameters of an Add-On Instruction are directly accessible in the controller's programming via
this instruction-defined tag within the normal tag scoping rules.
The Local Tags are not accessible programmatically through this tag. This has impact on the usage
of the Add-On Instruction. If a structured (including UDTs), array, or nested Add-On Instruction type
is used as a Local Tag (not InOut Parameters), then they are not programmatically available outside
the Add-On Instruction definition.

147 of 155

Unavailable Instruction Description


Most built in instructions can be used within Add-On Instructions. The following instructions can not
be used:
Instruction

Description

BRK

Break

EOT

End of Transition

EVENT

Event Task Trigger

FOR

For (For/Next Loop)

IOT

Immediate Output

JSR

Jump to Subroutine

JXR

Jump to External Routine

MAOC

Motion Arm Output Cam

PATT

Attach to Equipment Phase

PCLF

Equipment Phase Clear Failure

PCMD

Equipment Phase Command

PDET

Detach from Equipment Phase

POVR

Equipment Phase Override Command

RET

Return

Safety Instructions

Any of the Safety Instructions

SBR

Subroutine

SFP

SFC Pause

SFR

SFC Rese

In addition, the following instructions may be used in an Add-On Instruction, but the data instances
must be passed as an InOut parameter:
Instruction

Description

ALMA

Analog alarm

ALMD

Digital Alarm

Motion Instructions

All Motion Instructions

MSG

Message

148 of 155

Scan Modes
To provide Add-On Instructions with the same flexibility as built-in instructions, optional Scan mode
routines can be configured allowing you to fully define the behavior of the instruction. The Scan mode
routines do not initially exist for an Add-On Instructions as they are optional and must be created by
the user depending upon the requirements of the instruction.
Like all built-in instructions in the controller, Add-On Instructions support the following four controller
Scan modes:

True - Logic is scanned as the result of a true rung condition or the EnableIn Parameter is set
True.

False - Logic is scanned as the result of a false rung condition or the EnableIn Parameter is set
False. Instructions in the controller may or may not have logic that executes only when that
instruction is scanned false.

Prescan - Occurs when the controller either powers up in Run mode or transitions from Program
to Run. Instructions in the controller may or may not have logic that executes only when that
instruction is executed in Prescan mode.

Postscan - Occurs as a result of an Action in an SFC routine becoming inactive if SFCs are
configured for Automatic Reset. Instructions in the controller may or may not have logic that
executes only when that instruction is executed in Postscan mode.

149 of 155

Prescan Routine
The optional Prescan routine for an Add-On Instruction provides a way for an Add-On Instruction to
define additional behavior for Prescan mode. When a Prescan routine is defined and enabled, the
Prescan routine executes normally after the primary Logic routine executes in Prescan mode. This is
useful when it is desired to initialize tag values to some known or predefined state prior to execution.
An example of initialization is setting a PID instruction to Manual mode with a 0% output prior to its
first execution or to initialize some coefficient values in your Add-On Instruction.
To create a Prescan Routine follow these steps:
1. Click the New button in the Scan Modes tab.

2. The New Scan Mode Routine dialog box appears:

3. Select the type of programming language: Ladder Diagram, Function Block, or Structured Text.
4. Write a description of the Prescan behavior; if desired.
5. Click OK to create the routine and return to the Scan Modes tab.
6. Define if the Prescan routine executes (or not) with the checkbox.

7. Click on OK button to exit the Add-On Instruction Definition dialog box


8. Notice when completed that the Prescan routine is added.

150 of 155

Postscan Routine
Postscan mode only occurs for logic in an SFC Action when the Action becomes inactive and the
SFC language is configured for Automatic Reset (which is not the default option for SFC). When an
SFC Action becomes inactive, then the logic in the Action is executed one more time in Postscan
mode. This mode is similar to Prescan in that most instructions simply execute as if they have a false
condition. It is possible for an instruction to have different behavior during Postscan than it has during
Prescan.
Create a Postscan Routine in the same manner as a Prescan Routine.

EnableInFalse Routine
When defined and enabled for an Add-On Instruction, the EnableInFalse routine executes when the
rung condition is false or if the EnableIn Parameter of the Add-On Instruction is false (0). This is
useful primarily for scan false logic, when used as an output instruction in a Ladder routine. A
common use of scan false is the setting of OTE's to the de-energized state when the preceding rung
conditions are false. An Add-On Instruction can use the EnableInFalse capability to let you to define
behavior for the False conditions.
Create a Postscan Routine in the same manner as a Prescan Routine.

151 of 155

Appendix B Useful FactoryTalk Alarms and Events Information


FactoryTalk Alarms and Events components
The diagram below shows a high-level view of the components of the FactoryTalk Alarms and Events
system.

152 of 155

1. Device-based alarm monitoring


With device-based alarm monitoring, alarm instructions are programmed and then downloaded into
Logix5000 controllers. The controller detects alarm conditions and notifies RSLinx Enterprise of alarm
states. A Rockwell Automation Device Server (RSLinx Enterprise) extracts the alarm information and
publishes it to FactoryTalk Alarms and Events services. The new alarm instructions are available with
RSLogix5000 v. 16 or later.
2. Tag-based alarm monitoring
With tag-based alarm monitoring, a Tag Alarm and Event Server uses tags to monitor programmable
controllers for alarm conditions. When an alarm condition is detected, the server publishes the information
to FactoryTalk Alarms and Events services.
Use tag-based alarm monitoring with:

PLC-5 or SLC 500 controllers, communicating through RSLinx Classic or RSLinx Gateway
Third-party controllers, communicating through OPC-DA servers
Logix5000 controllers that have not been programmed with pre-built alarm instructions available in
RSLogix5000 v. 16 or later

3. FactoryTalk Alarms and Events services


FactoryTalk Alarms and Events services receives alarm information from device-based and tag-based
alarm servers and sends the information to FactoryTalk Alarms and Events objects hosted in FactoryTalk
View. Alarm state changes are sent to the Alarm and Event Historian Log and configuration changes are
sent to the audit log.
4. Alarm and Event Historian Log
The Alarm and Event Historian manages connections between alarm servers and databases and logs
data from each alarm server to a Microsoft SQL Server database. An Alarm and Event Log Viewer allows
viewing and printing data from alarm and event history databases. Third-party database tools can also
retrieve, view, analyze, and print alarm and event history information.
5. Diagnostic and audit logs
FactoryTalk Diagnostics routes messages generated by FactoryTalk Alarms and Events to Local logs on
the computers hosting FactoryTalk components and optionally to a centralized database log. Audit
messages are routed to the Local log as well and to the FactoryTalk Audit Log if FactoryTalk AssetCentre
is installed.
6. Alarm and Event setup and monitoring
FactoryTalk Alarms and Events includes a number of software components that allow engineers and
operators to define alarm conditions, set up alarm servers, view and interact with alarm conditions, and
view historical alarm and event information.

153 of 155

Database definitions
Use database definitions to define logging options from an alarm server to a Microsoft SQL Server
database.

Alarm and Event Summary: Use the Alarm and Event Summary object, embedded in a FactoryTalk
View graphic display, to acknowledge, disable, suppress, filter, and sort alarms during run time.
Alarm and Event Banner: Use the Alarm and Event Banner object, embedded in a FactoryTalk View
graphic display, to monitor and respond to the most serious alarms requiring immediate attention.
Alarm Status Explorer: Use the Alarm Status Explorer object, embedded in a FactoryTalk View
graphic display, to enable or disable alarms and suppress or unsuppress alarms.
Alarm and Event Log Viewer: Use the Alarm and Event Log Viewer object, embedded in a
FactoryTalk View graphic display, to view and filter historical alarm information stored in Microsoft
SQL Server databases.
Diagnostics Viewer: Use the Diagnostics Viewer to view, filter, and export system-generated
diagnostic messages.

System Architectures
Local application on a single computer
The diagram below shows an example system architecture using a Local application as part of a standalone FactoryTalk system.

154 of 155

Network application on distributed computers


The diagram below shows an example system architecture using a Network application as part of a
distributed FactoryTalk system.

155 of 155

Вам также может понравиться