Tag References vs. OPC Items

It is easy to confuse the definition and purpose of Tag reference items (Scan Class) and direct OPC items (Timer) in transaction groups, though they have distinct benefits.

Tags may be referenced inside of groups, however it is critical to remember that they are executed by the Ignition Gateway, according to their scan classes, and independent of the group. Adding a tag into a group is like creating a shortcut to that tag. However, once in the group, the item can be used like any other item. That is, it may be mapped bi-directionally to the database, used as a trigger, be the target of another item, and so on. It is even possible to create an hour meter out of the item. Core properties of the tag such as alarming and scaling, however, are defined in the actual tag, not in the group.

OPC Items in groups (as well as expression items in groups), however, are completely executed by the group. They do not exist outside of the group in which they are defined. They are subscribed and evaluated according to the rate of the group. Generally speaking, it is most common to create OPC items in groups, even if a particular point might already exist in tags. This leads to more understandable group execution, as all evaluation occurs in the group according to the timer and trigger settings. Tag references are useful when it is necessary to have a single value in multiple groups, for example, as a trigger in order to coordinate execution.

OPC Item

OPC Items are the backbone of a group. They get their values from PLCs and the values are then used by other items in the group and/or to write to the database. They are directly subscribed to an OPC server at the rate of the group and are executed by the group so their alarms are evaluated when the group is executed. These items are executed even when the trigger isn't active.

To create a new OPC Item

  1. In the Designer, go to Project Browser, and click on Transaction Groups.
    The workspace now changes to the Transaction Group workspace.

  2. Right-click on Transaction Group to create a New Transaction Group, or click on a group you have previously created.
    You will now see the workspace changes to look like:

    images/download/attachments/6035158/standard.jpg

  3. Right-click in the white area, and choose New Item > New OPC Item.

    images/download/attachments/6035158/item.jpg

    The Edit group tag window is displayed as follows:

    images/download/attachments/6035158/item1.jpg

The following table describes all the properties on the Edit group tag window.

OPC Item General Properties

General Properties

Name

The name of the OPC item in the group. There cannot be duplicate names within a group.

Data Type

The datatype used to read values from the PLC.

OPC Properties Click on the Browse OPC button, in this section, select the tag you want, and Ignition fills out the following fields for you.

OPC Server

The Selected OPC Server. This is a drop-down list showing all the OPC Servers added in the Ignition Gateway.

OPC Item Path

The OPC Item's address Including Device name or Channel if required.

Value Mode

Property

Which property of the OPC item you want to use.

  • Value - Item value

  • Quality - Quality code from OPC Server (192 = GOOD_DATA)

  • Timestamp - The last time the item value changed

  • Name - The SQLBridge Item Name property of this Item

Mode

Options for displaying values based on the Item value.

  • Direct Value - Item value

  • Hour Meter - Record the amount of time the Item value is non-zero. This accumulation will reset to zero when the item value goes to zero. The datatype should be set to integer or float when using an Hour Meter regardless of the OPC Item type.

    • On Zero - Use a zero value to accumulate time instead of a non-zero value

    • Retentive - Retain the Hour Meter value when it is not accumulating.

    • Units - The time units to display.

  • Event Meter - Record the number or times the Item value is non-zero. The datatype should be set to integer when using an Event Meter regardless of the OPC Item type.

    • On Zero - Use a zero value to accumulate events instead of a non-zero value

Write Target

Mode

Changes the items directional read/write option.

  • Use group's mode - Inherit the Update Mode from the Item's Group.

  • OPC to DB - Only read from the OPC server and write to the database.

  • DB to OPC - Only read from the database and write to the OPC Server.

  • Bi-directional OPC wins - Read and Write to both the database and OPC Server. On group start, write OPC Server values to the database.

  • Bi-directional DB wins - Read and Write to both the database and OPC Server. On group start, write database values to the database.

Target Type

This is the selection for what the Item will write to when the group executes.

  • None, read-only item - Do not write this value to the database.

  • Database field - Write the Item value to the specified column in the database table. This list will populate with all the column names from the Group's target table after the first time the group is run.

Target Name

The name of the column in the database that this Item will write to when the group executes. The Target Name list will populate with all the column names from the Group's target table if the Target Type is Database field.

Alarming

The Alarming settings for the OPC items. See Alarming Properties for a full explanation.

Tag Reference

Tag References are used just like OPC Items, adding the convenience of using a Tag that has already been set up with scaling and alarm data.

Tag Item

General

Name

The name of the OPC item in the group. There cannot be duplicate names within a group.

Tag Path

The path to the tag being referenced. This value is not editable except by clicking the Insert Tag button. There cannot be duplicate names within a group.

Data Type

The datatype to write to into the database if this item is not read-only.

Value Mode

Property

Which property of the Tag you want to use.

  • Value - Item value

  • Quality - Quality code of the Tag (192 = GOOD_DATA)

  • Timestamp - The last time the item value changed

  • Name - The SQLBridge Item Name property of this Item.

Mode

Options for displaying values based on the Item value.

  • Direct Value - Item value

  • Hour Meter - Record the amount of time the Item value is non-zero. This accumulation will reset to zero when the item value goes to zero. The datatype should be set to integer or float when using an Hour Meter regardless of the OPC Item type.
    On Zero - Use a zero value to accumulate time instead of a non-zero value
    Retentive - Retain the Hour Meter value when it is not accumulating.
    Units - The time units to display.

  • Event Meter - Record the number or times the Item value is non-zero. The datatype should be set to integer when using an Event Meter regardless of the OPC Item type.
    On Zero - Use a zero value to accumulate events instead of a non-zero value

Write Target

Mode

Changes the items directional read/write option. This is only editable when the target Type is set to Database field.

  • Use group's mode - Inherit the Update Mode from the Item's Group.

  • OPC to DB - Only read from the OPC server and write to the database.

  • DB to OPC - Only read from the database and write to the OPC Server.

  • Bi-directional OPC wins - Read and Write to both the database and OPC Server. On group start, write OPC Server values to the database.

  • Bi-directional DB wins - Read and Write to both the database and OPC Server. On group start, write database values to the database.

Target Type

This is the selection for what the Item will write to when the group executes.

  • None, read-only item - Do not write this value to the database.

  • Database field - Write the Item value to the specified column in the database table.

Target Name

The name of the column in the database that this Item will write to when the group executes. The Target Name list will populate with all the column names from the Group's target table if the Target Type is Database field.