Reference Guide
Reference Guide
Reference Guide

Database to Tag Converter

The Database to Tag Converter utility (dbtotag.ma) is used to convert data records from an external database, which is linked to the active design file, into tag data. A database must first be attached and properly linked to existing elements in the active design file.

Once DBTOTAG is properly configured, it performs three operations:

  1. Creates a tag set definition in a type 66 element (required)

  2. Loads the tag data into the design file and links it to the graphical elements. (optional)

  3. Displays tag data values near the associated graphic element. (optional)

To start the conversion process, you first need to be in an active design file with a valid database attached.

The first step in any conversion process is to select the source data. This includes selecting a database table in the Database Tables list and transferring or Adding it to the Import Tables list.

To start the conversion process
  1. Key in IMPORT DATABASE.
    The Database to Tag dialog box displays.

    Database to Tag dialog box

      

To select the source data
  1. Select a database table entry for import.

  2. Click the Add button.
    DBTOTAG places the table name in the Import Tables list.
    Repeat this process for any database tables attached to the design file.

To select individual data fields to import
  1. Highlight the appropriate dataset on the Import Tables list.

  2. Click the Details button.
    The Column Details dialog box is displayed for the selected dataset.

Importing the information

Once all of the data fields have been adjusted for each data column to be imported, all that remains is the import process itself. Selecting the Import button from the Database to Tag dialog box starts this process.

DBTOTAG creates a tag element (type: 66) for each dataset selected. Into this element, the selected data field definitions are created and loaded with the table definitions from the external database. The data from each column in the database is copied into a tag element (type: 37). A link between each tag data field and the graphic elements of the design file is performed. Finally, if any data fields were selected as displayable, the displayable attribute of the tag element is enabled, and the data is displayed near the associated graphic element.

After the conversion process is complete, the design file will still be attached and linked to the original database. You must perform further database maintenance to truly eliminate this connection to the external database.

Once a tag set has been created it cannot be accessed by dbtotag. You can, however, change the displayability on any loaded tag data as part of the normal tag process.

You can delete an entire tag set from your design file using the Tag Set Settings Dialog Box. Just select the tag set name from the Tag Set list and hit the delete button. An alert window displays to warn you that this function deletes all tag data. If this is correct then hit the OK button. It is always a good idea to perform a Compress operation on the design file after deleting a tag set.

Database to Tag dialog box

This dialog box consists of two scrollable fields separated by key action buttons. When the external database is attached to the active design file, one or more entries appear in the Database Tables list.

An empty Database Tables field indicates that no database is currently attached to the active design file. Select the Cancel button, attach the database, and restart DBTOTAG using the Import Database command. You can use the DB= key-in to attach the appropriate database.

DBTOTAG shows only those data tables found in the current MSCATALOG table.

Database Tables

Contains names of the data tables if an external database is attached to the active design file. If no entries appear in the list box, a database needs to be appropriately attached.

Import Tables

Lists the name of the source data tables added from the Database Tables list box.

Add

Click to move an entry from the Database Tables list box to the Import Tables list box to select a data set.

Remove

Click to remove an entry from the Import Tables list box.

The Remove button is provided to reverse the Add process should you accidentally select a database table entry that you do not want to convert.

Once a dataset has been chosen in the Database to Tag dialog box, you must select the data fields within that dataset you wish to import, and indicate how you want this data imported.

Details

Opens the Column Details dialog box which lists the data fields and type of data available to load.

Import

Starts the database to tag conversion after the data fields are set up in the Column Details dialog box.

Column Details dialog box

Used to set up the data fields for database to tag conversion.

Name

Lists the name of the data field.

Type

Lists the type of data.

Add to set

Click to create a tag data definition for the highlighted data selection.

Attach

Click to load all data associated with the highlighted field into the design file's Tag Data set and link it to the appropriate graphic elements.

Display

Click to display the text of the loaded data.

OK

Saves the selected fields and settings and closes the dialog box.

Cancel

Closes the dialog box without saving the data.

Each action is dependent on the previous selection. This means you cannot select the Attach option unless you have already selected the Add to Set option. The same goes for the Display option which requires the selection of the Attach option.

By unchecking the Add to Set option the selected data column will not be imported into the tag data set.

By default, DBTOTAG creates a tag definition and loads its data for every data field found in the source dataset. In most cases, you will want to adjust the data fields to eliminate unneeded data. Keep in mind that your design file will expand in size to accommodate the new tag data so paring down the initial set of data is important.