×
Siemens Industry Online Support
Siemens AG
Entry type: Application example Entry ID: 109479140, Entry date: 08/27/2015
(12)
Rate

SIMATIC ODK 1500S SQL driver

  • Entry
  • Associated product(s)
Connection of an SQL database to an S7-1500 Software Controller

Overview

This application example shows how to connect an S7-1500 Software Controller or Open Controller to an SQL database by means of the ODK 1500S SQL driver. The drivers allows a direct and performant access to SQL databases from a STEP 7 application.

 

Functionality

With the included function blocks it is possible to to read and write data and to edit SQL databases.  All prevalent standard data types are supported. The ODK1500S SQL driver uses the ODBC interface to connect to an sql database (local or remote).

The SQL driver V3 has been tesed with the following databases:

  • Microsoft SQL Server
  • Oracle database
  • My SQL Server
  • MariaDB
  • PostgreSQL

More detailed information (including supported data types) can be found in the documentation (see Downloads).

As a user interface to the database, two function blocks are available. One function block enables to execute SQL statements (e.g. Select, Insert, Update, Delete) with flexible arguments.

The second function block can be used to write data from a data block into a database without using SQL statements.

 


More information about this driver can be obtained from the provided PDF-documents.


History


August 2015 V 1.0
  • First version
 June 2016 V1.1
  • Support of 64-bit floating point numbers
  • Direct input of SQL statements possible (Separation between data and string not necessary)
  • Generation of demo database via sql script
 July 2017

 V2.0

  • Implementation with ODK 1500S V2
  • New user interface
  • New function block for writing process data without SQL strings/statements
  • New function bock for executing SQL statements without arguments
  • Support of optimized data blocks
  • Support for additional data types (datetime, bit…)
  • SQL statements with up to 16000 characters in the user program
 August 2017

 V2.1

  • Support of unicode datatypes WString resp. nvarchar
  • Support of variable string length in read and write direction (up to 254 characters)
  • Increased data interface from 8kByte to 265 kByte (sqlArguments / sqlReceivedData)
  • Improved diagnostic with SQL Viewer
 October 2018

 V2.2

  • new timeout parameter for FB Connect und ExecuteStatement
  • compatibility mode for MS SQL "datetime" datatype
  • Output of a warning as well as detail information via SQLViewer if a value with the content "NULL" is read out via a select statement
  • Bugfixes
 May 2020

 V2.3

  • Support (read only) of blob and binary datatypes
  • Test and support of further databases
  • Bugfixes
 September 2020

 V2.5

  • Rebuild using ODK1500S 2.5.1 (bugfix)
 October 2020

 V3.0

  • Complete new development based on ADO.NET and ODK1500S V2.5
  • Each driver FB is now multi instance capable. Thus, different SQL commands can be executed in parallel or e.g. data can be written in parallel to different databases. 
  • The connection information for the driver FBs is specified by the user in the PLC program via a "Connection String" parameter. A separate parameterization of the ODBC driver as well as the handling of the data base connections in the PLC program (Connect / Disconnect) by the user is therefore not necessary anymore.
  • There is only one placeholder for the arguments. Instead of the different placeholders (%d, %s, %t...) for different data types the universal placeholder "" is used.
  • Simplified error handling: Error messages are mostly also output as plain text on the FBs. In addition, the number of error codes has been reduced to the essential.
  • ODK1500S SQL driver V3 is a 64-bit application (requires a 64-bit ODBC driver)
  • Output of log information FB-granular with the help of the Windows tool “DebugView++”.
 December 2020

 V3.1

  • Optimized interface for sql driver blocks to reduce data workmemory load in plc
  • Support of variable string lentgh for Microsoft sql varchar and nvarchar datatypes


Obtaining

If you are interested, please contact your local sales partner:
Contacts worldwide

 

Downloads

  Documentation (2,0 MB)

 

Rate entry
no rating
Requests and feedback
What do you want to do?
Note: The feedback always relates to the current entry / product. Your message will be forwarded to our technical editors working in the Online Support. In a few days, you will receive a response if your feedback requires one. If we have no further questions, you will not hear from us.