CODESYS
For CODESYS, SQL4automation provides two sample projects: one for CODESYS V2 and one for CODESYS V3 controllers. SQL4CODESYS can be directly integrated as a library and runs on all CODESYS controllers that support SysSocket.lib (V3) or SysLibSockets.lib (V2) and are equipped with an Ethernet interface.
Connecting CODESYS PLC to SQL Databases, MES, ERP
For CODESYS, SQL4automation provides two sample projects: one for CODESYS V2 and one for CODESYS V3 controllers. SQL4CODESYS can be directly integrated as a library. It runs on all CODESYS controllers that support SysSocket.lib (V3) or SysLibSockets.lib (V2) and are equipped with an Ethernet interface, covering a wide ecosystem of controllers from Wago, Bosch Rexroth, Festo, KEBA, and many others.
Integration of the SQL4CODESYS Library
The SQL4CODESYS library receives parameters such as the IP address and port of the Connector as well as the SQL string. The return values of the SQL query are written to the two-dimensional string array ptTableValues (V2) or returned via the stResult structure (V3). The library is imported directly into the CODESYS project and requires no modifications to the runtime or operating system.

SQL4automation Link Settings
The SQL4automation Connector is operated with the target setting "Standard" for CODESYS controllers. The configuration is completed in just a few clicks. Detailed integration instructions are available in the download section.

FAQ's
Freuqently Asked Questions to CODESYS
Which CODESYS runtime versions does SQL4automation support?
SQL4automation supports both CODESYS V2 and CODESYS V3. For V3, the controller must support SysSocket.lib and run CODESYS 3.5.11.0 or newer, along with the required standard libraries (Memory, Network, Standard, SysMem, SysTypes2 Interfaces). For V2, SysLibSockets.lib is required. Both versions include sample projects and require an Ethernet interface on the controller.
Can SQL4automation connect a Wago PLC to a SQL database?
Yes. SQL4automation has been tested and verified on Wago 750-885, 750-841, I/O-IPC, Speedway, and PFC100/200 series controllers. All run CODESYS and support the required socket library. The SQL4CODESYS library integrates directly into the Wago project without any additional runtime components.
Does SQL4automation work with CODESYS-based controllers from third-party manufacturers?
Yes. SQL4automation is compatible with any CODESYS-based controller that supports the standard CODESYS socket libraries and has an Ethernet interface. This covers Bosch Rexroth, Wago, Festo, KEBA, Solvimus, Kendrion Kuhnke, and many more. If your controller is not listed, contact us for compatibility verification.
How are SQL query results returned to the CODESYS program?
In CODESYS V2, results are written to the global two-dimensional string array saTableValues (rows x columns). In CODESYS V3, results are accessed via the stResult structure and the GetData() / GetColumnName() methods. Row and column indices are 0-based. No parsing, no serialisation, and no custom protocol implementation is required.
Does SQL4automation support TLS encrypted communication for CODESYS?
Yes, for CODESYS V3 using the Version 5 library and Connector V5.1.0.0 or newer. Encryption is enabled by setting xTlsEnable = TRUE and providing the certificate common name, use case, and TLS version (1.3). Certificates are installed via the CODESYS Security Screen. Always commission and test the connection without encryption first.
With which CODESYS PLCs has the SQL4CODESYS library been tested successfully?
CODESYS SP PLC WinNT, CODESYS SP RTE, CODESYS Control Win SL, CODESYS Control RTE SL, Bosch Rexroth L20, Bosch,,, Rexroth L25, Wago 750-885, Wago 750-841, Wago I/O-IPC, Wago Speedway, Wago PFC100/200, KEBA CP-242, Solvimus auvis.box, Festo CPX, Festo CEC, Kendrion Kuhnke FIO Controller 113
Technical Data
Switch to SQL4automation Now.
Connect industrial controllers directly with SQL databases. Field-proven since 2007 for maximum performance and security, completely without middleware.