Programming Manual Logix5000 Controllers Program Parameters Catalog Numbers 1756 ControlLogix, 1756 GuardLogix, 1769 CompactLogix, 1789 SoftLogix
Important user information Read this document and the documents listed in the additional resources section about installation, configuration, and operation of this equipment before you install, configure, operate, or maintain this product. Users are required to familiarize themselves with installation and wiring instructions in addition to requirements of all applicable codes, laws, and standards.
Table of contents Preface Studio 5000 environment ..................................................................................... 5 Additional resources............................................................................................... 6 Important terminology .......................................................................................... 6 Chapter 1 Connecting program parameters Introduction .....................................................................................
Table of contents Chapter 2 Directly accessing program parameters Introduction .......................................................................................................... 31 Direct access........................................................................................................... 31 Behavior of direct access in logic ................................................................. 31 Access program parameters when editing ladder logic............................
Preface This manual shows how to create and configure program parameters. This manual is one of a set of related manuals that show common procedures for programming and operating Logix5000 controllers. For a complete list of common procedures manuals, refer to the Logix5000 Controllers Common Procedures Programming Manual, publication 1756-PM001. The term Logix5000 controller refers to any controller that is based on the Logix5000 operating system.
Preface Additional resources These documents contain additional information concerning related Rockwell Automation products. Resource Description Industrial Automation Wiring and Grounding Guidelines, publication 1770-4.1 Provides general guidelines for installing a Rockwell Automation industrial system. Product Certifications webpage, available at http://ab.rockwellautomation.com Provides declarations of conformity, certificates, and other certification details.
Chapter 1 Connecting program parameters Introduction This chapter provides an overview of program parameters and then further defines each type of program parameter. Explanations are provided on when to use each type of program parameter and the general rules to follow, and example procedures are provided for connecting each type of program parameter. Program parameters A program parameter is an argument that is exposed for external access by a program.
Chapter 1 Connecting program parameters Program parameter connection methods You can use any of the following methods to connect program parameters in the Logix Designer application. • Connections column on the Program Parameters and Local Tags dialog box Tip: 8 To show the Connections column click View > Toggle Columns > Connections.
Connecting program parameters • Chapter 1 Ellipses button (...
Chapter 1 10 Connecting program parameters • Properties pane on the Program Parameters and Local Tags dialog box • Parameters tab on the Program Properties dialog box Rockwell Automation Publication 1756-PM021A-EN-P - October 2014
Connecting program parameters • Chapter 1 New Parameter or Tag dialog box Program parameter connection syntax The syntax {x:y} is used to connect program parameters where: x = the number of full connections, meaning connections at the word or user-defined type level y = the number of partial connections, meaning connections at the bit or member level Rockwell Automation Publication 1756-PM021A-EN-P - October 2014 11
Chapter 1 Connecting program parameters User-defined type sub-element connection considerations User-defined types (UDTs) used as parameters can contain member-specific connections. To ensure proper data flow, the base Usage can only be specified at the base of the UDT, and not at the member level, as the following example shows. Input parameters An Input parameter is a parameter that defines the data that is passed by value into an executing program.
Connecting program parameters Chapter 1 For more information on the Input parameter connections that can be made, see Program parameter connection rules on page 28. Connect an Input parameter to a controller scope tag A parameter can be connected to another parameter or controller scope tag. As an example, connecting an Input parameter to an Output parameter ensures that data is copied to the Input parameter from the Output parameter on every scan.
Chapter 1 Connecting program parameters 3. On the right, in the Properties pane, expand Parameter Connections. 4. Click New Connection. 5. Click the Browse (...) button. 6. In the Tag box, choose the drop-down arrow.
Connecting program parameters Chapter 1 7. In the Tag Browser, locate and expand the desired controller scope tag. 8. Click to the right of the desired tag, and click the drop-down arrow. 9. Click the bit that you want to associate with this Input parameter. 10. In the Tag box, verify that the resulting information is correct, and click OK.
Chapter 1 Connecting program parameters Output parameters An Output parameter is a parameter that defines the data that is produced as a direct result of executing a program. Since Output parameters are always passed by value, their values only change at the end of the scan of a program when the copy of the parameters has executed. Tip: If using direct access another program can be a source for an Output parameter.
Connecting program parameters Chapter 1 Connect an Output parameter to a controller scope tag The following procedure explains how to connect an Output parameter to a controller scope tag. Tip: This procedure demonstrates the use of the Parameters tab on the Program Properties dialog box. You can alternatively connect parameters using any of the other methods shown in Program parameter connection methods on page 8. 1.
Chapter 1 Connecting program parameters 5. In the New Connection box, type the tag to which you want to connect this Output parameter, and click Apply. 6. Click OK to close the Program Properties dialog box. Connect an Output parameter to another program The following procedure explains how to connect an Output parameter to another program. Tip: This procedure demonstrates the use of the Properties pane on the Program Parameters and Local Tags dialog box.
Connecting program parameters Chapter 1 3. On the right, in the Properties pane, expand Parameter Connections. 4. Click New Connection. 5. Click the Browse (...) button. 6. In the Tag box, choose the drop-down arrow.
Chapter 1 Connecting program parameters 7. (optional) On the Tag Browser, clear one or more of the check boxes to limit the number of available parameters that appear in the list. 8. In the Show parameters from other program list, choose the program to which you want to connect this Output parameter. 9. In the list of available parameters, double-click the desired parameter. 10. Click OK.
Connecting program parameters Chapter 1 Another useful scenario for InOut parameters is for instructions whose tags can only be placed at the controller scope, such as the Message (MSG) instruction. InOut parameters can connect directly to the MSG instruction tags in the controller scope. Finally, InOut parameters are useful for programs that have a large data structure, and you do not want to pass the whole structure by value.
Chapter 1 Connecting program parameters Connect an InOut parameter to a controller scope tag The following procedure explains how to connect an InOut parameter to a controller scope tag. Tip: This procedure demonstrates the use of the Properties pane on the Program Parameters and Local Tags dialog box. You can alternatively connect parameters using any of the other methods shown in Program parameter connection methods on page 8. 1.
Connecting program parameters Chapter 1 5. In the Tag box, choose the drop-down arrow. 6. (optional) On the Tag Browser, clear all but the Show controller tags check box to limit the number of available parameters that appear in the list. 7. In the list of available parameters, double-click the desired parameter. 8. Click OK.
Chapter 1 Connecting program parameters Public parameters are updated as the source updates, so higher priority tasks that interrupt a program during execution have access to any updated values in the lower priority task. Additionally, fan-in is supported with Public parameters, which is useful in situations where a code module or object could receive a command from many modules or objects. Input parameters can be used, but an individual Input parameter is required for each connection.
Connecting program parameters Chapter 1 Connect a Public parameter to another program The following procedure explains how to change an existing tag to a Public parameter, and then connect a Public parameter to another program. Tip: This procedure demonstrates the use of the Properties pane on the Program Parameters and Local Tags dialog box. You can alternatively connect parameters using any of the other methods shown in Program parameter connection methods on page 8. 1.
Chapter 1 Connecting program parameters 5. Click the Browse (...) button. 6. In the Tag box, choose the drop-down arrow. 7. On the Tag Browser, in the Show parameters from other program list, choose the program to which you want to connect this Public parameter. 8. In the list of available parameters, double-click the desired parameter. 9. Click OK.
Connecting program parameters Safety program parameters Chapter 1 Special considerations apply when using program parameters within safety programs. General rules for connecting parameters for safety programs The following are general rules when connecting parameters for safety programs. • A safety parameter cannot connect to a standard parameter or controller scoped tag of standard class; the controller scope must be of class safety.
Chapter 1 Connecting program parameters Program parameter connection rules The following information summarizes the program parameter connection rules. Standard program to standard program connection rules The following table summarizes the rules for using program parameters to connect two standard programs. Tip: The connection rules for programs also apply to Equipment Phases.
Connecting program parameters Chapter 1 Safety program to safety program connection rules The following table summarizes the rules for using program parameters to connect two safety programs. Tip: The connection rules for programs also apply to Equipment Phases.
Chapter 1 Connecting program parameters Safety program to standard program connection rules The following table summarizes the rules for using program parameters to connect a safety program to a standard program. Tip: The connection rules for programs also apply to Equipment Phases.
Chapter 2 Directly accessing program parameters Introduction This chapter provides an overview of direct access and an example procedure for directly accessing program parameters when working within code editors. Direct access Direct access lets you reference the program parameters from another program in logic without configuring parameters in the local program. The syntax used for direct access is \ProgramName.ParameterName. For example, assume Program_A has an output parameter called Tank_Level.
Chapter 2 Directly accessing program parameters Access program parameters when editing ladder logic The following procedure explains how to access program parameters when editing ladder logic. Tip: While this example is specific to ladder logic, the notation is the same for all programming languages. 1. In the Controller Organizer, expand the folder for the program that contains the ladder logic routine that contains instructions for which you are configuring direct access, and double-click the routine.
Directly accessing program parameters Chapter 2 4. (optional) On the Tag Browser, clear or select the check boxes to focus the list of available parameters that appear to what you need. 5. In the Show parameters from other program list, choose the program to which you want to connect this instruction. 6. In the list of available parameters, double-click the desired parameter.
Index A argument 6 C connect InOut parameter 22 Input parameter 13 Output parameter 17, 18 Public parameter 25 connection methods 8 D direct access behavior 31 overview 31 use 32 I InOut parameter connect to a controller scope tag 22 connection types and uses 20 general connection rules 21 overview 20 Input parameter connect to a controller scope tag 13 connection types and uses 12 general connection rules 12 overview 12 P passed by reference 6 passed by value 6 program parameter connect 7 connection me
Rockwell Automation support Rockwell Automation provides technical information on the web to assist you in using its products. At http://www.rockwellautomation.com/support you can find technical and application notes, sample code, and links to software service packs. You can also visit our Support Center at https://rockwellautomation.custhelp.com for software updates, support chats and forums, technical information, FAQs, and to sign up for product notification updates.