OPC Server directly to SQL Server

  • Thread starter Engelbert Rodríguez
  • Start date
E

Thread Starter

Engelbert Rodríguez

Hello List,

I wonder if someone have done this type of application:

I would like to do an VB or C++ application that can use WinCC data. As WinCC have an OPC DA server, I was thinking in this:

1- Connects and external SQL Server Database in a remote Computer in the network and reads directly from the WinCC OPC DA Server, read the online data and put it in the databse. Is this possible?

2- Read the data from the databse and use it in my application (This is possible, for sure).

Any Comments?

Thanks in advance,

Engelbert Rodríguez
 
1. Yes this is possible. You can program it yourself using the OPC DA Automation dll provided with WinCC or you can use the IndustrialDataBridge option as this will do the same thing without the need for programming.

2. Please be aware that with V6, if you want to access the WinCC database then you have to purchase one of the WinCC options:- DataMonitor, IndustrialDataBridge or the Connectivity Pack. If you are unfamiliar with these options then you search this forum or go to the WinCC sales site http://www.siemens.com/wincc

It is possible to program access using the Connectivity Pack. However you should be aware that WinCC offers an OLEDB provider for accessing the data. This provider has both good and bad points but be aware that it is the only _supported_ way to access the database. Bypassing this provider and using the MS SQL Server OLEDB provider will put you in breach of your licencing contract.

I hope this helps,
Salma
 
E

Engelbert Rodríguez

Hello Salma, thank you for your response.

I´ve been looking at the solutions that you mention here, I´ve found that with these options you can access the WinCC Database, what I need to do is more simple (I think). I need to put some tags in the WinCC OPC server, and then from another PC read these online values from my application. Can i read OPC directly from VB or SQL Server? Do I need another WinCC software option for that?

Thanks in advance,

Engelbert
 
Sorry for the confusion.

All tags in a WinCC project are automatically available to any OPC client (that means internal as well as external tags) as soon as you request them from the WinCC OPC Server.

There is an example of how you can read a tag via OPC from Excel in the WinCC manual - just do a search on "OPC AND Excel" to find it.

The example uses VBA to program the OPC client but you can easily port this across to VB. SQL Server will be trickier as you would have to compile the OPC client into a dll and call that, so best to stick with VB methinks (but then again there could well be a more elegant way to do it).

There are lots of OPC clients on the internet that you can use as a starting point. I particularly like the one on the Kepware site as it's simple, easily modified, VB source code included and will communicate to any OPC Server.

I hope this answers your question. If not then just let me know.

Kind regards,
Salma
 
C

C.Verweij , Sr.Control Engineer

You may want to have a look at http://www.matrikon.com.
They sell a OPC to SQL2000 driver. I'm planning to use it for an upcoming project myself. I'm very satified with their other products so far.

good luck !
 
Hi, Mr.Engelbert

I am also trying to communicate between Excel and Wincc,
have you tried it? i have tried it by altering the vb code of Excel but again it works for only one tag at one cell, it cannot read another tag.

If you find any solution please communicate.

thanks n regards,
Sunil
 
Hello Engelbert,
We suggest that you check out our out-of-the-box OPC Clients and our development tools at www.integ-objects.com/Products.htm .

We beleive that our OPC DA ActiveX (www.integ-objects.com/OPC-ActiveX.htm ) may best help you retreive data directly from an WinCC DA Server. You may get rid of archiving data in an SQL Server database. Using our OPC DA ActiveX you will be able to build your own OPC communication. Furthermore, OPC knowledge is not required.

You may request a trial version software directly from the website.

I hope this helps you.

Nadia
 
E

Engelbert Rodríguez

Hello Nadie, thank you for the information, I´ll check your suggestions, the project is still in evaluating process but one problem is that our client doesn´t want to buy more software but we´re analizing the options availables.

Best regards,

Engelbert Rodríguez
ICESA
Spain
 
Top