PQ Systems Knowledge Base

CR: Charting from IndustrialSQL Server

Problem:

You need to setup a CHARTrunner chart definition to chart data from tags that reside in Wonderware's IndustrialSQL Server.

IndustrialSQL Server is a real-time relational database that sits on top of SQL Server.  An  advantage of  using IndustrialSQL Server is that it allows you to store many more data values per second than you could using SQL Server alone.

In IndustrialSQL Server data is stored in a tag, where a tag is the atomic unit of storage. A tag is a variable that typically represents a single attribute of some physical process or device. A tag is characterized by a unique name in the IndustrialSQL Server. A tag has many attributes, such as type (for example, analog, discrete, string, etc.), how its values are acquired, how its values are stored (cyclic or delta), and so on.

Typically chart data is gotten from analog tags when drawing control charts.

Solution:

You can download the attached CHARTrunner chart definition for an example of a chart that has been setup as described below.  You might have to right-click on InSQL_Example1.CRF and select "Save Target As..." in order to save the chart definition file on your computer's disk.

Basically there are two important questions that must be answered when setting up a CHARTrunner chart definition for IndustrialSQL Server:

1.      What data provider do I use to get to the IndustrialSQL Server data? 

You should use the SQL Server ADO provider and connect to SQL Server on the server where IndustrialSQL Server is running.  You fetch IndustrialSQL Server tag data by making queries against the underlying SQL Server database engine.

When connecting to SQL Server via the ADO provider (using SQL Server authentication) your "Connection string" will look similar to that shown below (you must substitute appropriate information in place of MY_INSQL_SERVER, MyUserName and MyPassword):

Provider=sqloledb; Network Library=DBMSSOCN; Data Source=MY_INSQL_SERVER; Initial Catalog=RunTime; User Id=MyUserName; Password=MyPassword;

If you want to use "Trusted Connection Security" to connect to SQL Server using your workstation login credentials you would use a "Connection string" similar to this:

Provider=sqloledb; Network Library=DBMSSOCN; Data Source=MY_INSQL_SERVER; Initial Catalog=RunTime; Trusted_Connection=yes;

In the examples shown above MY_INSQL_SERVER is typically the computer name of the server where IndustrialSQL Server and SQL Server are installed and running.

2.      What type of data source do I specify on the CHARTrunner "Data definition" tab?

Use a "Custom query" and specify a SQL SELECT statement similar to this:

SELECT DateTime, TagName, Value FROM INSQL.Runtime.dbo.History
WHERE TagName = 'MyTagName1'
  and DateTime >= '2003/07/08 08:00:00'
  and DateTime <= '2003/07/08 14:00:00'

The SELECT statement shown above fetches data for the tag named MyTagName1 from INSQL.Runtime.dbo.History.  INSQL.Runtime.dbo.History is referred to as the "Four-Part Naming Convention" and it is the special means by which SQL Server is able to gain access to data stored in the History extension table in IndustrialSQL Server. 

Refer to the IndustrialSQL Server Concepts Guide for more information on using the "Four-Part Naming Convention" to fetch data from IndustrialSQL Server.

Would you like to...

Print this page Print this page

Email this page Email this page

Post a comment Post a comment

Subscribe me

Add to favorites Add to favorites

Remove Highlighting Remove Highlighting

Edit this Article

Quick Edit

Export to PDF

User Opinions (0 votes)

No users have voted.

How would you rate this answer?



Thank you for rating this answer.

Related Articles

No related articles were found.

Attachments

Continue