You are on page 1of 112

Understanding Advanced Programming Techniques in Logix

Presenter: Rod Shearer Commercial Engineering

Understanding Advanced Programming Techniques in Logix

Contents
Before you begin......................................................................................................................................... 5 About this lab ................................................................................................................................................ 5 Tools & prerequisites .................................................................................................................................... 5 Lab 1: Using Multi-Tasks/Multi-Programs in Logix <10 minutes> ........................................................ 6 About This Lab .............................................................................................................................................. 6 The Traditional PLC method. ........................................................................................................................ 7 Using multiple Tasks/Programs in Logix....................................................................................................... 9 Task Properties ........................................................................................................................................... 12 Program Properties ..................................................................................................................................... 13 Lab 1 Summary ......................................................................................................................................... 16 Lab 2: Laying Out the Tag Database in a Logix Controller <10 minutes> .......................................... 17 About This Lab ............................................................................................................................................ 17 Looking at a Traditional Database Layout .................................................................................................. 17 Looking at UDT layout................................................................................................................................. 19 Using the Conveyor UDT ............................................................................................................................ 22 Lab 2 Summary ......................................................................................................................................... 26 Lab 3: Code Re-use <10 minutes> .......................................................................................................... 27 About This Lab ............................................................................................................................................ 27 Data Scoping............................................................................................................................................... 27 Using Copy and Paste ................................................................................................................................ 28 Using the Partial Import/Export Tool ........................................................................................................... 31 Lab 3 Summary ......................................................................................................................................... 34

3 of 112

Lab 4 Design Tools Add-On Instructions <45 minutes> .................................................................... 35 About This Lab ............................................................................................................................................ 35 AOI basics ................................................................................................................................................... 36 Creating an Add-On Instruction (AOI)......................................................................................................... 39 Using the AOI in RLL (Ladder Logic) .......................................................................................................... 44 Using the AOI in a Function Block (FB) Routine......................................................................................... 51 Re-using an AOI.......................................................................................................................................... 54 Export / Import Security............................................................................................................................... 56 Lab 4 Summary ......................................................................................................................................... 64 Lab 5 Online Tools <10 minutes>............................................................................................................ 65 About This Lab ............................................................................................................................................ 65 Looking at the Data Context........................................................................................................................ 66 Looking at the definition logic...................................................................................................................... 67 Online Monitoring an AOI............................................................................................................................ 69 Lab 5 Summary ......................................................................................................................................... 71 Lab 6 Observe FactoryTalk Alarms & Events <25 minutes> ................................................................ 72 About This Lab ............................................................................................................................................ 72 Observe FactoryTalk Alarms & Events within RSLogix5000 ...................................................................... 74 Observe FactoryTalk Alarms & Events within SE Client application .......................................................... 75 Lab 6 Summary ......................................................................................................................................... 80 Lab 7 Developing FactoryTalk Alarms & Events in FactoryTalk View Site Edition <40 minutes> ... 81 About This Lab ............................................................................................................................................ 81 RSLogix5000 Application Development...................................................................................................... 81 FactoryTalk View SE Application Development.......................................................................................... 89 Create FactoryTalk View Graphics interface .............................................................................................. 94 Configure Historical Alarm and Event Logging ........................................................................................... 98 Lab 7 Summary ....................................................................................................................................... 101 Appendix A Useful AOI Information...................................................................................................... 102 Appendix B Useful FactoryTalk Alarms and Events Information ...................................................... 108

4 of 112

Before you begin

About this lab


Welcome to this Hands-On Lab series! This session provides you with an opportunity to explore 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. Experienced PLC programmers will 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 MultiTasking/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 150 minutes to complete; although, each lab is independent so you can pick and choose what you are interested in during the time available. NOTE: Labs 1 4 and 7 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: Conveyor_Program_S1.ACD Conveyor_Program_S11.ACD Look_up_a_bar_code.ACD Alarm Banner.gfx Log Viewer.gfx Menu Bar.gfx Overview.gfx Valve1 Detail.gfx ClientKeys.key Startup.mcr Hardware devices required: 1796-CL11 demo box.

5 of 112

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. This will show the ease in program layout over traditional PLCs. 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. 2. Double-click on the existing project called Conveyor_Program_S1.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 Conveyor_Program.

