A module instance is a running copy of a module. Every time a module is actively called (used as a function or statement in an active state), another instance is started. You may think of a module as a template for a program (the source code), and an instance as a running copy of that program.
Modules may run more than one instance at a time. Each instance is a different object in the system called with different parameters, and returning different values. Each instance may have a different active state, and all local variables may have different values. In some cases, this will not be acceptable, and instead of local variables, shared variables will be defined.
An example of this is a system with multiple copies of a chemical tank module running, each with its own data producing its own characteristics. Also there may be a module which displays an operator input dialog box which is started only when required. Module instances can be stopped and started at will.
A module instance is slightly different from a conventional subroutine. You can have multiple module instances running concurrently, but a subroutine starts, runs, and stops every time it is called.
It should be noted that VTS provides utilities to assist you determining the number of instances of modules running in your applications. The Instances utility (see Instances Application) supplies a list of the separate threads of execution for which VTS is responsible within a local application.