MySQL database

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

Declaration in the TwinCAT Database Server Configurator

MySQL database

Database type

Select "MySQL" from the drop-down menu.

Server

Enter the name or IP address of your server here.

Database

Enter the name of the database. If the database does not yet exist, it can be created with the Create button. Corresponding permissions must exist.

Port

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

User name

Enter the user name here.

Password

Enter the corresponding password.

MySQL database 1:

Windows CE support

This database is also supported by the Windows CE version of the TwinCAT Database Server. The interfacing is not local, but can be established via a network connection.

The installation of the necessary components is not automatic and must be performed manually. To this end, additionally copy version 6.7.8.0 of the library "MySql.Data.CF.dll" into the TwinCAT Database Server folder of the CE device. (\Hard Disk\TwinCAT\Functions\TF6420-Database-Server\Server)

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

Drivers for "big Windows" systems

The used MySQLConnector is under MIT licence and under Copyright:

Copyright (c) 2016 Bradley Grainger

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

MySQL database 2:

Data type support

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

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.