RobotStudio event

Using OPC and .NET to communicate with ABB IRC5 robot controller.

Hi,

I would like to make a .NET application that can read and write RAPID variables and IO signals on an ABB IRC5 robot controller. To do this, I have decided to make use of OPC where my idea was to use some kind OPC-DA client .NET library.

Having struggled a bit in finding such a library, I have chosen to use the Core Components that can be downloaded freely as long you are a registered user.

The problem is that I have not been able to read any data through this library. The essence of my code looks like this:

// Create a server object
Opc.URL url = new Opc.URL("opcda://192.168.xx.xx/ABB.IRC5.OPC.Server.DA"); // <-- Not really sure about how the address should look??
Opc.Da.Server server = null;
OpcCom.Factory fact = new OpcCom.Factory();
server = new Opc.Da.Server(fact, null);
server.Connect(url, new Opc.ConnectData(new System.Net.NetworkCredential()));

// Create a group
Opc.Da.Subscription group;
Opc.Da.SubscriptionState groupState = new Opc.Da.SubscriptionState();
groupState.Name = "MyGroupName";
groupState.Active = true;
groupState.UpdateRate = 200;
group = (Opc.Da.Subscription)server.CreateSubscription(groupState);

// Create list of items to monitor
Opc.Da.Item[] opcItems = new Opc.Da.Item[1];
opcItems[0] = new Opc.Da.Item();
opcItems[0].ItemName = "4600-103555.SystemClock"; // <-- Is this the correct format?
group.AddItems(opcItems);

// Assign data changed event handler
group.DataChanged += new Opc.Da.DataChangedEventHandler(OPCSubscription_DataChanged);

I subscribe to the SystemClock as it should consistency be updated.

If I try to connect to the URL "opcda://192.168.xx.xx/ABB.IRC5.OPC.Server.DA" I receive the following exception:

System.Runtime.InteropServices.ExternalException
  HResult=0x80004005
  Message=CoCreateInstanceEx: The RPC server is unavailable.

  Source=OpcNetApi
  StackTrace:
   at Opc.Server.Connect(URL url, ConnectData connectData)
   at Opc.Da.Server.Connect(URL url, ConnectData connectData)
   at OPCReadWriteProject.Program.Main(String[] args) in C:\Users\XXX\OPCReadWriteProject\Program.cs:line 37

If I instead try to connect to the URL "opcda://localhost/ABB.IRC5.OPC.Server.DA", the application seems to run fine, but my dataChanged event is never fired.

I have tried to install the standalone OPC-DA client called "MatrikonOPC Explorer" and verified that I can connect to "ABB.IRC5.OPC.Server.DA" and receive updates on the tag "4600-103555.SystemClock".

Do you have any experiences using OPC and .NET to communicate with your ABB robot?

Best Regards,
Baldur