Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

Creating Local Tags and

Program Parameters
Important User Information
This documentation, whether, illustrative, printed, “online” or electronic (hereinafter “Documentation”) is intended for use only as
a learning aid when using Rockwell Automation approved demonstration hardware, software and firmware. The Documentation
should only be used as a learning tool by qualified professionals.

The variety of uses for the hardware, software and firmware (hereinafter “Products”) described in this Documentation, mandates
that those responsible for the application and use of those Products must satisfy themselves that all necessary steps have been
taken to ensure that each application and actual use meets all performance and safety requirements, including any applicable
laws, regulations, codes and standards in addition to any applicable technical documents.

In no event will Rockwell Automation, Inc., or any of its affiliate or subsidiary companies (hereinafter “Rockwell Automation”) be
responsible or liable for any indirect or consequential damages resulting from the use or application of the Products described in
this Documentation. Rockwell Automation does not assume responsibility or liability for damages of any kind based on the
alleged use of, or reliance on, this Documentation.

No patent liability is assumed by Rockwell Automation with respect to use of information, circuits, equipment, or software
described in the Documentation.

Except as specifically agreed in writing as part of a maintenance or support contract, equipment users are responsible for:
• properly using, calibrating, operating, monitoring and maintaining all Products consistent with all Rockwell Automation
or third-party provided instructions, warnings, recommendations and documentation;
• ensuring that only properly trained personnel use, operate and maintain the Products at all times;
• staying informed of all Product updates and alerts and implementing all updates and fixes; and
• all other factors affecting the Products that are outside of the direct control of Rockwell Automation.

Reproduction of the contents of the Documentation, in whole or in part, without written permission of Rockwell Automation is
prohibited.

Throughout this manual we use the following notes to make you aware of safety considerations:

Identifies information about practices or circumstances


that can cause an explosion in a hazardous environment,
which may lead to personal injury or death, property damage, or economic loss.

Identifies information that is critical for successful application and understanding of the product.

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
• recognize the consequence

Labels may be located on or inside the drive to alert people that dangerous voltage may be present.

Labels may be located on or inside the drive to alert people that surfaces may be dangerous temperatures.
Level 1: Logix - On Demand Creating Local Tags and Program Parameters

Before You Begin

About this Lab


The Studio 5000 Logix Designer® application provides for the allocation and naming of controller
memory in the form of tags. Tags are nothing more than well-defined and logically-named
variables. Tags may be controller scoped, in which case their data is available globally
throughout the Logix Designer project. However, tags may also be local (i.e., program scoped),
thereby encapsulating the data within a particular program. Furthermore, a special local tag,
called a program parameter, may also be employed. Like a local tag, a program parameter
encapsulates data within a program. However, it also provides controlled access to the data
from outside the program. In this lab you will:
 Create local tags and program parameters
This lab takes approximately 15 minutes to complete.

Hardware
To complete this lab, you will require the following hardware:
 PC-based programming workstation with access to the RAcbi learning environment

Software
To complete this lab, you will require the following software:
 Studio 5000 Logix Designer version 32

Files
To complete this lab, you will require the following files:
 Machine_1_Lab07.ACD

Setup
To complete this lab, you will need to perform the following setup procedure:
1. Log on to your instance of the RAcbi learning environment.

© Rockwell Automation, Inc. All rights reserved. 1


Creating Local Tags and Program Parameters Level 1: Logix - On Demand

Create Local Tags and Program Parameters


When we want to program logic in our Programmable Automation Controller (PAC), we use tags
to store the data that we manipulate in our logic and that can interface with external hardware,
such as inputs (e.g., sensors), outputs (e.g., actuators), and intelligent devices (e.g., variable
frequency drives). While we could do all of this at the global, or controller scope, a much better
practice involves encapsulating the data to the local, or program scope. Prior to version 24 of
the Logix Designer application, this was accomplished using local tags and something called
aliasing. However, with the advent of version 24, the best practice is to use local tags and
program parameters. In this section of the lab, you will create the local tags and program
parameters necessary for logic that will control conveyors on an assembly line.
1. If you have completed all labs up to this point in the Level 1: Logix - On Demand course,
then you may continue using your Machine_1.ACD file from previous labs:
a. Open the Studio 5000® environment.
b. Under Recent Projects, select your Machine_1 project:

