Overview
The TwinCAT Database Server enables data exchange between the TwinCAT System and different database systems. For smaller applications you can use the server over a configurator without influencing the existing program code. For complex tasks and a maximum of flexibility the Database Server offers a detailed library of PLC function blocks. Directly out of the PLC you can use SQL-commands like Insert and Select. If necessary, you can relieve the PLC by calling up Stored Procedures in the database. The transferred parameters from the PLC function block will be used from the database in connection with the stored procedure and results will be returned to the controller.
Now the TwinCAT Database Server CE supports five different database systems: MS SQL, MS SQL Compact, MySQL, ASCII (e.g. .txt or .csv) as well as XML files.
Components
- TwinCAT Database Server: a service which starts and stops along with TwinCAT. It is a connector between the TwinCAT system and the database.
- Configurator: The TwinCAT Database Server configurator enables an easy visual setting of database parameters, which are necessary for the basic communication with the respective database.
- PLC library: the PLC library offers several function blocks to generate a database connection or a new chart. Furthermore, you can write data into any chart structures with Insert-commands or read them through Select-commands. It is also possible to update or delete database entries. Stored procedures can be activated.
Functional principle
The Database Server communicates over ADS within the TwinCAT system. Outwards the server connects with the respective database. Possible network topologies can be found here.