Using ODBC Connection Strings to Connect to Fernhill SCADA

Help Contents

Some ODBC clients allow you to enter a connection string to define which ODBC data source to connect to. The connection string can also be used to configure optional behavior of the connection.

ODBC Connection String Syntax

An ODBC connection string uses the following syntax:

connection-string ::= attribute[;] | attribute; connection-string

attribute ::= attribute-keyword=[{]attribute-value[}]

attribute-keyword ::= identifier

attribute-value ::= character-string

Attribute values (attribute-value) can optionally be enclosed in braces {}. It is good practice to enclose attribute values that contain non-alphanumeric codes in braces.

Examples of Connection String

Examples of ODBC connection strings to connect to Fernhill SCADA:

1. To connect to Fernhill SCADA using a DSN called My Fernhill SCADA:

DSN=My Fernhill SCADA;SERVER=localhost;DESCRIPTION={Connection to "local" server};MAPTOVARCHAR=;UNSIGNED=TRUE

The attributes MAPTOVARCHAR and UNSIGNED in the connection string override the attributes configured in the DSN.

2. To connect to Fernhill SCADA without using a DSN:

Driver={Fernhill SCADA};Server=LocalHost;Description={Connection to Fernhill SCADA without a DSN!}

Supported ODBC Keywords

The Fernhill SCADA ODBC driver supports the following keywords:

KeywordDescription
Description Provides the description of the data connection.
Driver The name of the driver. The attribute value for Fernhill SCADA is "{Fernhill SCADA}".
Dsn The name of an existing data source.
FileDsn The name of an existing file data source.
LocalTime A boolean attribute that enables local time conversion. Fernhill SCADA works internally in UTC. The value of the LocalTime attribute tells the ODBC driver how to present date and time values to the user:
  • True: the ODBC driver will convert date and time values to local time.
  • False: the ODBC driver will present UTC date and time values to the client.
The default value is True.
MapToVarChar The set of types to map to VarChar. Some ODBC client programs do not support all of the ODBC types provided by Fernhill SCADA.
You can use this attribute to work around this problem by mapping the unsupported types to VarChar.
The attribute value takes the form of a comma separated list of IEC 61131-3 type names. For example:

MapToVarChar={TIME_OF_DAY,WSTRING}

See IEC 61131-3 Elementary Data Types for the list of type names allowed in this attribute.
Port The TCP port number to connect to. For Fernhill SCADA this is 20695.
Pwd The password for the user account set using the Uid keyword. Pwd will be ignored if Uid is not present.
SaveFile The name of a file where the connection string attributes will be written. The file is written only if the connection succeeds.
Server The name of the server to connect to. This can be a Netbios name, a fully qualified domain name, or an IP address.
Uid A valid user account on the computer running Fernhill SCADA. To indicate a domain account use the format: User@Domain. If Uid is not set, the connection will attempt to use Windows Integrated security to identify the user.
Unsigned A boolean attribute that tells the ODBC driver how to present unsigned data types to the client:
  • True: the ODBC driver reports unsigned data types as unsigned to the client.
  • False: the ODBC driver reports unsigned data types as signed to the client.
Some ODBC clients have limited support for unsigned types. Setting this attribute to False can help those clients interact with Fernhill SCADA.
The default value is False.

Further Information

Glossary

For the meaning of terms used in Fernhill SCADA.