adh2004plc
Member
I am using ftview se 8.0. I am currently working to monitor tags and send their values along with some other information over to sql server on change. Before anyone asks I am using the data log model on a number of other tags but these particular tags and the information I am trying to get to sql dont fit with using a datalog model. I am running into an error that says Invalid procedure call or argument. I am guessing it has to do with what I am trying to pass as far as the TagNames.Item(i) is concerned.
My ultimate goal here is to track which tag has changed and what its value is so that I can pass that information to the SQLInsert subroutine to have it logged to sql. Any help would be greatly appreciated. Here is a copy of the subroutine that is causing my error.
Private Sub mtgDevice_Change(ByVal TagNames As IGOMStringList)
Dim i As Long
Dim UserID As String
Dim Message As String
Dim Device As String
For i = 0 To TagNames.Count - 1
lTime = formatLogTime(LogTime.Value)
Message = "N/A"
UserID = SysUser.Value
Call SQLInsert(lTime, Devices(i), CStr(TagNames.Item(i)), Message, UserID)
Next
End Sub
My ultimate goal here is to track which tag has changed and what its value is so that I can pass that information to the SQLInsert subroutine to have it logged to sql. Any help would be greatly appreciated. Here is a copy of the subroutine that is causing my error.
Private Sub mtgDevice_Change(ByVal TagNames As IGOMStringList)
Dim i As Long
Dim UserID As String
Dim Message As String
Dim Device As String
For i = 0 To TagNames.Count - 1
lTime = formatLogTime(LogTime.Value)
Message = "N/A"
UserID = SysUser.Value
Call SQLInsert(lTime, Devices(i), CStr(TagNames.Item(i)), Message, UserID)
Next
End Sub