AppMod.src Root File for a Standard Application

 The AppMod.src file for a script application differs from that of a VTS-based application. You can find information about the The AppMod.src file for a script application in the topic,  Interpreting the AppMod.src File for a Script Application.

In a standard application, the AppMod.src file is the root file for your application. AppMod.src contains no code; rather it identifies the top-level variables and modules for your application, and enables you to define different types of modules. The content of a typical AppMod.src root file for a VTS application is displayed below.

[

  Constant POINTS       = 0x0002 { Tag template class };

  Constant GROUPS       = 0xFF00 { Collections of tag types };

  Constant LIBRARIES    = 0xFF01 { Library class module};

  Constant GRAPHICS     = 0xFF02 { Shared drawing methods for tags };

  Constant PAGES        = 0xFF03 { Graphic pages & dialogs };

  Constant SERVICES     = 0xFF04 { Service class     };

  Constant PLUGINS      = 0xFF05 { Plug in modules   };

  Constant CONTRIBUTORS = 0xFF05 { Class of modules that plug-in to

                                   us };

  Constant PRIORITYSTART = 0xFF06 { Items that are pre-started };

  Constant TSERVICES     = 0xFF07 { Threaded service class};

  Constant CHILDREN      = 0xFF08 { Child tags class };

  Constant CONTAINERS    = 0xFF09 { Class of modules that we plug in

                                    to };

  Constant NETWORKVALUE  = 0xFF0A { Class for NetworkValues module};

  Constant SESSIONSTART  = 0xFF0B { Modules started with each

                                     DisplayManager session  };

  Constant TEST          = 0xFF0C { Automated test     };

  Constant FIXTURE      = 0xFF0D { Test fixture for automated test };

  Constant DBTRACETRIGGER = 0XFF0E { Triggers for SQL based traces };

  Constant API           = 0xFF0F { API Variable Class };

  Constant WAPHANDLER    = 0XFF10 { WAP container modules };

  Constant PAGEHOSTWIN   = 0XFF11 { Window hosting draw-able page };

 

  [ (65282)

    TAB Module "TAB.SRC";

  ]

 

  { Tag parameter metadata structure. You must uncomment this structure if you have created a VTS 8.0+ style tag in order for your code to compile. }

  {TagField Struct [

    Type;

    Name;

    Index;

  ];}

 

  [ (POINTS)        {== Modules that are point templates ====}

    { NOTE: You must uncomment the above TagField structure

            declaration if you are adding a VTS 8.0+ style tag. }

  ]

 

  [ (GROUPS)   {== Modules that are collections of point types ==}

  ]

 

  [ (LIBRARIES) {=== Modules that contain library objects ===}

  ]

 

  [ (GRAPHICS) { Modules that are shared drawing methods for points }

  ]

 

  [ (PAGES)    {== Modules that are graphic pages and dialogs ===}

    Overview Module "Pages\Overview.SRC";

  ]

 

  [ (SERVICES) {== Modules that are services that are started ===}

  ]

 

  [ (PLUGINS)  {== Modules added to other base system modules ===}

  ]

 

  [ (PRIORITYSTART) {== Modules/variables that are to be

                        pre-started ====}

  ]

 

  [ (TSERVICES)  {=== Modules that are threaded services to run ==}

  ]

]

Constants in AppMod.src

A series of constants are declared at the top of the AppMod.src root file. These are also defined within the VTS module contained within the base VTS system, although the names may be slightly different (see Constants in the Base VTS System).  When adding new modules to an application, you should declare those modules in the appropriate class within AppMod.SRC.

The constants are:

      The POINTS constant identifies the class of modules that are tag types.

      The GROUPS constant identifies the class of modules that are tag groups. These are collections of tag types based on a specific characteristic (e.g. the "Analogs" tag group consists of the analog input and analog output tag types).

      The LIBRARIES constant identifies the class of modules that are libraries. Libraries are used for custom tools for your application. Examples of library include the Alarm Tools and the Modem Tool libraries that are included with VTS.

      The GRAPHICS constant identifies the class of modules that are shared tag drawing methods. An example of a tag drawing method is the Top Bar or Meter drawing method.

      The PAGES constant identifies the class of modules that are graphic pages and dialogs.

      The SERVICES constant identifies the class of modules that are services for your application. For example, the Modem Manager is a service, as is the Alarm Manager.

      The PLUGINS constant identifies the class of modules that are specialized plug-ins for your application. A plug-in module is one that is dynamically added to a tag or other module at runtime.

      The PRIORITYSTART constant identifies the class of modules that should be pre-started.

      The TSERVICES constant identifies the class of modules that are threaded services.

      The CHILDREN constant identifies the class of modules that are child tags.

