Hi all!
I’m working on a project where I would like to connect a PC application to an IRC5 robot controller. It works pretty well, but I do have some problems.
I would like to monitor the operating mode and state of the controller. But when I do that, I get into some truble. If I just get the operating mode b accessing it via the OperatingMode property in the Controller objet all works fine. Altough, I do get in to problems when I try to listen for the OperatingModeChanged events.
When I log on to the controller I create a handler for the event at the same time:
m_ctrl.Logon( user );
m_ctrl.OperatingModeChanged += new OperatingModeChangedEventHandler(m_ctrl_OperatingModeChanged);
m_ctrl.ConnectionChanged += new ConnectionChangedEventHandler(m_ctrl_ConnectionChanged);
m_ctrl.StateChanged += new StateChangedEventHandler(m_ctrl_StateChanged);
Then if I at a later state, still logged on. try to access the mode by using the property an exception is thrown:
System.Exception: Exception of type System.Exception was thrown.
at Adapters.Controller.get_OperatingMode()
at ABB.Robotics.Controllers.Internal.Controller.get_OperatingMode()
at ABB.Robotics.Controllers.Controller.get_OperatingMode()
at UserInfoApp.Form1.btnInfo_Click(Object sender, EventArgs e) in c:projectsvsprojectssdkvisual studio projectsc#userinfoappform1.cs:line 304
I also get some strange error codes in the debug stream ( from what I think is the RAB ):
[1780] Error:
[1780] CRobComCtrl_RC::SendCmd SendCmd hr=0x8001010e
[1780]
At the same time the events as I tried to listen for does not seam to work. I connect to a VC and change the operating mode and state, but there is no responce from the application, even if I don’t try and use the property.
I use RW 5.06.0143 and RAB 5.06.
Anyone that has used the RAB PCAPI and the events successfully?
Best Regards,
Mikael