The format file defines the import/export/linking
rules. The file maps columns from the external data source format
to the internal CitectSCADA
database format. In other words, it determines what information is
imported/exported/linked and how this information is modified
during the operation.
The format file also provides the information to
allow CitectSCADA to use
the correct driver for accessing the external data source.
Some format files are provided with CitectSCADA; however, sometimes you
might need to write or modify a format file using an editor such as
Microsoft Notepad.
Following is an example of how format file rules
work. (For more information, see Format file layout.)
Column 3 in the external data
source needs to be copied into the "Name" column in the
CitectSCADA's tag database.
(CitectSCADA names are
restricted to alphanumeric characters (a to z, A to Z, and 0 to 9)
and the underscore character "_", but this is not typically a
consideration in the format file; CitectSCADA does the conversion
automatically). However, if Column 3 in the external data source
happens to be blank, there is no need to copy this record across
(it needs to be rejected).
Column 1 in the external data
source needs to be copied straight into the "Addr" column in
CitectSCADA's tag database,
because they both mean exactly the same thing.
Columns 4, 5, 6, and 7 in the
external data source need to be copied into the "Comment" column in
Variable.DBF. (It is not uncommon for external data sources to
split the comments across several fields). The fields need to be
copied in that order, so that if the data in Column 4 in the
external data source is "Loop", Column 5 is
"1", Column 6 is "Process", and Column 7 is "variable", these fields are copied across in order, so
that the "Comment" column in Variable.DBF reads "Loop 1 Process variable". This process is called
'concatenation'. (For the "Comment" column, CitectSCADA automatically adds a space
between each field from the external data source.)
The data in Column 1 in the
external data source determines what CitectSCADA needs to write in the
"Type" column. However the data cannot be copied across directly,
because it would not make sense to CitectSCADA. Instead, it needs to go
through a conversion (or filtering) process. This conversion needs
its own set of rules, such as:
If Column 1 in the external data
source is "BT%d:%d.%d" (where%d means "any decimal number"),
CitectSCADA needs to write
the string "DIGITAL" in the "Type" column.
If Column 1 in the external data
source is "F%d:%d/%d" (where %d means "any decimal number"),
CitectSCADA needs to write
the string "DIGITAL" in the "Type" column.
If Column 1 in the external data
source is "O:%e" (where %e means "any octal number"; that is, every
digit from 0 to 7), CitectSCADA
needs to leave the "Type" column blank. It still accepts the record
(provided other columns pass any filtering tests) but it does not
write anything in the "Type" column. The assumption is that
CitectSCADA currently does
not have (or does not need) a suitable corresponding type.
If Column 1 in the external data
source is "PD%d:%d.%d", CitectSCADA needs to write the string
"REAL" in the "Type" column.
If Column 1 in the external data
source is "ST%d:%d", CitectSCADA needs to write the string
"STRING" in the "Type" column.
If there are no rules covering
the contents of Column 1 in the external data source, CitectSCADA
needs to reject the whole record and not copy it into the
CitectSCADA database.