6 of 112

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 File 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. Trends - trends are shown in this folder. Data Types - shows predefined and user-defined data types. User-defined data types are created 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. (Note: FlexLogix, DriveLogix and CompactLogix controllers support 8 tasks.) Continuous Task - 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. Periodic Task - 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. Event Task - 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, the return control to whatever task it interrupted. Typical Use: If you want to execute code as soon as an event or trigger occurs.

7 of 112

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. Task Icons A Continuous Task folder Icon looks as follows: An Event Task folder Icon looks as follows: A Periodic Task folder Icon looks as follows: 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.

8 of 112

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 for a Logix controller.

Using multiple Tasks/Programs in Logix


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

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

9 of 112

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

9. Notice that Conveyor 2 and 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.

10 of 112

12. Expand the PID_Loop Program. 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 the task. It contains 3 programs, Conveyor_1,

11 of 112

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.

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 IOT (Immediate Output instruction), output processing done immediately.

12 of 112

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

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.

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

13 of 112

19. Click on the Configuration tab.

14 of 112

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.

15 of 112

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

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.

16 of 112

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

17 of 112

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 that addresses are used from N7 [0] through N7 [7]. 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.

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.

18 of 112

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. You can still waste memory but we will show you how to avoid this as well. 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 or structures, 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. What a UDT allows you to do is group the different data types together (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.

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

19 of 112

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 4 less bytes than the one on the left.

20 of 112

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.

21 of 112

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 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 Conveyor_Program_S4.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 that there is a UDT called Conveyor (Creation of the UDT was started for you).

22 of 112

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.

23 of 112

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.

24 of 112

18. Remember what the Start_Stop Routine used to look like using the traditional PLC addressing?

19. Double-click on the routine C1_Start_Stop. This will open the routine for viewing and editing.

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.

25 of 112

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 save time creating code and then troubleshooting it later on.

26 of 112

Lab 3: Code Re-use <10 minutes>

About This Lab


In this lab you will take what you have learned so far and build on it. We want to show the next set of advanced features that makes development much easier. 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 Before we actually do this there is a concept you need to know about. 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 for a specific program (local data).

A Logix controller lets you divide your application into multiple programs. There is no need to manage 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. You can re-use the tag name of a Program scoped tag in multiple programs.

27 of 112

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

28 of 112

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

29 of 112

This added in a copy of the original conveyor segment code and incremented the program name.

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. Repeat the copy steps above to add in the remaining eight conveyor segments. 7. When you are finished, verify that the Controller Organizer appears as follows:

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

30 of 112

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 is a new feature available with version 13 and higher of RSLogix5000. The basic function that the Partial Import/Export tool provides is 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. Beginning in Version 17 you will be able to use 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 9. Open Look_up_a_bar_code.ACD using the File > Open menu browsing to C:\Lab Files\Understanding Advanced Programming Techniques in Logix folder. 10. 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.

11. Double-click on the MainRoutine to open the ladder editor. 12. From the toolbar menu select Edit > Select All. This will select all the rungs in the routine.

31 of 112

13. Right click to the left of rung zero and select Export Rung. 14. When the Export Rung window appears, enter the File name as shown below, then click Export.

15. Close the file within RSLogix5000 using File > Close. Respond with No if prompted to save the file. Using the Partial Import/Export Tool to Import a L5X File 16. Open Conveyor_Program_S6.ACD using the File > Open menu browsing to C:\Lab Files\Understanding Advanced Programming Techniques in Logix folder. 17. 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:

32 of 112

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

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

20. When the Import Rung window appears, click on the file Look_up_bar_code.L5X and then click on Import.

33 of 112

21. The Import Configuration window will appear.

22. Click on OK to start the Import. In addition to the ladder code all tags are created in the correct scope. 23. 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 but we need to be careful if any tag names will conflict 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 routines as well. 24. 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 RSLogix 5000 can allow you to do this very easily.

34 of 112

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

About This Lab


Lets take what we learned one step further. Version 16 of RSLogix 5000 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 also helps promote consistency in your projects since 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 RSLogix 5000. Once created, an AddOn Instruction may then be used in any of the RSLogix 5000 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 also make it easier for users of the instructions to get the help they need for a successful implementation. Finally, you can use the Add-On Instructions source protection capability to limit a user of your instruction to read-only access or to allow no access to the internal logic or local parameters used by the instruction. This allows you to stop 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 create one Add-On instruction with it. We will then use those instructions 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

35 of 112

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.

36 of 112

3. Local Tags Local Tags are hidden members and are not visible outside the instruction and cannot be referenced by other programs or routines. They are private to the instruction.

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.

37 of 112

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.

38 of 112

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

39 of 112

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:

40 of 112

5. Click OK to accept. 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.

41 of 112

The Parameters tab is a tag database editor window for parameters specific to this Add-On Instruction with the inclusion of definition specific fields: Usage, Default, Req, Vis and Description. 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) in which an instruction instance is used. Description field is important because any information used here will be passed thru 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.

