RobotStudio event

Mastership.Request(iMastershipResource) is obsolete

davidmaynard100
edited May 2021 in Developer Tools
Hi

In the latest PC SDK, I have a warning that "Mastership.Request(iMastershipResource)" is obsolete and should be replaced with "Request(iMastershipResourceController)".

My existing code is

public static Controller rpdController
using (Mastership m = Mastership.Request(rpdController.Rapid))
{
rpdTask.Start();
}

I'm unsure of how to replace this code with the new version and an internet search comes-up with nothing (so far :).

Thanks
David
Post edited by Nils Olofsson on

Comments

  • DenisFR
    DenisFR ✭✭✭
    Hello,
    I don't have last PS SDK to test with it, but in its PC_SDK_Reference_Documentation.chm
    ABB.Robotics.Controllers. Controller
    is:
    public sealed class Controller : SDKBase, 
    	IController, IMastershipResourceController, IMastershipResource
    Can you check it in VisualStudio?


    ☑️2024 - RobotStudio® User Group

  • Thanks, yes I can view it in VS Object Browser but am stuck with the code changes I need to make.
  • DenisFR
    DenisFR ✭✭✭
    Hello,
    Does this works?
    using (Mastership m = Mastership.Request((iMastershipResourceController)rpdController.Rapid))



    ☑️2024 - RobotStudio® User Group

  • Hi again, I tried this but it didn't work.

    Thanks
    David
  • Micky
    Micky ✭✭✭
    Hello,

    please try the following:
    using (Mastership m = Mastership.Request(rpdController))


  • Hi Micky

    Thank you very much, that worked.
    I only just revisited this issue since it first arose last year.

    Regards
    David
  • Hello,
    Just moved the thread into Developer Tools section so it's easier to find if someone has similar problem

    Nils Olofsson
    PC Software Support Engineer