The running VTS application has two main components:
• The Database
• The Code.
Database Component
The tag database is at the root of the VTS application. The tag database contains all of the tags for your application (i.e. all the tag type instances – e.g. "AI20_1", "DO_10_3", etc.). Each instance of a tag type (in other words, each tag) is actually a simple variable that is added to the application when the tag properties database ("Points.mdb") is read. There is a one-to-one correspondence between these tag type variable names, and the names of the tags in the tag properties database; the name given each tag instance is used as the name of its corresponding variable.
For example, if the tag's name in the tag properties database is "AI20_1", then the name of the tag's variable in the code is "AI20_1".
Code Component
Where the database contains variables corresponding to the tag instances in your application, the Code module contains variables corresponding to the tag types in your application (e.g. AnalogInput, and DigitalOutput).
Note: the use of the word “Code” may cause confusion here. “code” in lower case may refer to functions, states, modules or any set of programming instructions in general. VTS also contains a module named “Code” that has very special features. We are referring that module to here.
The Code module is built dynamically and contains a number of constants and variables Some of these variables behave almost exactly like modules, and can be called like modules when resolved-to in scope, but there is a fundamental difference. (see note)
Note: Tag modules referenced in Code are actually variables that contain module values, rather than modules themselves. You can see this subtle distinction in the VTS debugger, which lists the names of such module instances as "System", rather than the expected module name.
One reason that the Code module is important to be aware of is that contains a number of features that will be useful to your scripting efforts. The following sections describe several of these.
Topics in this section:
Standard Code Module
Variables Related to Application Appearance
Constants in the Base VTS System