Tag Template Module Structure

A tag template module must be configured with a set of formal parameters that will correspond one-for-one to the fields of a table in the tag properties database. For example, the parameters of the built-in analog input tag type correspond to the fields of the AnalogInput table in the tag properties database ("Points.mdb").

 

Parameters Section:

The first three parameters, Name, Area and Description are mandatory and must be as shown in the template.  The first parameter, Name, must be the first parameter in the list.  The others may be entered in any order, but it is recommended that the standard order of Name, Area and Description be maintained.

Several more parameters are not mandatory, but are common (Address, ManualValue, Questionable...) therefore examples are included in the template. 

You may define more parameters as needed.

Parameters are defined as shown in the following example:

IODevice  <:TagField("SQL_VARCHAR(255)", "I/O Device Name", 3 ):>

where

“IODevice”     is a parameter definition

<:  :>                    is the MetaData operator

TagField is a structure with three pieces of data:

•      The SQL data type in the database.  The data type should match a list of standard names (see list below). Config.ini contains a block translating the standard data type names to the actual data type names used by your ODBC compliant database program. This field is mandatory.

•      The name of the field to be created in the database. This is required only if the field name will differ from the parameter name. If not provided, then the field name in the database will be the same as the parameter definition.

•      The column number of the field if required for a legacy application.  This parameter is not required if the application is created in version 8.0 (or later) and will only be run in version 8.0 (or later). Defaults to the first unused index number, starting from 0.

Note that Field Names might have spaces, as shown in the above example, while Parameter Names cannot.

The available SQL data types are as follows:

•      SQL_BIT

•      SQL_TINYINT

•      SQL_BIGINT

•      SQL_LONGVARBINARY=

•      SQL_VARBINARY

•      SQL_BINARY

•      SQL_LONGVARCHAR

•      SQL_UNKNOWN_TYPE

•      SQL_CHAR

•      SQL_NUMERIC

•      SQL_DECIMAL

•      SQL_INTEGER

•      SQL_SMALLINT

•      SQL_FLOAT

•      SQL_REAL

•      SQL_DOUBLE

•      SQL_DATE

•      SQL_TIME

•      SQL_TIMESTAMP

•      SQL_VARCHAR