MatrikonOPC OPC Exchange


OPC and SQL

Posted on March 20th, 2008 by Eric Murphy

When discussing OPC, particularly OPC HDA, the question of OPC vs SQL/ODBC often comes up.  Although both standards deal with accessing data you usually see that OPC and SQL are used together in systems, rather than an either/or setup.   The primary design of OPC DA is for collecting real-time data in a standardized way from countless data sources and vendor products, spanning all industries.  Relational databases, which use SQL/ODBC are designed for storing data and provide standardized ways of accessing and retrieving the information (queries, views, table structure, etc).   Sounds like the perfect match to me!   Apparently I’m not the only one, since you will find many products that leverage the power of OPC and SQL.   Just recently Inductive Automation announced they will be bundling the OPC Tunneller with their FactorySQL product.   ‘OPC in, SQL out’ is a clear choice.

Where things can sometimes get interesting is the question of ‘OPC HDA out or SQL out?’   In order to answer that question, you really need to consider:  What data is being stored.  Who needs to access the data and why?  How is the data being used or presented?   In most cases, the answers really reflect the bigger question of ‘Relational-database or Process Historian?’  That’s a whole ball of wax I’d rather not get into.  Enter ‘historian vs database’ into the search engine of your choice and you can find papers fervently defending both positions.   Most arguments focus on speed, capacity, flexibility and suitability for a manufacturing environment.   As hardware and programming evolves these distinctions become increasingly more blurry.

The primary design of OPC HDA is accessing, updating and managing tag-based time-series data.   SQL is a standard interactive and programming language for querying and modifying data and managing databases, regardless of how the data is related.  Again the choice of which is better is a fuzzy choice to many.  Which is why there are products that give users the flexibility to decide: where to store their data and how to access it.   OPC HDA out of SQL/ODBC or SQL/ODBC out of OPC HDA, as well as ‘industrial relational databases’ that make use of OPC and SQL.

At the end of the day the choice is up to you.  As this article points out, you will probably end up with both.  As long as you’re using OPC somewhere in the architecture you can’t go wrong. :)

One Response to “OPC and SQL”

  1. Anthony Ho Says:

    It is indeed a choice for the user to choose between OPC-HDA and SQL server. For me, SQL server based stored procedures and triggers have helped me to automate many historical tasks. I am interested in what UA has to offer or improve on the OPC-HDA.

Leave a Reply

For spam filtering purposes, please copy the number 1517 to the field below: