Wincc de scriptle tag değerlerini sql servere export edebilirsin. bunun için sql server da tag tablosu oluşturup. o tabloaya kayıtları insert sql ile ekleyebilirsin. bu iş cyle veya tag in change ile gerçekleştirebilirsin. daha önce yazdığım örnek script parçacığı aşağıda.
sen sql stringlerini kendine göre düzenleyebilirsin.
Set objConnection = CreateObject("ADODB.Connection")
objConnection.ConnectionString = strConnectionString
objConnection.CursorLocation = 3
objConnection.Open
strSQL = "select pump_name,starttime,stoptime,DATEDIFF(Hour, starttime, stoptime) as duration,rts_id,rts_id as rrrr from Runtimess where CAST( FLOOR( CAST( starttime AS FLOAT ) ) AS DATETIME )>'"&sinir&"' "
End If
End If
Set oRs = CreateObject("ADODB.Recordset")
Set objCommand = CreateObject("ADODB.Command")
objCommand.CommandType = 1
Set objCommand.ActiveConnection = objConnection
objCommand.CommandText = strSQL
Set oRs = objCommand.Execute
ColumnCount = oRs.Fields.Count
RowCount = oRs.RecordCount
RowCount=Rowcount
prg.ValueMax =oRs.RecordCount
prg2.Max=2*oRs.RecordCount
Redim DataArray(ColumnCount - 1 ,RowCount)
For X = 0 To ColumnCount -1
DataArray(X,0) = oRs.Fields(x).Name
If x=0 Then
DataArray(X,0) = "Seq"
End If
If x=1 Then
DataArray(X,0) = "Pump Name"
End If
If x=2 Then
DataArray(X,0) = "Record Date"
End If
If x=3 Then
DataArray(X,0) = "Runhour"
End If
If x=4 Then
DataArray(X,0) = "RunhourNR"
End If
If x=5 Then
DataArray(X,0) = "Cycle"
End If
If x=6 Then
DataArray(X,0) = "INLET_PT"
End If
If x=7 Then
DataArray(X,0) = "SET_PYL"
End If
If x=8 Then
DataArray(X,0) = "FRW_FLOW"
End If
If x=9 Then
DataArray(X,0) = "SET_FYL"
End If
If x=10 Then
DataArray(X,0) = "CW_PDISH"
End If
If x=11 Then
DataArray(X,0) = "ACT_POWER(P)"
End If
If x=12 Then
DataArray(X,0) = "ACT_POWER(V)"
End If
If x=13 Then
DataArray(X,0) = "ACT_POWER(I)"
End If
If x=14 Then
DataArray(X,0) = "M_NDE_TE"
End If
If x=15 Then
DataArray(X,0) = "M_DE_TE"
End If
If x=16 Then
DataArray(X,0) = "X_DE_VE"
End If
If x=17 Then
DataArray(X,0) = "Y_DE_VE"
End If
If x=18 Then
DataArray(X,0) = "P_NDE_TE"
End If
If x=19 Then
DataArray(X,0) = "P_DE_TE"
End If
If x=20 Then
DataArray(X,0) = "X_NDE_VE"
End If
If x=21 Then
DataArray(X,0) = "Y_NDE_VE"
End If
If x=22 Then
DataArray(X,0) = "rst_id"
End If
Next