Invalid Values

In addition to having normal valid values, variables can also be invalid. An invalid value is an unknown value that is distinct from all other values; they guard the system from performing control action based upon erroneous or bad information. Any variable may have an invalid value.

Any calculation that uses an invalid value produces an invalid result (with a few exceptions). Invalid results are not written to output devices. In addition, any graphic statements that contain invalid variables will not produce any output on the screen. In general, any function which uses an invalid value will have no effect and behave as if it did not exist.

Invalid values may result from variables which are not set to any given value - this is true when VTS is first starting up. They can also result from setting a variable's value in two or more different statements at the same time; in this situation it is uncertain which value is correct, so the variable will be invalid even if both values are the same. This is known as a "double set". An array reference that has one of its subscripts out of range will have an invalid value. Some programmable controllers flag inputs when they are out of range - when these values are read by VTS, they are declared to be invalid. Division by 0, taking the square root or logarithm of a negative number, and other illegal mathematical operations result in invalid results. An invalid value can even be purposely set as such by using the Invalid function.

Because calculations using invalid values produce invalid results, invalid values can propagate through the system. The setting of a variable to invalid will cause all other variables that depend upon its value either directly or indirectly to become invalid.