1.b.

2. If you have NOT completed all labs up to this point in the Level 1: Logix - On Demand
course (e.g., you are just doing this individual lab as a refresher), then open the starting
file for this lab:

a. Use the shortcut on the desktop of your instance of the RAcbi learning
environment to open the LabFiles.
b. Open the Machine_1_Lab07.ACD file.

2 © Rockwell Automation, Inc. All rights reserved.


Level 1: Logix - On Demand Creating Local Tags and Program Parameters

Logix Designer projects break logic down into tasks, programs, and routines. Tasks
provide a means of controlling how often and when our single logic processor core runs
our logic, thereby distributing the load on the processor core over time. Programs allow
us to encapsulate our logic and data. Routines are where we actually program the logic
and they not only provide control over when a routine runs, but also in which
programming language the logic is programmed.
By default, a new Logix Designer project contains a MainTask, a MainProgram, and a
MainRoutine. We may use these as-is, modify them, or delete them altogether. Of
course, we may also add other tasks, programs, and routines. For now, we will simply
use the default MainTask, MainProgram, and MainRoutine.
Local tags and program parameters exist at the program scope. Therefore, we begin
creating local tags and program parameters from within our MainProgram.
3. Go to the Controller Organizer of your project and, from within the Tasks folder,
expand the MainTask and MainProgram:

© Rockwell Automation, Inc. All rights reserved. 3


Creating Local Tags and Program Parameters Level 1: Logix - On Demand

4. Double-click the Parameters and Local Tags:

5. When the table opens, go to the bottom and select the Edit Tags tab:

The Edit Tags tab allows us to create and edit tags and program parameters, while the
Monitor Tags tab allows us to monitor the values currently stored within the tags and
program parameters.
The tag tables within the Logix Designer application may be customized to display the
information that the user wants to see. So, before we create any local tags or program
parameters, let’s modify the table to suit our purposes.
Because we are using program parameters rather than aliasing, let’s hide the columns
related to aliasing that we will not need to use.

4 © Rockwell Automation, Inc. All rights reserved.


Level 1: Logix - On Demand Creating Local Tags and Program Parameters

6. Right-click the table header for the Alias For column and select Hide Column:

7. Repeat step 6 to hide the Base Tag column so that your table appears similar to the
following:

Our application calls for the control of two conveyors in a single production line. We
know that these conveyors will be controlled individually using pushbuttons that are
hard-wired to a digital input module. So, we require a Start input and a Stop input. We
also require a Motor On output to command the conveyor motor to run, and a Motor Off
output to command the conveyor motor to stop. At this point, we have not decided
whether we will use an across-the-line starter, a soft start, or a variable frequency drive.
However, it does not matter, as all three solutions require these two commands (Motor
On and Motor Off).
Since we intend on having multiple conveyors in this single assembly line program, we
will need to somehow distinguish between them. We could add a name that explains the
purpose of the conveyor (e.g., Start_Infeed and Start_Outfeed). However, in this
example, we will simply number them.
Furthermore, at some point in the future we would like to add similar control from a touch
screen Human Machine Interface (HMI). So, we will need to distinguish between
pushbutton inputs and HMI inputs.

© Rockwell Automation, Inc. All rights reserved. 5


Creating Local Tags and Program Parameters Level 1: Logix - On Demand

Therefore, our local tags and program parameters should include the following:

Inputs Outputs

Start_PB_01 Motor_On_01

Start_PB_02 Motor_On_02

Stop_PB_01 Motor_Off_01

Stop_PB_02 Motor_Off_02

8. In the Program Parameters and Local Tags, double-click the Name cell of the first row
and type ‘Start_PB_01’:

When naming our tags, there are a few rules of which we need to be aware. These rules
stem from the IEC 61131-3 standard. When naming tags, we can:
 Use up to 40 characters.
 Use upper and lower case letters A through Z (tag names are NOT case sensitive).
 Use numbers 0 through 9.
 Use the underscore character (_).
 NOT use spaces.
 NOT use other characters.
 NOT begin the tag name with a number.

