Using CitectSCADA > Linking, Importing, and Exporting Tags > Exporting tags > Recognizing format files

Recognizing format files

Your format file needs to be saved to the config folder of the CitectSCADA User and Data folder selected during installation.

For CitectSCADA to import, export, or link, it needs to know the name of the format file and the name of the driver that will access the external data source. It also needs the text of the string that will appear in the Database type field of the Import or Export dialog box. This information is stored in another file, called tagdriv.ini, in the same directory.

The format of tagdriv.ini is simple and based on the odbc.ini format. When it is installed it already has the necessary information for the format files and drivers that come shipped with CitectSCADA. You just need to copy the same layout for your new format file, and the driver that you are using.

The tagdriv.ini file has several sections. The first section is the [External data sources] section, with the following general layout:

[External data sources]
Section name 1
= the name you want to appear in the import/export/ link menu for entry 1
Section name 2
= the name you want to appear in the import/export/ link menu for entry 2
Section name nn = the name you want to appear in the import/export menu for entry nn

Each entry in this section refers to a combination of format file and driver necessary for a particular import, export, or link operation.

The text on the left of the "=" sign needs to refer to the name of another section which needs to appear in tagdriv.ini.

The text on the right of the "=" sign is exactly what will appear in the menu under "Database type" for importing, exporting or refreshing variable tags.

The other sections each refer to a type of import or export described in the [External data sources] section, and give details about the format file and driver pair. The general layout of these sections is as follows:

[Section name matching an entry in [External data sources] ]
driverid = Driver ID
datastring = The name of the format file
Currently the Driver ID is always CiTrans.

So if we assume that the version of CitectSCADA you are installing contains 4 format files, there would be 4 sections in tagdriv.ini, as shown in the following example:

; This file contains the driver name, driver prog id, and format file mappings
; The format file needs to reside in the BIN directory

[External data sources]
CSV = CSV Driver
Concept ver 2.1 Ascii = Concept Ver 2.1 ASCII file
MxChange = Mitsubishi FastLinx

driverid = CiTrans
datastring = csv.fmt

driverid = CiTrans
datastring = rslogic.fmt

[Concept ver 2.1 Ascii]
driverid = CiTrans
datastring = concept ver 2_1.fmt

driverid = CiTrans
datastring = MxChange.fmt

This adds 4 entries to the database type drop down menu: CSV, RSLOGIX, ASCII and Mitsubishi FastLinx.

The 4 entries in the menu match the strings on the right of the "=" sign in the [External data sources] section.

If you add another format file, you will also need to add a matching entry to tagdriv.ini. For example, if you add a new format file for a Simatic data source, you need to add a line similar to this to the [External data sources] section:

SIMATIC = Siemens SIMATIC Driver

You need to also add the following section to the bottom of the file:

driverid = CiTrans
datastring = SIMATIC.fmt

Save the file, restart Citect Explorer, and "Siemens SIMATIC Driver " appears in the menu.

Selecting this entry causes the format file in the datastring entry under the [SIMATIC] section to be used for the import, export, or link; that is, simatic.fmt.