Tags (Operands)

UniLogic uses lexical Data Tags in compliance with IEC 61131-3.

To create a Data Tag, you create a lexical name and link it to a Data Type.

The device's memory is dynamically allocated depending on the data tags you create and the data type you link to your tags. When you link tags to elements and functions in your program, a powerful Intellisense algorithm filters the tag list as you type.

Data Tags are shown by default at bottom of the UniLogic interface. Click the tabs at the bottom of the window to see the different types of tags.

Tag Window - System Tags

 

Data Tags have a Scope property. This determines where you can use the tag in your program.

Automatically-created Tags

System

Linked to elements within the UniStream operating system. System tags are global by definition, and are read-only. They are Global in scope by definition, and are organized into structs.

I/O

Linked to structs that are automatically created when you include I/O modules in your Hardware Configuration. They are Global in scope by definition.

 

User-created Tags

Global Scope

Tags that you create and link to Data Types. The Global scope property means that you can use Global tags throughout your program, in both your HMI and Ladder applications.

Note that you can also organize Global tags in Groups.organize Global tags in Groups.

  1. Click in the Groups field to create a Group.


  2. Add Tags to Groups.




  3. Click a Group to see its tags.



    You can right-click a group to rename it.

 

Local Scope

Tags that you create within a specific Ladder function. They are only visible and available within that function. This means that, if your application requires, you can use the same tag names in different functions.

Note that Local tags cannot:
- retain value
- be used in HMI applications
- be seen in On-Line mode

Note

  • You can convert a local tag to global, or global to local, by right-clicking it in the Tag Window and selecting the desired option.

    ConvertLocalTag2Global

FunctionIn
Scope

You can assign the FunctionIn property to a Local tag of any Data Type in order to transfer values into the function it belongs to.

When the function is dragged into another function as a UDFB, the FunctionIN tags appear on the left.

Note that FunctionIN tags cannot:
- retain value
- be used in HMI applications
- be seen in On-Line mode

FunctionOut
Scope

You can assign the FunctionOut property to a Local tag of any Data Type in order to transfer values out of the function it belongs to.

When the function is dragged into another function it appears on the right of the function as an output parameter.

Note that FunctionOut tags cannot:
- retain value
- be used in HMI applications
- be seen in On-Line mode

 

Via the Project tab, you can create a project containing pre-defined operand addresses that are already linked to data types.

You can also create arrays of operands, and Structs.

Arrays

User-defined

The user may include operands of the same data type which may be handled as a sequential block of data.

Structs

User-defined

The user may mix other operand types, or arrays of operands, into a structure, which may be handled as a sequential block of data.

 

Retain Value, Power-up and Initial Values

'Retain' and 'Power-up' Values are mutually exclusive. You can select one or the other.

Only Global tags can be checked as 'Retain', enabling them to have their value backed up by the controller's battery.

When you check Retain, you have the option of entering an Initial Value.

Retain

If you

  • enter a value, this value will be written to the tag the first time you download the application.

  • do not enter a value, the tag value will be initialized to 0 the first time a tag is downloaded to the PLC.

Note that if you change a tag's Data Type, the tag will be initialized to 0 at download.

An entire array can be checked 'Retain', as can the members of a struct.

RetainArray

Power-up values can be assigned to individual tags, and to members of arrays and structs.

Power-upValue

Notes

  • To create a Named Constant, enter a power-up value and check the # (Constant ) box.

 

Alias Names

Alias names enable you to assign tags with easy-to-remember names. You can use an actual or an Alias name to address elements.
Alias names may be used with I/O tags, Global arrays, and the members of Structs after they have been declared in a function.
The following example shows how to assign an Alias to I/O tags.

  1. Click any blue, underlined tag to open the editor.

  2. Enter an Alias Name and a Description.

    HWC I/O Struct Alias

  3. Click individual elements to rename them or to enter an Alias Name.

    HWC I/O Struct Alias2

When you use the I/Os in your application, you can search for them using either:

Note that you can always display full information for the tag by mousing over it in the Ladder.

Alias mouseover

 

 

 

Related Topics

Data Types

Creating User-defined Data Tags

Importing and Exporting Data Tags

Structs

On-Line Test Mode (Debug)