MySQL

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

Declaration in the TwinCAT Database Server Configurator

ODBC MySQL database

Database Type

“Odbc_Database”

ODBC Type

Select "MySQL" from the drop-down menu.

Driver

Enter the actually installed driver.

Server

Enter the name or IP address of your server.

Database

Enter the name of the database.

Port

Enter the port for communicating with the MySQL database here. Default: 3306.

Option

Default: 2 “Return matched rows instead of affected rows”

Uid

Enter the user name.

Pwd

Enter the corresponding password.

Data type mapping between DB and PLC

E_ColumnTypes

MySQL

TwinCAT PLC

BigInt

BIGINT

T_ULARGE_INTEGER (TcUtilities.lib)

Integer

INT

DINT

SmallInt

SMALLINT

INT

TinyInt

TINYINT

SINT

Bit_

CHAR(1)

STRING

Money

DECIMAL(18,4)

LREAL

Float

DOUBLE

LREAL

Real_

FLOAT

REAL

DateTime

DATETIME

DT

NText

TEXT

STRING

NChar

CHAR

STRING

Image

BLOB

ARRAY OF BYTE

NVarChar

VARCHAR

STRING

Binary

BLOB

ARRAY OF BYTE

VarBinary

BLOB

ARRAY OF BYTE

MySQL 1:

Data type support

This database supports the data type WSTRING. (See WString support)

MySQL 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.