Each of these constants has a specific value. For example, the POINTS constant has a value of 0x0002.

Variable Classes in AppMod.src

Following the constant declarations is a series of variable classes. Each variable class is listed within a block beginning with an opening square bracket ("["), followed by the name of the constant defining the variable class's range in parenthesis ("(POINTS)"), and ending with a closing square bracket ("]"). All modules and variables within such a block have the same class. Variables and modules defined in AppMod.src are placed in the running VTS application according to their class.

As an example, the PAGES variable class lists one module that contains the code for a system page for this application.

[ (PAGES) {=== Modules that are graphic pages and dialogs ===} 

    Page1 Module "Pages\Page1.SRC"; 

This code declares the module name ("Page1"), and the (relative) path and file name of the source file for the system page ("Pages\Page1.SRC").

The variable classes in AppMod.src are as follows:

      The POINTS section is where you should declare any modules that are custom tag types.

      The GROUPS section defines a list of modules that make up tag groups. A tag group is a set of tag types that share a common characteristic. For example, the Numeric tag group consists of all tags that have a numeric value, whereas the Drivers tag group consists of all tags that are I/O device drivers. A tag type may belong to multiple groups. For example, an analog input tag belongs to the Analogs tag group and the Numeric tag group. The group module is started at load time, and contains a variable list with class POINTS. These variables are the same name as the POINTS modules that are part of that group. The tag module itself may define the tag groups to which it belongs by specifying a shared variable that has a class of GROUPS. If the custom OEM layer or application directories define a group module with the same name, the contents of the group are merged, rather than replaced.

      The LIBRARIES section defines a list of modules that contain custom library objects. Custom library objects are typically tools that can be used to develop your graphic screens. VTS contains several custom libraries, such as the Alarm Tools Library, and the Modem Tools library.

      The modules defined in the GRAPHICS section are the tag drawing method modules. These modules may be shared by different tag types. For example, analog inputs and analog outputs both share the Top Bar drawing method. This is done by specifying a shared variable of class GRAPHICS in the tag module. Additionally, the graphics modules themselves may contain variables of type POINTS, which are the names of the tag modules to which the graphic module should be attached. These variables should also be shared for RAM efficiency. This second method allows the user to add new drawing modules to existing tags without any modifications to the basic tag code. Please refer to External Tag Drawing Method Modules for further information on external tag drawing method modules.

      The PAGES section contains a reference to those modules that are page or dialog modules for your application.

      The SERVICES section contains a list of modules that are custom services to be started for your application. An example of a service already built into VTS is the Modem Manager or the Alarm Manager.

      The PLUGINS section references modules that are added to other modules at runtime. This section is typically used to define ConfigFolder (tag properties folder module) and Common modules for tags so that they may be customized for a particular application (i.e. the user may define their own custom versions of the ConfigFolder and Common modules). A tag specifies the plug-in module to use by creating a shared variable of class PLUGINS, with its default value set to the name of the module. The alternative is to let the plug-in specify the module to which it should attach itself to by specifying shared variables with a class of PLUGINS in the plug-in module. If present, the default value for these shared variables specifies the name of the plug-in module within the host module. The name of the shared variable specifies the name of the host module to which the plug-in is to be added. Please refer to External Plug-in Modules for further information on external plug-in modules.

      The PRIORITYSTART module is a list of modules that are to be pre-started. This class may also include variable definitions.

      The TSERVICES module is a list of service modules that should execute in their own separate threads when started.

You may modify the AppMod.src file in your application's directory. It should be noted that an AppMod.src template file (used to generate the new AppMod.src root file for every new VTS application you create) exists within a Template directory within the VTS layer directory. You should never modify this file.

Adding a variable or module definition to one of the variable classes of the AppMod.src file in your application directory will result in it being included in the running VTS application Code module (see VTS Application Module Organization). Each time you make a modification to the AppMod.src file for your application, you must recompile it before your modifications are recognized by the system.

Topics in this section:

Base VTS System Module Access

Display Manager Module

Page Modules