RobotStudio event

RobAPI question

Hi all!

I hope this is the correct forum for RobAPI questions.

I am trying to develop a software in C# with a connection to an IRC5 controller. I have a problem sending parameters to the COM objects in the RobAPI. I try to pass a ROBCTRLINFOLib.RobEventParams struct to a ROBCTRLINFOLib.IRobNetScanSubscribe.Subscribe() call. I think I get all the fields in the struct correct, but the param.riid. It is an System.IntPtr and I can't figure out what to pass as the IID*. In ordinary unmanaged C++


GUID rrid = __uuidof(_IRobObjectEvents);
Params.riid = &rrid;
should suffice, but what do I do in managed C#? I have tried several approaches, but none seems to work.
Type t = typeof( ROBCTRLINFOLib._IRobObjectEvents );
System.RuntimeTypeHandle h = t.TypeHandle;
par.riid = h.Value;
Is not working and not
ROBCTRLINFOLib._IRobObjectEvents i = m_robot; // where m_robot  implements ._IRobObjectEvents
Type t = typeof( ROBCTRLINFOLib._IRobObjectEvents );
par.riid = System.Runtime.InteropServices.Marshal.GetComInterfaceForObject( i, t );
 
Any good suggestions on how to do this?? I guess I am way off in both my approaches, but I can't quite figure out what to do.
In both my implementations I get "No such interface supported" back as an exception.
Best Regards
Mikael

 
Mikael38485,5871759259

Comments

  • RobAPI is only intended for internal usage, so I doubt that you will get much response here.

    Have you installed PCSDK, aka CAPI, the public version of this tool? There is a (pretty lame) sample that if you study will show you how you might scan the network to locate IRC5s and then access them.

    I call the sample "lame" because it is nowhere near runnable in the form that you are given. You will have to make the following modifications:

    1. Add the project in C:Program FilesABB Industrial ITRobotics ITRobot Application BuilderController APIExample to an existing solution.

    2. Set it to be the startup project.

    3. In Windows Explorer, change all of the files in this directory from Read-Only to Read-write.

    4. In VS.Net 2003, add required references to the Ryxx project by right-clicking the References node in the Solution Explorer and browsing to C:Program FilesABB Industrial ITRobotics ITRobot Application BuilderController API.

    5. Select all of the files in that directory EXCEPT those that begin with the letter "m", e.g. mfc71.dll, mfcu71.dll, etc.

    6. Try to build the project. If errors occur during the build stating that  "ABB.Robotics..." cannot be found, you may have to delete and replace these references.

    7. See the release notes for more information.

    Russell Drown
  • Hi RussD,

    Thank you for your reply. I know it was a long shot, but I was hoping to find some ABB people here.

     

    I have managed to scan for controllers, the part I'm curious about is whether it is possible to use a managed language, like C#, and send IID pointers to the COM objects. But I guess that there might be forums better suitable than this one for that kind of questions.

     

    Best Regards

    Mikael