9. Press the Tab key on your keyboard to advance to the next cell.

6 © Rockwell Automation, Inc. All rights reserved.


Level 1: Logix - On Demand Creating Local Tags and Program Parameters

10. Click the dropdown arrow next to Local to reveal the Usage options:

A Local Tag usage stores data that may only be accessed from within the program
wherein the tag is created. An Input Parameter usage is similar to a Local Tag, with the
additional ability to be connected to a single controller tag or program parameter that is
sending data into the program. An Output Parameter usage is similar to a Local Tag,
with the additional ability to be connected to one or more controller tags or program
parameters that are receiving the data from the program parameter. So, to get
conditional data into the program, we could use the Input Parameter usage. To get
command data out of the program, we could use the Output Parameter usage.
In terms of our required local tags and program parameters, we see that the start and
stop pushbutton signals are all coming into the program. So, we should use the Input
Parameter usage. Whereas the motor on and off command signals to our motor control,
which are going out of the program, should be Output Parameter usage.
11. Select the Input Parameter Usage for the Start_PB_01 program parameter:

12. Press the Tab key on your keyboard to advance to the next cell.
The data types of our tags must suit the needs of the data being stored in the tags. In
the case of our conveyor control inputs, we are using momentary push buttons that have
but two states (i.e., open or closed). Therefore, the data required is a single bit, which
will allow for the open state (represented by a 0 value) and the closed state (represented
by a 1 value) of the pushbutton. In the Logix Designer application, a single bit of data
uses the Boolean (or BOOL) data type.

© Rockwell Automation, Inc. All rights reserved. 7


Creating Local Tags and Program Parameters Level 1: Logix - On Demand

13. In the Data Type cell, click the ellipsis button:

14. In the Select Data Type window that appears, type ‘BOOL’ into the search box, select
the BOOL data type, and click the OK button:

15. Press the Tab key on your keyboard to advance to the next cell.
Each tag or program parameter may include a description. This could be helpful to
technicians or other programmers who have to work with our logic in the future.
However, this description is tied to the data, so it should describe the data, rather than
how the data may be used with a particular logic instruction. Furthermore, this
description is displayed in our routines. So, to keep our logic clean and brief, the tag
descriptions should likewise be brief. In the case of our start signal, the data contains the
state of a normally open (NO), momentary pushbutton.

8 © Rockwell Automation, Inc. All rights reserved.


Level 1: Logix - On Demand Creating Local Tags and Program Parameters

16. In the Description cell for the Start_PB_01 program parameter, type ‘NO Momentary’:

17. Click into the next (External Access) cell to store the description that you have entered.
The external access setting allows us to restrict access to data from outside
applications, such as an HMI. We will not restrict access to our data at this time.
18. Maintain the default External Access configuration of Read/Write:

19. Press the Tab key on your keyboard to advance to the next cell.
The constant setting allows us to define a constant value for a tag. In this case, our tag
is a variable that can be either a 0 or a 1, so we will leave this box unchecked.
20. Press the Tab key on your keyboard to advance to the next cell.
The style configuration allows us to control how a tag’s value is displayed (e.g., as
decimal, hexadecimal, binary). In the case of a Boolean value, this is somewhat
irrelevant, as any of the selections will display the same thing. However, later on, when
we start using integer data types, this setting can be quite useful.
21. Notice the asterisk at the front of our program parameter:

© Rockwell Automation, Inc. All rights reserved. 9


Creating Local Tags and Program Parameters Level 1: Logix - On Demand

Whenever we see an asterisk in a configuration window of a Logix Designer project, it


indicates that changes have been made to the configuration, but those changes have yet
to be written to the project.
22. Press Enter on your keyboard and notice that the program parameter is written to the
project:

23. Continue adding to your Program Parameters and Local Tags until the table appears
as follows:

24. Close the Program Parameters and Local Tags:

25. Save your project by clicking the save icon in the upper left corner of the project
window.

10 © Rockwell Automation, Inc. All rights reserved.

You might also like