9. Click On Apply to accept the changes

42 of 112

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

11. Click Apply 12. 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. 13. From the Controller organizer, double click on C_Start_Stop to open it. 14. From the toolbar menu select Edit > Select All. This will select all the rungs in the routine. 15. Right click on Rung 0 and select Copy Rung 16. Expand the AOI folder if it is not already expanded in the Controller organizer.

17. Double click on Logic to open it.

43 of 112

18. Right click on the End rung and select Paste

19. Delete the empty rung. 20. All of the logic should now appear without any errors. If you have any errors you probably didnt type the tags correctly in the definition. Go back and make sure the tag names are exactly the same as was shown. 21. 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 RSLogix 5000. Once created, an Add-On instruction may then be used in any of the RSLogix 5000 editors without any additional effort on your part. In this section of the lab, you will open an existing program and create the AOI. 22. Open Conveyor_Program_S8.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. 23. Expand the AOI until you can see the Logic and Parameters.

44 of 112

24. 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. 25. Click the Parameters tab. 26. 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. Click on the Logic button to open the logic.

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

45 of 112

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

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

31. Click the Add-On tab and then the Conveyor button.

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

46 of 112

AOI tag structure: At this point the instruction behaves like any other Logix 5000 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. 33. Right click on the first question mark and select New Tag.

34. Complete the New Tag dialog as shown

47 of 112

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.

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

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

48 of 112

40. The rung should now be:

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 41. Click on any address and type something new in. After you accept it you should see Question marks for the value. You see these because your tag does not exist yet.

49 of 112

42. Right click on the new tag name and select New whatever you named it

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

44. Click OK to accept it. The instruction should now have your Alias filled in. Using an Add-On Instruction Output in Ladder 45. 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.

50 of 112

Using the AOI in a Function Block (FB) Routine


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

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

51 of 112

48. Double click on the new Routine to open it.

49. Click on the Add-On tab and then 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_02 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.

52 of 112

50. Place an Input Reference (IREF) on the sheet and wire it to the Motor_Overload_Input connector.

51. Double click on the IREF and pick any unused input point.

52. Do the same for the remaining required input points. You could use an Alias here just like we did for the RLL instruction.

53. The instruction will now verify. Notice the

is gone from the upper left corner.

53 of 112

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 54. Continue working with Conveyor_Program_S8.ACD file. 55. From the Controller organizer in our Conveyor application, right click on the AOI and select COPY.

56. Open a second instance of RSLogix5000 by clicking on the shortcut on the desktop.

57. Begin a new file by selecting File > New from the menus. Fill in the dialog as shown.

54 of 112

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.

55 of 112

Export / Import Security


Copying and Pasting requires you to have two instances of RSLogix 5000 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 Conveyor_Program_S8.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.

56 of 112

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

57 of 112

67. Select the Conveyor_Core AOI, click the Protect button and configure the Source Key as shown; leave the Allow viewing of components 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 Conveyor_Program_S8.ACD file, right click on the Conveyor_1 routine and select Export Routine

58 of 112

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.

59 of 112

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

60 of 112

76. From the Controller organizer, right click on Add-On instruction and pick Import Add-On Instruction.

77. Click on the name we just exported the AOI to and then select Import.

61 of 112

78. After selecting Import another dialog box appears with options to use; select Operation: Create operation and click the OK button.

