omron — Using Indirect Tags

About Tags and the Project Database About indirect tags IWS supports indirect access to tags in the database. For example, consider a tag X of the String type. This tag can hold the name of any other tag in the database (that is, it can provide a pointer to any other type of tag, including a class type). The syntax for an indirect tag is straightforward: @ IndirectTagName . For example, assume that a tag named X holds a " TEMP " string. Reading and/or writing to @ X provides access to the value of the TEMP variable. Note: Any tag created as a string-type tag is potentially an indirect tag (pointer). To refer to a class-type tag, you can declare a string-type tag that points to a class tag.

For example: To access the TK.Level value, you must store the " TK.Level " value within the XCLASS tag and use the syntax, @XCLASS . You can also refer to a member of a class-type tag directly; identifying a class-type that points to a class member. For example: To access the TK.Level value, you must store the " TK " value within the XCLASS tag and use the syntax, @XCLASS.Level . When creating tags for indirect use, place an @ in the tag column rather than creating them as strings. For the type, write the type of tag for which you are creating a reference. Follow the XCLASS example: @Z Integer , @X Class:TANK .

Indirect Tags Indirect tags "point" to other database tags (including class-type tags). Using indirect tags can save development time because they keep you from having to create duplicate tags (and the logic built into them). You create an indirect tag from any string-type tag simply by typing the @ symbol in front of the tag name @ TagName . • To reference a simple tag, assume the strX tag (a string tag) holds the value "Tank" , which is the name of another tag, then reading from or writing to @strX provides access to the value of the Tank tag. • To reference a class-type tag and member, you simply create a string tag that points to the class tag and the member.

For example, if a tag strX (a string tag) holds the value "Tank.Level" , which is the name of the class tag, then reading from or writing to @strX provides access to the value of the Tank.Level member. • You can also point directly to a class-type tag member; by identifying a class-type that points to a class member. For example: to access the Tank.Level member of the class, you must store the "Tank" value within the strX tag and use the syntax, @strX.Level . Page 53 Class TANK with members Level Tag TK of the class TANK Tag XCLASS Class TANK with members Level Tag TK of the class TANK Tag XCLASS of the class TANK