[?]: write the external tags to Wincc SQL server

ProTool, WinCC flexible, WinCC, PP/OP/TP/TD/MP
Post Reply
valmet
Posts: 5
Joined: Thu Sep 06, 2007 7:08 am
Location: Turkey

[?]: write the external tags to Wincc SQL server

Post by valmet »

Hello
I want write the external tags to sql server every ten second.How am ı make?
rataman
Posts: 52
Joined: Sat Nov 25, 2006 2:53 am
Location: America

Post by rataman »

You have two choices:
1) Use Tag Logging, it is fast and easy, read the help or
2)Use a global vb script with a cyclic trigger of 10 seconds and use this code:

Sub ConnectDB
Set gocn = CreateObject("ADODB.Connection")
Set SQLresult = CreateObject("ADODB.Recordset")
'CONNECT TO SQLSERVER
gocn.open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=YOURDATABASE;Data Source=.\WinCC"
sSql = "yoursqlqueryhere"
SQLresult.open sSql, gocn, 1
gocn.close
Set gocn = nothing
Set SQLresult = nothing
end sub
valmet
Posts: 5
Joined: Thu Sep 06, 2007 7:08 am
Location: Turkey

Post by valmet »

Thank you for oyur information
I try to Tag Loggin but ı dont connect to SQL ,ı dont see the sql option.I think ı dont make some adjustment can you help me ? :oops:
rataman
Posts: 52
Joined: Sat Nov 25, 2006 2:53 am
Location: America

Post by rataman »

You should not do any adjustment, just go to tag logging from wincc explorer, create a new file, add tags and you are done, no need to configure any connection for archiving on local sql server.
valmet
Posts: 5
Joined: Thu Sep 06, 2007 7:08 am
Location: Turkey

Post by valmet »

:P thank you for your imformation .And can ask one question more.CAn I sellect my table in SQL side.Wincc sellect ıts table.But ı want to use diffrent table.For exp.;

New_Tag1 is wincc tag.Iwant write this tag value every ten second to "Trend" table in SQL side.
rataman
Posts: 52
Joined: Sat Nov 25, 2006 2:53 am
Location: America

Post by rataman »

Use the VB code to use your own databases.
I made a few projects accesing Oracle and SQL , but i dont have them on hand till next week.
Greetings
valmet
Posts: 5
Joined: Thu Sep 06, 2007 7:08 am
Location: Turkey

Post by valmet »

Where can i found information about this subject
Galli
Posts: 38
Joined: Sat Jun 30, 2007 5:36 am

Post by Galli »

I have the sample program SQL WinCC..
But I don't know wheter this what you looking for...
Here the link ..
http://domain945847.sites.fasthosts.com/downloads.asp
valmet
Posts: 5
Joined: Thu Sep 06, 2007 7:08 am
Location: Turkey

Post by valmet »

thank you

Can ı found ext prg for this job
enraptured
Posts: 7
Joined: Tue Oct 23, 2007 10:13 am
Location: America

WinCC SQL information

Post by enraptured »

Here is a website that has some examples of SQL and other things.

http://www.wincc.net/

http://www.allottware.co.za
Post Reply