Logix 5000™ Controllers Program Parameters: Programming Manual
Logix 5000™ Controllers Program Parameters: Programming Manual
Program Parameters
1756 ControlLogix®, 1756 GuardLogix®, 1769
CompactLogix™, 1769 Compact GuardLogix®, 1789
SoftLogix™, 5069 CompactLogix™, 5069 Compact
GuardLogix®, Studio 5000® Logix Emulate™
ATTENTION: Identifies information about practices or circumstances that can lead to personal injury or death, property damage, or economic loss.
Attentions help you identify a hazard, avoid a hazard, and recognize the consequence.
IMPORTANT Identifies information that is critical for successful application and understanding of the product.
BURN HAZARD: Labels may be on or inside the equipment, for example, a drive or motor, to alert people that surfaces may reach dangerous
temperatures.
ARC FLASH HAZARD: Labels may be on or inside the equipment, for example, a motor control center, to alert people to potential Arc Flash. Arc Flash will
cause severe injury or death. Wear proper Personal Protective Equipment (PPE). Follow ALL Regulatory requirements for safe work practices and for
Personal Protective Equipment (PPE).
Rockwell Automation recognizes that some of the terms that are currently used in our industry and in this publication are not in alignment with the movement
toward inclusive language in technology. We are proactively collaborating with industry peers to find alternatives to such terms and making changes to our
products and content. Please excuse the use of such terms in our content while we implement these changes.
Global changes
This table identifies changes that apply to all information about a subject in
the manual and the reason for the change. For example, the addition of new
supported hardware, a software design change, or additional reference
material would result in changes to all of the topics that deal with that subject.
Change Topic
New Studio 5000 Logix Designer® application branding Studio 5000® environment on page 7
Chapter 1
Connecting program Introduction ................................................................................................ 11
parameters Program parameters ................................................................................... 11
Program parameter connection methods .......................................... 12
Program parameter connection syntax.............................................. 14
User-defined type sub-element connection considerations............. 15
Input parameters........................................................................................ 15
Input parameter connection types and uses ..................................... 15
General rules for using Input parameters ......................................... 15
Connect an Input parameter to a controller scope tag ..................... 15
Output parameters ..................................................................................... 18
Output parameter connection types and uses ................................... 18
General rules for using Output parameters ....................................... 19
Connect an Output parameter to a controller scope tag................... 19
Connect an Output parameter to another program......................... 20
InOut parameters .......................................................................................23
InOut parameter connection types and uses .....................................23
General rules for using InOut parameters ........................................ 24
Connect an InOut parameter to a controller scope tag.................... 24
Public parameters...................................................................................... 25
Public parameter connection types and uses.................................... 25
General rules for using Public parameters........................................ 26
Connect a Public parameter to another program............................. 26
Safety program parameters ...................................................................... 28
General rules for connecting parameters for safety programs ....... 28
Program parameter connection rules...................................................... 29
Standard program to standard program connection rules ............. 29
Safety program to safety program connection rules........................ 30
Safety program to standard program connection rules .................. 30
Chapter 2
Directly accessing Introduction ............................................................................................... 33
program parameters Direct access ............................................................................................... 33
Behavior of direct access in logic ........................................................ 33
Access program parameters when editing ladder logic .................... 33
Index
Studio 5000® environment The Studio 5000 Automation Engineering & Design Environment® combines
engineering and design elements into a common environment. The first
element is the Studio 5000 Logix Designer® application. The Logix Designer
application is the rebranding of RSLogix 5000® software and will continue to
be the product to program Logix 5000™ controllers for discrete, process,
batch, motion, safety, and drive-based solutions.
Legal Notices Rockwell Automation publishes legal notices, such as privacy policies, license
agreements, trademark disclosures, and other terms and conditions on the
Legal Notices page of the Rockwell Automation website.
Important terminology This table defines the terms that are important to understanding the concepts
described in this manual.
Term Definition
Argument An argument is assigned to a parameter and contains the
specification of the data used by an instruction in a user
program. An argument can contain the following:
• A simple tag (for example, L101)
• A literal value (for example, 5)
• A tag structure reference (for example,
Recipe.Temperature)
• A direct array reference (for example, Buffer[1])
• An indirect array reference (for example,
Buffer[Index+1])
• A combination (for example, Buffer[Index+1].Delay)
InOut parameter An InOut parameter is a special usage program parameter
that represents a reference to data that can be used both
as input and output during the execution of a program.
Because InOut parameters pass by reference rather than
by value, they are merely a pointer to the original data
and closely resemble the behavior of an alias tag. With
that in mind, it is possible that the InOut parameter
values could change during the execution of a program.
Depending on your task structure, this behavior may be
necessary.
Input parameter An Input parameter is a parameter that defines the data
that is passed by value into an executing program. Since
Input parameters are passed by value, their values cannot
change from external sources during the execution of the
program. An Input parameter supports a maximum of one
sourcing connection.
Output parameter 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.
Passed by reference When an argument is passed to a parameter by
reference, the logic directly reads or writes the value that
the tag uses in controller memory. External code or HMI
interaction that changes the argument’s value can
change the value during execution of a program.
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. Unlike local tags, all program parameters are publicly accessible
outside of the program. Additionally, HMI external access can be specified for
each parameter. Data sharing between programs can be achieved either
through pre-defined connections between parameters or directly accessed
through a special notation.
There are four types of program parameters.
• Input
• Output
• InOut
• Public
Among other benefits, program parameters allow you to clearly define the
inputs to the routines in a program, and the outputs from those routines.
Input and Output (I/O) parameters also automatically buffer data, so that you
do not need to create separate tags to buffer I/O data (although if desired, you
can still buffer data using the Synchronous Copy File [CPS] instruction).
Program parameter You can use any of the following methods to connect program parameters in
the Logix Designer application.
connection methods
• Connections column on the Program Parameters and Local Tags
dialog box
Tip: To show the Connections column select View > Toggle Columns > Connections.
Program parameter The syntax {x:y} is used to connect program parameters where:
connection syntax x = the number of full connections, meaning connections at the word
or user-defined data type level
y = the number of partial connections, meaning connections at the bit
or member level
User-defined type User-defined types (UDTs) used as parameters can contain member-specific
connections. To ensure proper data flow, the base Usage can only be specified
sub-element connection at the base of the UDT, and not at the member level, as the following example
considerations shows.
Input parameters An Input parameter is a parameter that defines the data that is passed by
value into an executing program. Since Input parameters are passed by value,
their values cannot change from external sources during the execution of the
program. An Input parameter supports a maximum of one sourcing
connection.
Input parameter connection Input parameters can be connected to Output parameters, Public parameters,
InOut parameters, and controller scope tags. This makes Input parameters a
types and uses great option for connecting input card data to a code module or object. It also
is a good option for code module or object commands that are point-to-point.
General rules for using The following are general rules when using Input parameters.
Input parameters • Input parameters (including members) can only support one sourcing
connection. This means that only one source can be delivering the
value to the input parameter.
• Input parameter values are refreshed before each scan of a program.
The values do not change during the logic execution, so you do not
need to write code to buffer inputs.
• A program can write to its own Input parameters.
• Data values for Output parameters that are connected to controller
scope tags or Public parameters are copied after the scan of a program.
In a project with multiple tasks, the data copy for a parameter that is of
type BOOL, SINT, INT, DINT, LINT, or REAL will not be interrupted.
The data copy from an Output parameter to a controller scope tag or
Public parameter or any other predefined or user-defined data type
may be interrupted by a task switch.
For more information on the Input parameter connections that can be made,
see Program parameter connection rules on page 29.
Connect an Input parameter A parameter can be connected to another parameter or controller scope tag.
As an example, connecting an Input parameter to an Output parameter
to a controller scope tag ensures that data is copied to the Input parameter from the Output
parameter on every scan. The following procedure explains how to connect an
Input 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 12.
2. On the Program Parameters and Local Tags dialog box, choose the
Input parameter that you want to connect.
8. Select to the right of the desired tag, and select the pull-down arrow.
9. Select the bit that you want to associate with this Input parameter.
10. In the Tag box, verify that the resulting information is correct, and
select OK. Notice that the first number in the brackets next to
Parameter Connections has incremented by one, indicating that the
number of connections to the parent tag have increased by one.
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.
Output parameter Output parameters can be connected to one or more Input parameters, Public
parameters, InOut parameters (constants), and controller scope tags, which
connection types and uses make Output parameters a great option for connecting a code module or
General rules for using The following are general rules when using Output parameters.
Connect an Output The following procedure explains how to connect an Output parameter to a
controller scope tag.
parameter to a controller
Tip: This procedure demonstrates the use of the Parameters tab on the Program Properties dialog
scope tag box. You can alternatively connect parameters using any of the other methods shown in Program
parameter connection methods on page 12.
5. In the New Connection box, type the tag to which you want to connect
this Output parameter, and select Apply.
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 12.
2. On the Program Parameters and Local Tags dialog box, choose the
Output parameter that you want to connect.
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. Select OK.
InOut parameters An InOut parameter is a special usage program parameter that represents a
reference to data that can be used both as input and output during the
execution of a program. Because InOut parameters pass by reference rather
than by value, they are merely a pointer to the original data and closely
resemble the behavior of an alias tag. With that in mind, it is possible that the
InOut parameter values could change during the execution of a program.
Depending on your task structure, this behavior may be necessary.
InOut parameter connection InOut parameters can be connected to Input parameters, Public parameters,
Output parameters (if InOut is constant), and controller scope tags.
types and uses
An example of how InOut parameters are advantageous is an application that
contains multiple tasks with different priority assignments. In this scenario, a
lower priority task is interrupted by a higher priority task. If the higher
priority task is referencing data in the lower priority task, the InOut
parameter allows the higher priority task to point directly to a tag’s value in
the lower priority task. This ensures that the higher priority task is using the
most up-to-date value of a tag.
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.
General rules for using The following are general rules when using InOut parameters.
InOut parameters • InOut parameters can only support one connection. You cannot
configure connections to any member of an InOut parameter.
• An InOut parameter can only be connected to an Output parameter if
the InOut parameter is configured as a constant.
• InOut parameters are passed by reference, which means they point to
the base tag. In other words, when an InOut parameter is used in logic,
the current value of the parameter connected to the InOut parameter
is used.
• Connections to InOut parameters cannot be changed online, unless
using the Partial Import Online (PIO) functionality.
For more information on the InOut parameter connections that can be made,
see Program parameter connection rules on page 29.
Connect an InOut parameter The following procedure explains how to connect an InOut parameter to a
controller scope tag.
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 12.
2. On the Program Parameters and Local Tags dialog box, choose the
InOut parameter that you want to connect.
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. Select OK.
Public parameters A Public parameter is an encapsulated version of a controller scope tag, and
typically it is used for large data structures that need to be shared among
programs.
Public parameter Public parameters can be connected to Input parameters, Output parameters,
and InOut parameters. Public parameters function like controller scope tags,
connection types and uses but are at the program level. The key benefit to using Public parameters over
controller scope tags is better encapsulation. It is an excellent option for code
modules or objects that contain data that must be globally available to other
code modules.
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
General rules for using The following are general rules when using Public parameters.
Public parameters • Public parameters can support multiple connections. You can
configure connections to the base Public parameter or any member of
a Public parameter, including User-defined structures.
• Public parameters are updated when the source is updated. In other
words, when a Public parameter value updates, it is immediately
available to any higher priority tasks that are connected to that
parameter.
• While Public parameters cannot be connected to controller scope tags,
they can be aliased to controller scope tags. If this functionality is
desired, it is important to remember that the alias updates
asynchronous to program execution. The Public parameter contains
the real-time value of the controller scope tag.
For more information on the Public parameter connections that can be made,
see Program parameter connection rules on page 29.
Connect a Public parameter The following procedure explains how to change an existing tag to a Public
parameter, and then connect a Public parameter to another program.
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 12.
2. On the Program Parameters and Local Tags dialog box, select the Edit
Tags tab.
3. Locate the tag you want to change to a Public parameter, and in the
Usage box, choose Public Parameter.
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. Select OK.
Safety program parameters Special considerations apply when using program parameters within safety
programs.
General rules for The following are general rules when connecting parameters for safety
programs.
connecting parameters for
• A safety parameter cannot connect to a standard parameter or
safety programs controller scoped tag of standard class; the controller scope must be of
class safety.
Program parameter This tables summarize the program parameter connection rules.
connection rules
The following table summarizes the rules for using program parameters to
Standard program to connect two standard programs.
standard program Tip: The connection rules for programs also apply to Equipment Phases.
connection rules
Program_A
(Standard)
Program_B Input Output InOut Public Controller Scope Tag
(Standard) (Standard Class)
Safety program to safety The following table summarizes the rules for using program parameters to
connect two safety programs.
program connection rules
Tip: The connection rules for programs also apply to Equipment Phases.
Program_A
(Safety)
Program_B Input Output InOut Public Controller Scope Tag
(Safety) (Safety Class)
Program_A
(Safety)
Program_B Input Output InOut Public Controller Scope Tag
(Standard) (Safety Class)
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. Without
creating a corresponding input parameter to connect to Program_A,
Program_B can reference the Tank_Level parameter in logic using the syntax
\A.Tank_Level.
Program local tags cannot be accessed using direct access.
Behavior of direct Input, Output, and Public parameters can all be directly accessed in logic.
access in logic • When direct access is implemented in Output parameters, values are
updated when the program that contains the Output parameter
completes execution.
• When direct access is implemented in Input and Public parameters,
the values of the referenced parameters are updated in real time. This
means that higher priority tasks are using parameter values that are up
to date, thus minimizing the risk of performing actions on stale data.
• Direct access to an Input parameter counts toward fan-in. You cannot
have both a connection and a direct access sourcing an Input
parameter. You can however still use direct access to read the value.
• Using direct access of Input parameters is a good way to circumvent
the one connection limit of Input parameters. If you create an Input
parameter but do not configure any connections for that Input
parameter, you can directly reference it from multiple programs.
Access program The following procedure explains how to access program parameters when
parameters when editing editing ladder logic.
ladder logic Tip: While this example is specific to ladder logic, the notation is the same for all programming
languages.
2. In the Ladder Editor Routine, locate the instruction for which you
want to add a reference to a program parameter that is in another
program.
3. Double-click the existing tag name (it appears as ? if currently
unassigned), and choose the pull-down arrow.
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 connect 11
connection methods 12
connection of UDT sub-elements 15
connection syntax 14
Public parameter
A connect to another program 26
connection types and uses 25
argument 9 general connection rules 26
overview 25
C
connect
S
InOut parameter 24 safety program parameters
Input parameter 15 general connection rules 28
Output parameter 19, 20 overview 28
Public parameter 26
connection methods 12 U
D UDT sub-elements 15
direct access
behavior 33
overview 33
use 33
I
InOut parameter
connect to a controller scope tag 24
connection types and uses 23
general connection rules 24
overview 23
Input parameter
connect to a controller scope tag 15
connection types and uses 15
general connection rules 15
overview 15
O
Output parameter
connect to a controller scope tag 19
connect to another program 20
connection types and uses 18
general connection rules 19
overview 18
P
passed by reference 9
Literature Library Find installation instructions, manuals, brochures, and technical data publications. rok.auto/literature
Product Compatibility and Download Center Get help determining how products interact, check features and capabilities, and rok.auto/pcdc
(PCDC) find associated firmware.
Documentation feedback
Your comments help us serve your documentation needs better. If you have any suggestions on how to improve our content, complete the form at
rok.auto/docfeedback.
Rockwell Automation maintains current product environmental information on its website at rok.auto/pec.
Allen-Bradley, expanding human possibility, Logix, Rockwell Automation, and Rockwell Software are trademarks of Rockwell Automation, Inc.
Trademarks not belonging to Rockwell Automation are property of their respective companies.
Rockwell Otomayson Ticaret A.Ş. Kar Plaza İş Merkezi E Blok Kat:6 34752, İçerenkÖy, İstanbul, Tel: +90 (216) 5698400 EEE YÖnetmeliğine Uygundur