Ra-10-L11 Advanced Programming in Logix5000 - Alarmserver
Ra-10-L11 Advanced Programming in Logix5000 - Alarmserver
Ra-10-L11 Advanced Programming in Logix5000 - Alarmserver
February 2010
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
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
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
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.
9 of 155
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.
11 of 155
12 of 155
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.
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
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.
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.
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.
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.
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>
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
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.
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.
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.
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.
25 of 155
Looking in the tag editor you see a new tag in the database, Conveyor_1.
26 of 155
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.
28 of 155
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
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
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.
32 of 155
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
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
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
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:
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.
42 of 155
3. Right click on the Add-On Instructions folder and select New Add-On Instruction from the dropdown menu.
43 of 155
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.
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.
46 of 155
47 of 155
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.
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.
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.
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.
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
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.
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.
53 of 155
How do you know what the internal elements are named? The AOI follows the same conventions as any
other instruction does.
46. Fill out the dialog as shown specifying Function Block as the Type and click OK button when you
are finished.
54 of 155
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.
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
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
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
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
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.
Click Download.
8. Select Yes to place the controller in Run mode or use the key switch.
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.
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.
C1_Entrance_PE
C1_Exit_PE
C1_Stop_PB
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.
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
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.
Click Download.
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.
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
80 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.
Click Download.
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.
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
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
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.
Click Download.
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:
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
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.
92 of 155
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
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.
Click Download.
8. Select Yes to place the controller in Run mode or use the key switch.
95 of 155
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.
96 of 155
12. Names of files and directories found on the CompactFlash card are displayed in the
CF_RW_Functions.string array members.
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.
98 of 155
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
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.
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.
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
Download
Forces enabled/disabled
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.
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.
Click Download.
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.
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
Number of entries added to the log since the last time the value was reset.
Number of entries in the controller RAM not yet written to the CompactFlash card.
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.
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
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
118 of 155
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
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.
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
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.
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
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:
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.
132 of 155
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
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.
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
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
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
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
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
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
Aspect
Main Routine
Subroutine
Add-On Instruction
Accessibility
N/A
N/A
Pass by value
Numeric
Parameters
N/A
Parameters data
types
N/A
Atomic, arrays,
structures.
Parameter
checking
N/A
Data encapsulation
N/A
Monitor/debug
Supported
programming
languages
FBD, LD, ST
Callable from
N/A
Protection
Documentation
Routine, rung,
textbox, line
146 of 155
Aspect
Main Routine
Subroutine
Add-On Instruction
Execution
performance
Fastest
JSR/SBN/RTN
instructions add
overhead. Indexed
reference impact
Memory use
Most
Compact
Edit
Online/Offline
Online/Offline
Offline only
Import/Export
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.
147 of 155
Description
BRK
Break
EOT
End of Transition
EVENT
FOR
IOT
Immediate Output
JSR
Jump to Subroutine
JXR
MAOC
PATT
PCLF
PCMD
PDET
POVR
RET
Return
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
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.
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.
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
152 of 155
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
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
155 of 155