RobotStudio event

Exception in Adapter


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

Comments

  • Hello again,

    now I have changed the code so that I do not listen for any events, but poll the controller frequently in order to monitor the status of the controller. However, I still run into some strange exceptions. Now I get an exception when logging of. I do not listen for any events this time, only polling once a sec.

    The exception is thrown in Controller.Logoff():

    -----------------------------------------------------

       at Adapters.Controller.Unsubscribe()
       at ABB.Robotics.Controllers.Internal.ConnectionChangedSubscriptionProvider.Unsubscribe()
       at ABB.Robotics.Controllers.Internal.SubscriptionEntry.UnsubscribeAll()
       at ABB.Robotics.Controllers.Internal.EventServer.UnsubscribeAll()
       at ABB.Robotics.Controllers.Internal.EventServer.HandleLogoff(Boolean completed)
       at ABB.Robotics.Controllers.Internal.ControllerBoundObject.NotifyLogoff(Boolean completed)
       at ABB.Robotics.Controllers.Internal.Uas.Logoff()
       at ABB.Robotics.Controllers.Controller.Logoff()
       at IRC5Controller.IRC5Controller.LogOff() in c:projectsfactoryinaboxfinaboxcvscodefinaboxirc5controllerirc5controller.cs:line 477
      -----------------------------------------------------

    In the debug stream some info appears at the same time:

    [3560] Error:
    [3560] CRobComCtrl_RC::UnsubscribeOnEvent UnsubscribeOnEvent
    [3560]
    [3560] ReleaseErrorTrace:
    [3560] File:
    [3560] .RobUserImpl.cpp
    [3560]
    [3560] Error:
    [3560] RobUser::FinalRelease. Released while still holding users. Attempting to logoff and cleanup
    [3560]
    [3560] ReleaseErrorTrace:
    [3560] File:
    [3560] .RobClientDBImpl.cpp
    [3560]
    [3560] Error:
    [3560] RobClientDB::GetUid - Client not registered.
    [3560]
    [3228] Error:
    [3228] CMonitorInterfaceAndProcessId: Process 3560 is dead last err=87
    [3228]

    Anyone got a clue why I get the exception? Basically all I do is logon, read the state and operation mode of the controller and logoff.

    Best Regards,

    Mikael

  • Hi again,

    installed the service pack and it looks like all problems are solved.

     

    Thank you very much Tonje! image

     

    Best Regards,

    Mikael

  • which service pack?
    Russell Drown
  • Hi,

    received a "FIX" from the support team.

    RAB_5.06.0176.0158 - PC SDK 5.06 rev2

    It will be released on the SolutionsBank as soon as possible.

     

    BR

    Mikael

  •  

    The service pack for Robot Application Builder 5.06 (RAB PC SDK 5.06 rev2) is now availeble for Subscription Service customer att the Software Subscription Service portal.

    For Internal user att SolutionsBank.

    Best Regards

    Tonje Sandberg
    Service Training Coordinator
    ABB AB / Robotics Products