79. In a similar manner, right click on Main Program; select Import Routine highlight the Conveyor_1 routine we just exported and click the Import button.

62 of 112

80. Select Operation: Create and click OK button 81. Now both the Conveyor_1 routine and Conveyor_Core AOI are available for our use. 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 that the source file is not available.

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

63 of 112

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

84. 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. 85. Close the instance of RSLogix5000 with the controller named new. Close the Conveyor_Program_S8.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 to prevent a user from changing the code inside or even viewing it by applying Source Protection. Over these 4 labs we moved from all of our logic all bunched in one big program to a single instruction that is very compact and very easy to use.

64 of 112

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 often necessary to view the definition during actual operation for debugging and commissioning. To accommodate these activities, provision has been made to view the definition and tag structure from a particular context. While these tools are available for off-line use, their greatest utility is in the on-line capacity. For this lab we added several rungs of logic and some tags to the definition. Since we have multiple demo cases for this lab room we changed the input points from 1756 I/O to just tags so we can simulate our I/O.

In this section of the lab, you will open an existing program and download it into the controller. 1. Open Conveyor_Program_S9.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 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

65 of 112

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. 12. Click on the Data Context selector to view the list of available contexts for the Conveyor_1 instruction.

66 of 112

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.

67 of 112

15. Right click on the instruction name and then 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.

68 of 112

You will notice that portions of the view are grayed out. As an individual instance of the definition some portions are not allowed to change. The white areas are editable since each instance may require a different value. 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 to accept it. 19. Make the Start_Push_Button input true by entering a 1 in the value field.

69 of 112

20. Notice the conveyor is now running. The Start_Command 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. 22. Notice that it matches the instruction and we can see what is happening if something was not working. 23. Go back to the Ladder routine and make Entrance_PE, Exit_PE, and Start_Push_Button 0. 24. The Start_Command output should go off after 20 seconds. Why? 25. 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.

70 of 112

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.

71 of 112

Lab 6 Observe FactoryTalk Alarms & Events <25 minutes>

About This Lab


The purpose of this lab is to show FactoryTalk Alarms & Events functioning with provided RSLogix5000 and FactoryTalk SE application files. The provided files closely match those developed with step by step in the next lab. Appnedix B of this document provides background information on FactoryTalk Alarms & Events and provides a nice overview of its operation. 1. Open Conveyor_Program_S10.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 addressing with slot 0). If the controller is not in Slot 1 then you can re-configure the demo case to match the project. 3. Click Communications from the toolbar of RSLogix5000 and select Who Active

4. Browse to the 1756-L63 processor in slot one and select Download. Request assistance if you have any difficulties.

72 of 112

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

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

7. Select the Date / Time tab and verify that the Date and Time is configured correctly.

8. Click the OK button once the controller Date and Time have been verified. Time stamping for Device Alarms is defined by the processor.

73 of 112

Observe FactoryTalk Alarms & Events within RSLogix5000


9. Expand the Conveyor program within the Main Task and double-click on the Alarms routine.

10. Select the

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

74 of 112

11. 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. 12. Minimize RSLogix5000 and leave the software online with the processor.

Observe FactoryTalk Alarms & Events within SE Client application


13. Double-click on the desktop shortcut to Lab Files and double-click on the FTAE_Lab6.cli file which will launch a FactoryTalk View Studio client file that has been configured to monitor the ALMD and ALMA instructions configured within the ControlLogix processor. NOTE: it may take several minutes for the client application file to start.

Menu Bar

Overview

Alarm Banner

75 of 112

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

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

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

18. 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 RSLogix 5000 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.

76 of 112

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

20. Click the Close button on the Valve1 Detail popup dialog box when completed. 21. 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.

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

23. Experiment with the SE Client application using the Menu Bar display to trigger different alarm types. Use the and buttons to experience the deadband of 2 that is configured for the ALMA 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.

77 of 112

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

