IBM DB2

This section contains information on the configuration and the data type mapping of IBM DB2 databases with ODBC.

Declaration in the TwinCAT Database Server Configurator

ODBC IBM DB2 database

Database Type

"Odbc_Database"

ODBC Type

Select "IBM DB2" from the drop-down menu.

Driver

Enter here the actually installed driver.

Host name

Enter the name or IP address of your server.

Database

Enter the name of the database.

Port

Enter the port for communicating with the IBM DB2 database. Default: 50000.

Protocol

Default: TCPIP

Uid

Enter the user name here.

Pwd

Enter here the corresponding password.

LONGDATACOMPAT

Default: 1

Data type mapping between DB and PLC

E_ColumnTypes

IBM DB2

TwinCAT PLC

BigInt

BIGINT

T_ULARGE_INTEGER (TcUtilities.lib)

Integer

INT

DINT

SmallInt

SMALLINT

INT

TinyInt

SMALLINT

INT

Bit_

VARCHAR(1)

STRING(1)

Money

DECIMAL(18,4)

LREAL

Float

DOUBLE PRECISION

LREAL

Real_

FLOAT

LREAL

DateTime

TIMESTAMP

DT

NText

LONG VARCHAR

STRING

NChar

CHAR(254)

STRING

Image

BLOB

ARRAY OF BYTE

NVarChar

NVARCHAR(254)

STRING

Binary

BLOB

ARRAY OF BYTE

VarBinary

BLOB

ARRAY OF BYTE

IBM DB2 1:

Data type support

WSTRING is not supported by this database. (See WString support)

IBM DB2 2:

Functioning

All functions of the TwinCAT Database Server can be applied to the ODBC templates. This does not apply to the "Free Connection String".

Notice

Data security

In flash memory devices the number of write access operations is limited. The flash memory devices can fail, with a risk of data loss.

  • Make regular backups of your system. Use the IPC diagnostics in order to determine the status of the flash memory devices.