Allen-Bradley Control/CompactLogix Tags

Topic: CM128

The ControlLogix, CompactLogix and FlexLogic PLC are tag based PLC architectures and do not have traditional PLC addressing like the SLC and MicroLogix series.

The five main types of tags are listed and discussed below:

Atomic Tags

Atomic tags are the base data type unit of which all other complex data types are comprised. The Atomic data types are:

  • BOOL
  • SINT
  • INT
  • DINT
  • REAL

The syntax for the Atomic data types is the tag name itself (no precursors or delimiters). You can address all Atomic data types in the C-more programming software. You can import them with L5K or L5X file.

Examples:

Tag Name Type Description
THIS_IS_A_BOOL_TAG BOOL Single Bit
THIS_IS_A_SINT_TAG SINT Byte or Short Integer
THIS_IS_A_INT_TAG INT Single Word Single Integer
THIS_IS_A_DINT_TAG DINT Double Word Signed Integer
THIS_IS_A_REAL_TAG REAL Double Word Float

Predefined Structures Tags

Predefined fata types are complex and made up of 1 or more Atomic data types, Arrays, or other predefined data types. They are commonly called “Structures” in other programming languages such as C. The predefined data types already exist in RS Logix 5000 with every new project you create.

Structures include:

  • Timers
  • Controls
  • Counters
  • Strings
  • Any grouping of different Data types that function as a single unit and serve a specific purpose predefined in the software

Examples:

Tag Name Type Tag Description
TIMER_TAG.DN BOOL A "timer done" member of a TIMER structure.
TIMER_TAG.ACC DINT A "timer accumulated time" member of a TIMER structure.
STRING_TAG.DATA STRING The actual string Data member of a STRING structure.

There are hundreds of predefined data types available in the RS Logix 5000 software. You can address all predefined data types in the C-more programming software. You can import predefined data types with the L5K or L5X file, but the L5KPreDefine.txt or L5XPreDefine.txt document located in Documents\AutomationDirect\C-more\Setting.

See Importing Control/CompactLogix Predefined Data Types.

Array Tags

Array tags are a data structure of a sequential set of the same data type. Each element has an index number. You can create Arrays from Atomic data types or complex data types (predefined or user-defined). You can address all Array tags in the C-more programming software. You can import Array tags (depending upon what data type array) with the L5K or L5X file. You may choose to limit the number of imported elements by adjusting the Import Array Element Count Limit field in the C-more programming software import window.

Examples:

Tag Name Type Tag Description
BOOL_ARRAY[0] BOOL The first element of a BOOL array.
DINT_ARRAY[10] DINT The 11th element of a DINT array.
STRUCTURE_ARRAY[0].BOOL BOOL A BOOL member of an array of structures.

 

User-Defined Tags

User-Defined structures are complex data types the user creates. They are very much like the predefined structures, but you can choose which data type members the user-defined data type is used for. You can address all user-defined data types in the C-more programming software. You can import user-defined data types with L5K or L5X file depending upon the members of the user-defined data type.

Examples:

  • MY_STRUCT_1.DINT_MEMBER.INTARRAY_MEMBER[0].BOOL_MEMBER is a BOOL member of INT ARRAY member of a DINT member of the MY_STRUCT Data type that the user creates.

Add-On Instructions

Add-On Instructions allow you to organize common routines and reuse logic. The AOI parameters are similar to UDT members. When you use an AOI data type for a controller or program scope tag, the AOI Parameters are the structure members.

Here are the definitions for AOI Parameters local tags.

Here are controller scope AOI tags. Notice that the AOI local tags are not available. Only input and output tags are available at the controller or program scope. Additionally, for C-more access, you must mark those tags with “Read/Write” or “Read Only” external access permission.

 

Note: Instruction tag import for Add-On Instruction is only supported using the L5X (not L5K). See the section, “Importing Tags Method”.

Enter Tags

You can enter tags in the C-more Programming Software one of two ways:

See the methods explained below or click on the links above to go directly to the subject.

Import Tags

The easiest method to add PLC Tags to the C-more project is to import the L5K or L5X file from RSLogix 5000.

The newer L5X file format allows C-more to directly import I/O module tags. You can customize a configuration file to reduce the I/O module tags, which import automatically. By default, all I/O Module tags import, which may create a large number of unnecessary tags. To disable automatic import for a group of Module tags, change the value from 1 to 0.

The configuration file is at this path: \Documents\AutomationDirect\C-more\Setting\L5XPreDefine.txt

The available options are:

  • ModuleIO_Include_Local=1
  • ModuleIO_Include_Remote=1
  • ModuleIO_Include_Inputs=1
  • ModuleIO_Include_Outputs=1
  • ModuleIO_Include_Config=1
  • ModuleIO_Include_Status=1

The C-more Programming Software will import both controller scope and program scope tags. In RSLogix 5000, you can save the project as an .L5K or .L5X extension with Save As and then choose L5K or L5X at the bottom of the Save As Type drop-down menu as shown below.

  1. From the Main menu select File.
  • The drop-down menu opens.
  1. From the File drop-down menu, select Import and then Tag Name Database.

  • The Import Tag Name Database window opens.

  1. In the File Path field, click the drop-down arrow and choose your.L5K file and click Import.

