Rockwell Automation Publication 1756-PM004D-EN-P - September 2012
29
Organizing Tags
Chapter
2
Guidelines for Tags
Use the following guidelines to create tags for a Logix5000 project.
Table 4 - Tag Guidelines
Table 5 - Guideline
Details
Create user-defined data types
User-defined data types (structures) let you organize data to match your machine or process. A user-defined data type
provides these advantages:
·
One tag contains all the data related to a specific aspect of your system. This keeps related data together and easy
to locate, regardless of its data type.
·
Each individual piece of data (member) gets a descriptive name. This automatically creates an initial level of
documentation for your logic.
·
You can use the data type to create multiple tags with the same data layout.
For example, use a user-defined data type to store all the parameters for a tank, including temperatures, pressures,
valve positions, and preset values. Then create a tag for each of your tanks based on that data type.
Use arrays to quickly create a group
of similar tags
An array creates multiple instances of a data type under a common tag name.
·
Arrays let you organize a block of tags that use the same data type and perform a similar function.
·
You organize the data in one, two, or three dimensions to match what the data represents.
For example, use a two-dimensional array to organize the data for a tank farm. Each element of the array represents a
single tank. The location of the element within the array represents the geographic location of the tank.
Important: Minimize the use of BOOL arrays. Many array instructions do not operate on BOOL arrays. This makes it
more difficult to initialize and clear an array of BOOL data.
·
Typically, use a BOOL array for the bit-level objects of a PanelView screen.
·
Otherwise, use the individual bits of a DINT tag or an array of DINTs.
Take advantage of program-scoped tags
If you want multiple tags with the same name, define each tag at the program scope (program tags) for a different
program. This lets you reuse both logic and tag names in multiple programs.
Avoid using the same name for both a controller tag and a program tag. Within a program, you cannot reference a
controller tag if a tag of the same name exists as a program tag for that program.
Certain tags must be controller scope (controller tag).
If you want the tag
Then assign this scope
In more than one program in the project
Controller scope (controller tags)
In a Message (MSG) instruction
To produce or consume data
In any of the seven AXIS data types
To communicate with a PanelView terminal
None of the above
Program scope (program tags)
For integers, use the DINT data type
To increase the efficiency of your logic, minimize the use of SINT or INT data types. Whenever possible, use the DINT
data type for integers.
·
A Logix5000 controller typically compares or manipulates values as 32-bit values (DINTs or REALs).
·
The controller typically converts a SINT or INT value to a DINT or REAL value before it uses the value.
·
If the destination is a SINT or INT tag, the controller typically converts the value back to a SINT or INT value.
·
The conversion to or from SINTs or INTs occurs automatically with no extra programming. But it takes extra
execution time and memory.
Use most restrictive external access
External access limits the exposure of controller tags by defining a user’s ability to edit tags to Read/Write, Read Only
and None. This helps:
·
reduce the risk of inadvertently changing tags.
·
reduce the number of tags to browse when configuring HMI.
See “
.
Enable constant attribute for tags that should not be
changed by logic
A constant value can be assigned to a tag to prevent the table-backed data from being changed programmatically.
This helps reduce the risk of inadvertently changing tags.
See “
.
Содержание 1756-L65 ControlLogix 5565
Страница 4: ...2 Rockwell Automation Publication 1756 PM004D EN P September 2012 Summary of Changes Notes...
Страница 8: ...6 Rockwell Automation Publication 1756 PM004D EN P September 2012 Preface Notes...
Страница 66: ...64 Rockwell Automation Publication 1756 PM004D EN P September 2012 Chapter 3 Force I O Notes...
Страница 88: ...86 Rockwell Automation Publication 1756 PM004D EN P September 2012 Index...
Страница 89: ......