Configuring databases
A new database configuration can be added via the command Add New Database in the context menu of a Database Server project or via the corresponding command in the toolbar.
A new database configuration is added in the form of a file in the project folder and integrated in the project. As with all Visual Studio projects, the information on the new files is stored in the Connectivity project.
The new database configuration in the TwinCAT Database Server project can be edited via the Properties window or a special editor:
The properties dynamically adapt to the selected database types, since the databases have different parameters. These settings relate to the file contents, not the file properties.
Editor for database configurations
The database ID, which is required for some function blocks in the PLC, is shown in the upper part of the editor (1). The database types of the target database can be selected from the drop-down menu (2). Another option is the ODBC interface for a database, although this is not yet supported. Note that not all functions of the TwinCAT Database Server can be guaranteed, depending on the database.
As a further option you can select a so-called failover database (3), which is triggered when an error is encountered in Configure mode. In the event of a network disconnection, this feature can automatically ensure that data are stored elsewhere and not lost.
For each database additional adjustable parameters are available. Depending on the database a connection string (5) is created, which describes the connection to the database. The intention is to make the parameters you have set more transparent.
The CREATE (4) button can be used to create a new database. This function is only displayed if the respective database supports it.
Unknown databases can be configured via an ODBC interface. In the ODBC Type drop-down list select "Unknown Database" and add parameters via the commands in the context menu. They may contain passwords, which are stored in encrypted form. The required connection string can be assembled from these parameters. Note that only limited functions of the TwinCAT Database Server can be used. Only the explicit function blocks of the SQL Expert mode are supported.
The additional parameters can only be applied via the editor, not via the Properties window.
Copying a database configuration into the database pool
A corresponding command is available in the context menu for copying a database configuration into the database pool. It is also possible to use drag & drop to move database configurations between the project and the database pool.
Deactivating database configurations
Individual database configurations can be disabled in the project. These are then marked in red and ignored when the project is activated.