Page 49

Petruzella_ProgrammableLogicControllers__5e

Program Tags Tag 1 Tag 2 Tag 3 Controller memory Tag 1 Data Tag 2 Data Memory locations Tag 3 Data addresses. A tag is created to represent the data and identify areas in the controller’s memory where these data are stored. In applications developed using RSLogix 5000 software, there are no predefined data tables such as in an SLC 500. When you want to use or monitor data in a program you use tag names to refer to the memory locations, as illustrated in Figure 15-10. This functionality allows you to name your data specifically for their functions within the control program while providing self-documented logic. Whenever you wish to group data, you create an array, which is a grouping of tags of similar types. Scope refers to which programs have access to a tag. The scope of a tag must be specified when you create the tag. There are two scopes for tags: program scope and controller scope. A program tag consists of data that can be accessed only by routines within a specific program (local data). The routines in other programs cannot access program scoped tags of another program. A controller tag consists of data that are accessible by all routines within a controller (global data). Figure 15-11 shows two programs, A and B, within a project. Note that each program has program scope tags with identical names (Tag_1, Tag_2, and Tag_3). Because they are program scoped, there is no relationship between them, even though they have the same name. The program scope data are accessible only to the routines within a single program. The same tag name may appear in different programs as local variables because you can select the scope in which to create the tag. The scope of a tag must be declared when you create the tag. Figure 15-12 shows program and controller Controller Scope Tags Sensor_1 Temp_1 Program A Program B Other routines Main routine Program scoped tags Tag_1 Tag_2 Tag_3 Program scoped tags Tag_1 Tag_2 Tag_3 Other routines Main routine 338 Part 1  Memory and Project Organization Controller scoped Controller RSLogix Controller Tags Controller Fault Handler Power-Up Handler Tasks Continuous Program_01 Program Tags MainRoutine Periodic Program_02 Program Tags MainRoutine Program scoped Program scoped scoped tags as listed in the controller organizer under the program they are assigned to. I/O tags are automatically created as controller scoped tags. There are four different tag types: base, alias, produced, and consumed tags. The tag type defines how the tag operates within the project. A base tag stores various types of data for use by logic in the project. This tag defines a memory location where data are stored. Base tag memory use depends on the type of data the tag represents. An example of the base tag Local:2:O.Data.4 is shown in Figure  15-13 and is based on the following format: Figure 15-10  Tags used to assign memory locations. Figure 15-11  Program scoped and controller scoped tags. Figure 15-12  Listing of program and controller scoped tags. Location Network location LOCAL 5 same chassis as the controller Slot Slot number of I/O module in its chassis Type Type of data I 5 input O 5 output C 5 configuration S 5 status Member Specifies the type of data that the module can store. Digital (discrete) I/O modules use a DATA member. Analog I/O modules use a Channel Member (CH#) SubMember Specific data related to a Member. Bit Specific point on a digital I/O module; depends on the size of the I/O module (0-31 for a 32-point module) An alias tag is used to create an alternate name (alias) for a tag. The alias tag is simply another name for an already named memory location. An alias tag can refer to a base, alias, consumed, or produced tag. The alias tag is often used to create a tag name to represent a real-word input or output. Figure 15-14 shows an example of the


Petruzella_ProgrammableLogicControllers__5e
To see the actual publication please follow the link above