Add a local tag to the definition of an Add-On Instruction

A local tag is a tag used by the logic in an Add-On Instruction and is not visible outside the Add-On Instruction. Other Add-On Instructions or programs in the project cannot access a local tag. A local tag contains data that the Add-On Instruction uses without exposing the tag to a user of the Add-On Instruction. Local tags do not appear in the data structure for an Add-On Instruction because local tags are hidden members.
To access a local tag or one of its members from outside the instruction, define an alias parameter.
  1. On the explorer bar, select Library icon
    Library
    .
  2. In
    Library
    , select the Add-On Instruction and then in the
    Library
    title bar, select
    View
    Tags icon
    tags and parameters: (name).
  3. In the last row of the Tag Editor, select
    Add Tag
    . A new row appears.
  4. In
    Name
    , type the name of the tag or program parameter.
  5. In
    Data Type,
    type the name of the data type until the data type appears or browse to open
    Select Data Type
    , select the data type, and then select
    Apply
    .
    TIP:
    • You cannot select the current Add-On Instruction data type as the data type for either local tags or parameters.
    • Local tags do not support the data types ALARM_ANALOG, ALARM_DIGITAL, MESSAGE, or MODULE. To use ALARM_ANALOG, ALARM_DIGITAL, MESSAGE, or MODULE data types in an Add-On Instruction, define an InOut Parameter. Like user-defined data types, local tags are limited to single dimension arrays type as the data type for either local tags or parameters.
  6. In
    Usage
    , accept LOCAL as the default usage type.
  7. In
    Default Value
    , enter the value of the tag. Default values are loaded from the Add-On Instruction definition into the tag of the Add-On Instruction data type when it is created or any time a new tag is added to the Add-On Instruction.
  8. (optional) In
    Style
    , for a BOOL, SINT, INT, DINT, or REAL tag, select a display style to define how the tag value appears. Styles include BINARY, DECIMAL, HEX, OCTAL, ASCII, EXPONENTIAL, FLOAT.
  9. (optional) In
    Description
    , enter a maximum of 512 characters to indicate the purpose of the tag or the latest change to the tag.
  10. Repeat steps 3 through 9 to add another local tag.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.