Retained Variables

Retained variables enable separate instances of a module to retain its value on disk between instantiations and VTS executions. This is an enhancement on the existing persistent variables (see Persistent Variables).

One application for Retained variables is for loading user settings; if the username changes, load all of the user's customized settings (i.e. set the instance name equal to username). In this way, you may use Retained variables like a database.

Note: With Retained variables, any parent instance name is inherited by all child modules. In the event that the parent's name is not defined, the application name will be used. Further, by default, all tags are launched with their name as the instance name, so you do not have to declare them.

The values for retained variables are stored in a special directory named, "Retained" that exists within your application directory. The files containing the retained variable values have the extension ".VAL".

Topics in this section:

Declaring Retained Variables

Assigning Names to Module Instances

Retained Variable Value Storage

Retained Variables and Statically Declared Arrays