Tags and the Project Database • If IndexTag is less than 0, then MyArray[ IndexTag ] will point to the start position of the array (i.e., MyArray[0] ). 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 . Choosing the Tag Data Type Another consideration when designing a tag is what type of data the tag will receive. IWS recognizes the following, standard tag data types : • Boolean ( one bit ): Simple boolean with the possible values of 0 (false) and 1 (true). Equivalent to the "bool" data type in C++. Typically used for turning objects off and on or for closing and opening objects. • Integer ( four bytes ): Integer number (positive, negative, or zero) internally stored as a signed 32-bit. Equivalent to the "signed long int" data type in C++.
Typically used for counting whole numbers or setting whole number values. Examples: 0 , 5 , #200 . • Real ( floating point, eight bytes ): Real number that is stored internally as a signed 64-bit. Equivalent to the "double" data type in C++. Typically used for measurements or for decimal or fractional values. • String ( alphanumeric data, up to 1024 characters ): Character string up to 1024 characters that holds letters, numbers, or special characters. Supports both ASCII and UNICODE characters. Examples: Recipe product X123 , 01/01/90 , *** On *** . You can also make a tag into a compound tag by assigning it a Class .
A Class is a template consisting of two or more tag definitions, each with its own data type. You can use Classes in projects that have items (e.g., tanks of liquid) with multiple attributes (e.g., fill level, temperature, pressure) to be monitored or controlled. You can find these tag types (and their respective icons) in the Global tab of the Project Explorer . See also : Understanding Tag Properties and Parameters Changing How Boolean Tags Receive Numeric Values By default, if any numeric value other than 0 (i.e., ≠0) is written to a Boolean tag, then the tag automatically assumes a value of 1.
You can change this behavior, if necessary, by editing the project_name .app file to change the following setting: [Options] BooleanTrueAboveZero= value If BooleanTrueAboveZero is set to the default 0 , then the project will behave as described above. If BooleanTrueAboveZero is set to 1 , then the project will behave as follows: • When you write any numeric value less than or equal to 0 (i.e., ≤0) to a Boolean tag, the tag assumes a value of 0 (false). • When you write any numeric value greater than 0 (i.e., >0) to a Boolean tag, the tag assumes a value of 1 (true). Caution: This is a global runtime setting.
If you only want to change how certain tags are handled, then you should not change this setting. Page 112 InduSoft Web Studio