25. 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]Valve1FTO associated with an ALMD instruction configured in the ControlLogix application [CLX]Line1Pressure_ALM associated with an ALMA instruction configured in the ControlLogix application [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.

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

78 of 112

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. 26. Select the Close button to exit Alarm Status Explorer. 27. 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.

79 of 112

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 6 Summary
In this lab you worked online with provided files using FactoryTalk Alarms and Events Device based alarms which are configured in RSLogix5000 and monitored within a FactoryTalk View SE local client application.

80 of 112

Lab 7 Developing FactoryTalk Alarms & Events in FactoryTalk View Site Edition <40 minutes>

About This Lab


This lab steps through the configuration steps associated with developing the RSLogix5000 and FactoryTalk View SE application explored in Lab 6. Device-based alarm instructions ALMD and ALMA, available in RSLogix5000 v16 or later, are created and configured in a logic project. FactoryTalk View SE application is created to monitor, display and log alarm information gathered from the Logix5000 controller for those ALMD and ALMA instructions. 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:

RSLogix5000 Application Development


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.

81 of 112

1. Open Conveyor_Program_S11.ACD using the File > Open menu browsing to C:\Lab Files\Understanding Advanced Programming Techniques in Logix folder. 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.

82 of 112

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

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

Verify that the tag is controller scoped.

83 of 112

7. Configure the ProgAck, ProgReset, ProgDisable, ProgEnable tags with the tags associated with the Valve1FTO 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.

button to create controller scoped Associated Tags Configure as shown below. Use the Valve1Position type DINT and Valve1Flow type REAL

84 of 112

Minimum duration = 3000 ms

Message: Valve1 failed to open

Use for creating Associated Tags

Alarm Class: FTO (Failed To Open)

FactoryTalk View Command: Display Valve1 Detail

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

85 of 112

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.

10. Click OK to close the ALMD properties dialog box. ALMA Instruction 11. Continue working offline in RSLogix 5000 with the Conveyor_Program_S10.acd file 12. In this section of the lab we will add an ALMA (Alarm Analog) instruction to the Alarms routine. 13. Create a new rung and add an ALMA instruction with no conditions because we want to monitor the input value every time the Alarms routine runs.

86 of 112

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

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

87 of 112

16. Enter zero for the other inputs to the ALMA instruction. [ProgAckAll, ProgDisable and ProgEnable] The ALMA instruction will operate the same with zeros defining these tags as if the Line1Pressure.ProgXXXX tags were specified. button within the ALMA instruction to open the ALMA Properties dialog box. Configure 17. Click the the ALMA instruction as shown.

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

88 of 112

The following diagram shows how deadband settings affect an alarm's transition between In Alarm and Normal states.

19. The Alarms routine should now contain 2 rungs one including an ALMD and the other an ALMA instruction as shown below:

20. This concludes the FactoryTalk Alarm and Event configuration within RSLogix5000 application.

FactoryTalk View SE Application Development


In this section of the lab we will configure a new application in FactoryTalk View SE to receive the ALMD

89 of 112

and ALMA alarms configured in the ControlLogix application.

21. From the desktop select the shortcut for FactoryTalk View Studio 22. When prompted select Site Edition (Local) as the application type to configure and click the Continue button.

23. The dialog box in the image below is displayed. Select the New tab and enter FTAE_Lab7 as the application name. Specify English as the Language and click the Create button, 24. NOTE: it will take a minute or so for the new application to be created and opened.

90 of 112

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

26. In the Explorer window, right-click FTAE_Lab7 displayed under the topmost entry Local(CORE) and select Add New Server. Select Rockwell Automation Device Server (RSLinx Enterprise).

91 of 112

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

28. Select the Alarms and Events tab and configure as shown below; click OK button when configuration is completed. Check this box

Uncheck this box

29. The new Device server RSLinx Enterprise is added to the FTAE_Lab7 application

92 of 112

30. Create a shortcut to our ControlLogix controller by double-clicking on RSLinx Enterprise to expand it and then double click on Communication Setup. 31. 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.

Browse to the IP address of the 1756ENBT in your demo box and select the processor in slot 1

Select Yes to Enable Alarms & Events

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, uploads the state of all alarms and publishes this information to the FactoryTalk Alarm and Event system. The alarm server will start automatically when the operating system initializes.

93 of 112

32. Click OK button to complete the Communication Setup. 33. Click Yes to apply changes to the CLX shortcut you have just configured.

Create FactoryTalk View Graphics interface


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

36. Resize the resulting blank display to occupy the full width of the display and about 2/3 of the workspace height. 37. 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.

94 of 112

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

39. On the Edit menu, click Display Settings. 40. 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.

95 of 112

41. Click OK button to save Display Settings changes. on the toolbar. In the Save dialog box, type Alarm 42. Save the display by clicking the Save button Summary for the name of the display and then click OK.

43. Close the newly created Alarm Summary Display by clicking the X close button in the upper right.

96 of 112

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

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

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

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.

97 of 112

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. 47. In the Explorer window, expand the folders System > Connections > Databases folder. The database FTAE_History already exists on this computer associated with the lab 6 FactoryTalk View SE application. We will create your own database named FTAE_History_Lab7. Right-click on Databases and select New Database.

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

98 of 112

49. 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. 50. In the Advanced tab, change the Log events to database every 100 events to 1 event.

Change from 100 to 1.

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.

99 of 112

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. 51. Click OK to save the Database Definition. 52. Right-click the device alarm server named RSLinx Enterprise and select Properties to associate it with the newly created Database Definition.

53. In the RSLinx Enterprise Server Properties dialog box, click the Alarms and Events tab. 54. Under Alarm and Event History, select the Enable history check box. 55. In the Database definition list, select FTAE_History_Lab7. Click OK to save the changes.

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

100 of 112

Lab 7 Summary
In this lab you worked offline to create RSLogix5000 controller and FactoryTalk View SE applications to incorporate Device Based alarms with historical logging. 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, cleanup your work area before exiting. Thank you for your time and enjoy the rest of the show.

101 of 112

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 Accessibility

Main Routine N/A

Subroutine Within program (Multiple copies, one for each program) Pass by value

Add-On Instruction Anywhere in controller (single copy for the entire project. Pass by value via Input and Output Parameter or by reference via InOut Parameters Automatic data type conversion for Input and Output parameters Atomic for any Parameter Array and structures must be an InOut Parameter Verification checks that correct type of argument has been provided for a Parameter. Local data is isolated (only accessible within instruction) Single calling instance data, which simplifies debugging. FBD, LD, ST

Parameters

N/A

Numeric Parameters Parameters data types Parameter checking Data encapsulation Monitor/debug

N/A N/A

No conversion, user must manage Atomic, arrays, structures. None, user must manage

N/A

N/A In-line code with its data FBD, LD, SFC, ST

Add data at program or controller scope Mixed data from multiple calls, which complicates debugging FBD, LD, SFC, ST

Supported programming languages Callable from Protection Documentation

N/A Locked and View only Routine, rung, textbox, line

FBD, LD, SFC, ST Locked and view only Routine, rung, textbox, line

FBD, LD, SFC via ST, ST Locked and view only Instruction, revision info, vendor, rung, textbox, line, extended help.

102 of 112

Aspect Execution performance

Main Routine Fastest

Subroutine JSR/SBN/RTN instructions add overhead. Indexed reference impact Compact Online/Offline Only LD rungs with referenced tags/UDTs

Add-On Instruction Call is more efficient. InOut parameters are passed by reference, which is faster than copying data for many types. More than subroutine Offline only Full instruction definition

Memory use Edit Import/Export

Most Online/Offline Only LD rungs with referenced tags/UDTs

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.

103 of 112

Unavailable Instruction Description Most built in instructions can be used within Add-On Instructions. The following instructions can not be used: Instruction BRK EOT EVENT FOR IOT JSR JXR MAOC PATT PCLF PCMD PDET POVR RET Safety Instructions SBR SFP SFR Description Break End of Transition Event Task Trigger For (For/Next Loop) Immediate Output Jump to Subroutine Jump to External Routine Motion Arm Output Cam Attach to Equipment Phase Equipment Phase Clear Failure Equipment Phase Command Detach from Equipment Phase Equipment Phase Override Command Return Any of the Safety Instructions Subroutine SFC Pause 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 ALMA ALMD Motion Instructions MSG Description Analog alarm Digital Alarm All Motion Instructions Message

104 of 112

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.

105 of 112

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.

106 of 112

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.

107 of 112

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.

108 of 112

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

109 of 112

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.

110 of 112

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

111 of 112

Notes:

112 of 112

You might also like