Hello
I want write the external tags to sql server every ten second.How am ı make?
[?]: write the external tags to Wincc SQL server
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
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
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
But I don't know wheter this what you looking for...
Here the link ..
http://domain945847.sites.fasthosts.com/downloads.asp
-
- Posts: 7
- Joined: Tue Oct 23, 2007 10:13 am
- Location: America
WinCC SQL information
Here is a website that has some examples of SQL and other things.
http://www.wincc.net/
http://www.allottware.co.za
http://www.wincc.net/
http://www.allottware.co.za