An important consideration when designing a tag in InduSoft Web Studio HMI projects is what type of data the tag will receive. Indusoft Web Studio 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.
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:
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).