P
Using VB to communicate to Logix5000 processor via RSLink and OPC.
When setting up a connection using VB I have the following code:
<Snip other declarations etc>
////
Private WithEvents MyServer as OPCServer
Private WithEvents MyOPCgrp as OPCGroup
Set MyServer = New OPCServer
MyServer.Connect "RSLinx Remote OPC Server", sHostName
Set MyOPCgrp = MyServer.OPCGroups.Add(mvarGroupName)
MyGroup.IsActive = False
MyGroup.IsSubscribed = True
////
This crashes at the .IsSubscribed bit. I know that it only works if its compiled and that the code for can't be in a .bas module. It currently lives in a class module.
Anybody shed any light on this?
Regards.
When setting up a connection using VB I have the following code:
<Snip other declarations etc>
////
Private WithEvents MyServer as OPCServer
Private WithEvents MyOPCgrp as OPCGroup
Set MyServer = New OPCServer
MyServer.Connect "RSLinx Remote OPC Server", sHostName
Set MyOPCgrp = MyServer.OPCGroups.Add(mvarGroupName)
MyGroup.IsActive = False
MyGroup.IsSubscribed = True
////
This crashes at the .IsSubscribed bit. I know that it only works if its compiled and that the code for can't be in a .bas module. It currently lives in a class module.
Anybody shed any light on this?
Regards.