VB Crashing When Using RSLink OPC


Thread Starter

Paul Furze

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?

Info from RockWell Knowledgebase:
Please note that attempts to do Remote OPC (RSLinx Gateway on another machine) from within the Visual Basic (VB) environment will fail with
errors using the "Subscribe" method. The error message is "Error: -2147467259, Method 'IsSubscribe' of object 'IOPCGroup' failed." You must compile your program into an executable. The problem with the VB environment is related to DCOM.

Michael R. Batchelor

Has *ANYBODY* managed to get a stable remote OPC connection to RSLinx 2.30.01 from a VB client using the Rockwell supplied RSIOPCauto.dll?

We can make a local connection work for months at a time, but the remote connections are flakier than freeze-dried fish food. The Rockwell tech notes mumble something about "must be compiled" and try to pass it off as a Microsoft problem, but I'm not buying that answer. We've got way too many hours into tweaking the DCOM settings, not to mention that too many other things work
correctly. It's got to be a Rockwell problem from what I can see.

Has this been fixed in later releases of RSLinx? The problem always appears in the IsSubscribed method. Everything else seems to work fine.

Michael R. Batchelor - Industrial Informatics & Instrumentation, Inc.
Linux is like a wigwam...
No windows, no gates.
Apache inside.