You are on page 1of 3

SQL4CoDeSys

General information
Article number: 604100 Owner

Version: 3.5.2.0 Inasoft GmbH


Nassiweg 4
Abstract 3421 Lyssach
Switzerland
This library is useful to connect to SQL
databases. Support:
The function block “SQL4CoDeSysV3” +41 34 445 20 10
connects over TCP/IP to the software info@sql4automation.com
application SQL4automation. This www.sql4automation.com
application do the connection to any SQL
database.

System requirements and restrictions


Programming system CODESYS Development System
Version 3.5.0.0 or higher

Runtime system CODESYS Control Version 3.5.0.0 or higher

Supported OS RTE
WinCE
Linux
VxWorks
QNX
Windows XP/Vista/7
Additional requirements TCP/IP socket communication.

Restrictions -
CODESYS Store /

 3S-Smart Software Solutions GmbH Seite 1 von 3


Product description: SQL4CoDeSys
Overview
This library is useful to connect to SQL databases. The function block “SQL4CoDeSysV3”
connects over TCP/IP to the software application SQL4automation, henceforth simply called
"Connector ".
With this Connector, control systems get a direct access to SQL databases. With SQL
[Structured Query Language] it's possible to write data from the control to the database, to
read data from the database to the control and delete or change data in the database. Also
database procedures can be run. There is no OPC-Server necessary - that is advantageous
for performance and security. There are no project specific changes in the connector
software needful. All programming can be done in the PLC application code.
The Connector is a downloadable on www.sql4automation.com.

Technical functionality
This following basic circuit diagram shows a sequence of a database request.

DBConn : SQL4CoDeSysV3 ;

DBConn.sIPAddress := `192.168.1.10`;
DBConn.uiPort := 11001;

IF (DBConn.xReady = TRUE) THEN


q_saRequest[1] := `SELECT * FROM Table`;
DBConn.xExecute := TRUE;
ValveName Dimension_H Dimension_a
END_IF VUG020F304 221 103.5
VUG015F304 235 97
IF (DBConn.xDone = TRUE) THEN SELECT * FROM Tab... VUG015F324 235 97
x := q_saTableValue[1, 1]; VUG015F334 240 97
VUG050F304 290 136
DBConn.xExecute := FALSE;
END_IF
1 SELECT * FROM Tab...

ODBC
2
Data
Data

1 - The control sends the SQL request to the Connector. 2 - The Connector login to the database
(e.g. “SELECT * FROM Table“) and sends the SQL request to the database

4 - The Connector checks the number of data (to avoid an overflow in the 3 - The Connector checks the database answer
control) and sends the data and the state of the request to the control and receive the data (if there is data)
CODESYS Store /

 3S-Smart Software Solutions GmbH Seite 2 von 3


Product description: SQL4CoDeSys
Screenshots
CODESYS Store /

 3S-Smart Software Solutions GmbH Seite 3 von 3


Product description: SQL4CoDeSys

You might also like