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.
- On the explorer bar, selectLibrary.
- InLibrary, select the Add-On Instruction and then in theLibrarytitle bar, selectViewtags and parameters: (name).
- In the last row of the Tag Editor, selectAdd Tag. A new row appears.
- InName, type the name of the tag or program parameter.
- InData Type,type the name of the data type until the data type appears or browse to openSelect Data Type, select the data type, and then selectApply.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.
- InUsage, accept LOCAL as the default usage type.
- InDefault 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.
- (optional) InStyle, 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.
- (optional) InDescription, enter a maximum of 512 characters to indicate the purpose of the tag or the latest change to the tag.
- Repeat steps 3 through 9 to add another local tag.
Provide Feedback