Application on Open-Loop Control &
Closed-Loop Control
PC-Based Automation with
SIMATIC WinAC
Connection of Databases via open Interfaces
Using OPC-XML, Programmed in C# .net
Warranty, Liability and Support
Database Link to WinAC via OPC-XML Entry ID: 21576581
V 1.1 Edition 05/17/05 2/101
Copyright © Siemens AG 2005 All rights reserved
21576581_WinAC_SO_DOKU_v11_e.doc
Warranty, Liability and Support
We accept no liability for information contained in this document.
We do not accept liability, whatever the legal basis, for any damages
arising from the use of examples, notes, programs, configuration and
performance data etc. described in this document, except where we are
obliged to by the German Product Liability Act or in cases of willful damage
or gross negligence, injury to life, body or health, breach of guarantee for
the condition of products or items assumed by us, fraudulent concealment
of a defect or breach of a substantial contractual obligation. However,
claims arising from a breach of a condition which goes to the root of the
contract shall be limited to the foreseeable damage which is intrinsic to the
contract, unless caused by intent or gross negligence or based on
mandatory liability for injury of life, body or health. The above conditions are
not meant to change the burden of proof to the detriment of the user.
The application examples do not purport to cover all details or variations in
equipment, nor do they provide for every possible contingency. They are
not customer-specific solutions. They are only intended to provide support
for typical tasks. You are responsible for ensuring that the described
products are used correctly. These application examples do not relieve you
of the responsibility to use sound practices in application, installation,
operation and maintenance. By using this application example you accept
that Siemens is not liable for any damages except for those specified in the
above liability clause. We reserve the right to make changes in these
application examples at any time without prior notice. If there are any
deviations between the recommendations provided in this application
example and other Siemens publications – e.g. Catalogs – the contents of
the other documents have priority.
Copyright© 2005 Siemens A&D. Any form of duplication or
distribution of these application examples or excerpts hereof is
prohibited without the expressed consent of Siemens A&D.
For questions about this document please use the following e-mail address:
mailto:csweb@ad.siemens.de
Foreword
Database Link to WinAC via OPC-XML Entry ID: 21576581
V 1.1 Edition 05/17/05 3/101
Copyright © Siemens AG 2005 All rights reserved
21576581_WinAC_SO_DOKU_v11_e.doc
Foreword
Objective of the application
Eight examples were developed to provide a quick lead-in to PC-based
automation with SIMATIC WinAC. They consist of the sample code and an
extensive documentation. Using these examples, the user can familiarize
with the individual topics on a task-specific basis.
Main contents of this application
This application deals with the following key elements:
• Linking databases to WinAC RTX
• Basics of Microsoft .net
• Database accesses via the ADO.net interface
• Basics of Microsoft ACCESS and MySQL
Delimitation
This application does not include a detailed description of
• the setup of databases
• the basics of OPC XML
• programming in C#
Basic knowledge of the topics listed above is required; for detailed
information, please refer to other applications of this application series. The
bibliographic references includes references.
The individual examples
To enable optimum use of PC-based automation, we have developed one
example from the “classic” PLC world and one from the “open” PC world for
each of the four typical automation tasks (controlling, communication,
visualization, technology).
All eight examples with their allocation to the respective automation tasks
are shown in the figure below. This example, which deals with “Data
Exchange via OPC XML”, is displayed with a red margin.
Foreword
Database Link to WinAC via OPC-XML Entry ID: 21576581
V 1.1 Edition 05/17/05 4/101
Copyright © Siemens AG 2005 All rights reserved
21576581_WinAC_SO_DOKU_v11_e.doc
Figure 0-1
Basis of the examples
All examples are based on a virtual “mixing process”. Using this “mixing
process”, the different tasks and automation components from the product
range of PC-based automation are applied.
System picture
The following figure shows the system picture of the “mixing process”. The
red margin indicates the components described in this example.
Foreword
Database Link to WinAC via OPC-XML Entry ID: 21576581
V 1.1 Edition 05/17/05 5/101
Copyright © Siemens AG 2005 All rights reserved
21576581_WinAC_SO_DOKU_v11_e.doc
Figure 0-2
Basic solution approach of this application
The application requires different hardware and software components.
Some of these components are included in the delivery of this application,
others are provided by you.
This documentation describes the individual components and their
interaction.