If you have multiple PLC in your C-more Programming Software project, you can choose what device to import the tags to. You can also choose text to append to the end of each tag if you import multiple projects with the same Tag Names. To learn more about Importing Tag Names, see Importing Tag Methods.

 

Note: The C-more Programming Software can import Atomic Tags, TIMER Data Type tags, COUNTER Data Type tags, STRING Data Type tags, and User-defined Data Type tags containing the preceding Tag Types from an RSLogix 5000.L5K or.L5X file. All other predefined Data Type tags or User-defined Data Type tags comprising predefined Data Type tags (except TIMERS, COUNTERS, and STRINGS) may be imported usingthe methods described in Help Topic Importing Control/CompactLogix Predefined Data Types.

Manually Add a Tag

The second method to add tags to the C-more Programming Software is to manually enter the tags directly. This method can be used for any tag type.

  1. From the C-more Programming Software, click the Main menu and select the Database.
  • The drop-down menu shown below will open.
  1. From the Database drop-down menu, select Tag Name Database.

  1. From the Tag Name Database window, click the Add button located on the lower left portion of the window and follow these steps:

  • Once you select the Add button, the Tag Name — Add window appears.

 

The window allows the user to enter the required information for the parameter fields for the new tag name. The following list provides information on the fields available:

  • No.: The number the application automatically assigns to the tag name.
  • Device Name: Provides a drop-down list of available devices. If using a Panel Internal Tag, select Internal or select an External PLC name (DEV001, DEV002, etc.) assigned in the Panel Manager.
  • Tag Name: Type in a tag name that will help you easily identify the Tag.
  • Tag Data Type: Select the Data Type (Discrete, BCD int 16, ASCII String, etc.) required for this specific tag.
  • Characters: This field is inactive and will only be active if the ASCII String Data Type is selected. This field allows the user to identify the Number of Characters for the ASCII String.
  • Retentive: This box is inactive and will only be active when you enter Internal Tags (Device Name= <INTERNAL>). Tick the box to set the tag as Retentive. If power is lost at the C-more panel, the value of the tag is stored in SDRAM, and when power is restored to the C-more panel, the tag retains that value.
  • PLC Address: The PLC Address is not active unless a PLC device is selected for the Device Name. The PLC Address requires the user to enter the Memory Type and the Address in the selected PLC. When using Discrete Data Type, you must enter a Bit value. You wil have to understand the values for these fields.

 

Note: For the PLC Address portion of the Tag Name — Add window, in the Address field, enter the PLC Tag Name displayed on the RSLogix 5000 window. The figure below shows a view of the RSLogix 5000 window displaying tag names. Enter the contents for the specific tag under the Tag Name column.

 

Note: When you add a Tag Name to the Tag Name Database, notice that Memory Type and Address are listed together under the PLC Address column of the Tag Name Database window. The figure shows that the PLC AddressINT THIS_IS_AN_INT_TAG, INT is the Memory Type and THIS_IS_AN_INT_TAG is the actual Address.

Memory Types

Memory Types available for the Allen-Bradley Tag-Based Control/CompactLogix PLC are:

  • DINT: Represents a Memory with a value of 32-bit 2 compliment integer —2,147,483,648 to 2,147,483,647.
  • INT: Represents a Memory with a value of 16-bit 2 compliment integer — 32,768 to 32,767.
  • SINT: Represents a Memory with a value of 8-bit 2 compliment integer — 128 to 127.
  • STRING: Represents a Memory with an ASCII string value.
  • CONTROL: Represents Memory that holds Complex Instructions.
  • COUNTER: Represents Memory that holds values from a Counter.
  • MESSAGE: Memory used for Communication purposes between remote devices.
  • PID: Memory used for PID control functions.
  • TIMER: Represents Memory that holds values from a Timer.

Other Memory Types available for other PLC are:

  • BOOL: Represents Memory that holds a Boolean TRUE or FALSE value.
  • REAL: Represents a Memory with a 32-bit floating point value +/-1.1754944e-38 to +/-3.4028237e38.

Edit a Tag

  • From the Tag Name Database window click on the Edit button on the lower left portion of the window
    — or —
  • Double-click on the Tag Name directly. 
  • The Tag Name — Edit window opens.

To edit the Tag Name fields, click on the respective field and overwrite the current information or click on the down arrow and select from the drop-down list.

For more information on the fields, click on the green Add a Tag Name text. The information about the fields applies to edits.

Program Scope Tags

While Controller Scope tags are globally accessible, Program Scope tags are only accessible from with the specific program. You can access Program Scope tags via C-more or other HMI, but they require additional syntax in front of the tag name.

To access Program Scope Tags, enter them as follows:

Program:aaaa.bbbb

Where aaaa is the name of the program in the PLC and bbbb is the Tag Name.

The PLC Program Name is Main Program and the PLC Tag Name is DINT_PROGRAM_TAG. Therefore, the PLC Address you enter in C-more is:

PROGRAM:MAIN PROGRAM.DINT_PROGRAM_TAG

Related Topics Link IconRelated Topics