Copy Custom Tag Types to Other Applications

Having created a custom tag type, you may want to use it in another application. By far the best way to do this is through the use of application layers, where one application is built on another, thereby inheriting all of the custom features of the first (OEM) layer.  (See: Reusable Object Layers from the VTScada documentation.)

There may be cases where you need to share a custom tag type between applications that for some reason cannot share a common layer.  A common scenario is a Systems Integrator creating a type for a specific project, then deciding to add that type to an OEM layer so that it can be reused in many projects.

The process is a bit advanced and does require a bit of file editing, but most developers shouldn’t have trouble with it. The result will be that you will copy the definition template for the type, but no instances of the tag. The example images within the steps are taken from the Completed Tutorial, included with every copy of VTScada, and show the custom tag HoldingTank being copied to a new application.

To copy a custom tag type definition from application A to application B (where A is the CompletedTutorial in this example):

  1. Find the source file that defines the tag.
    This will be a .SRC file with the same name as the tag, stored in the application’s main folder.
  2. Copy that file to the main folder of application B.

Note: Steps 3 through 6 apply only if the custom type includes child tags, which is usually the case. If it does not, proceed to step 7.

  1. Ensure that application B’s folder structure includes a folder named “ChildTags.” If not, create that folder now.  Note that “ChildTags” is one word.
  2. Open the ChildTags folder of application A.
  3. Find the sub-folder that has the same name as the tag type.
  4. Copy that entire sub-folder to the ChildTags folder of application B.
  5. Return to the main folder of application A.
  6. Using an ASCII text editor that does not add formatting, open the file AppRoot.SRC.
  7. Scroll to the section labeled [ (POINTS).
  8. Copy the line that declares the tag type.
  9. Open the AppRoot.SRC file of application B.
  10. Paste the line into the [ (POINTS) section of that file.
  11. Save your changes.
  12. In the VAM, click the Import File Changes button for application B, then follow the steps to import the files and recompile. (The number of files to be imported will vary.)

That should do it. Your custom tag type should be available for use in application B.  Note that custom tags may include other custom tags, some of which may have been defined in an OEM layer. If so, this procedure must be followed for all.

About the Author:  Andrew Harvie is the technical writer and lead trainer at Trihedral Engineering. His background includes engineering, programming, database administration, and extensive experience developing and teaching technical courses. Outside of work, he enjoys time in his woodworking workshop, managing his woodlot, and learning to play the Celtic harp.

Photo credit of Robert Calnen (