RobotStudio event

PCSDK - Warmstart of virtual controller


Hello everybody,

in Robotstudio 5.13.xx I used ControllerHelper.Restart() to restart a virtual controller.
In Version 5.14 I can't find this method.

So I tried to restart the virtual controller using the follwoing code, but RobotStudio crashes.
 
using (Mastership mc = Mastership.Request(aController.Configuration), mr =    Mastership.Request(aController.Rapid))
{
       aController.Restart(ControllerStartMode.Warm);                   
}

Exists an other way to perform a warmstart of a virtual controller?

Best regards,
Steve



John Wiberg2012-03-07 10:07:37

Comments

  • Hi SteveO,

     
    There are no changes in PC SDK between 5.13 and 5.14 which would explain such behavior. Maybe they did some change in UAS on RobotWare?
     
    Nonetheless, got it to work changing the mastership request to the controller instead of to RAPID explicitly. Also you need to be logged on.
    This code snippet is from a Console app, so change any readkey if you are running  windows app.
    [code]        static void RestartTest(Controller ctrl)
            {
                ctrl.Logon(UserInfo.DefaultUser);
                try
                {
                    if (ctrl.OperatingMode == ControllerOperatingMode.Auto)
                    {
                        using (Mastership.Request(ctrl))
                        {
                            ctrl.Restart(ControllerStartMode.Warm);
                            Console.WriteLine("restarting - wait and then press any key");
                        }
                    }
                    else
                    {
                        Console.WriteLine("Automatic mode is required.");
                    }
                }
                catch (System.InvalidOperationException ex)
                {
                    Console.WriteLine("Mastership problem." + ex.Message);
                }
                catch (System.Exception ex)
                {
                    Console.WriteLine("Unexpected error occurred: " + ex.Message);
                }
                Console.ReadKey();
                ctrl.Logoff();//should be unecessary since we get kicked out at restart.
            }[/code]
    Let me know if this works for you as well.
  • Hi John Wilberg,
    thanks for the code snippet.

    I changed the mastership request to the controller and added the logon part.
    But when I try to logon, I get the following exception:

    "The call was blocked by the current host"

    Is the DefaultUser defined in any system?

    Steve



  • It is by default. Embarrassed
    But it can be altered/removed.
    My testing was vs a Virtual Controller, 5.14.02 with PC & FlexPendant interface options.
     
    You should use RobotStudio to check out the UAS settings on the controller.

  • Hi, it's me again.

    I couldn't find the UAS Settings in RobotStudio for a virtual controller.
    I guess the UAS settings in the online tab wont't help me with a virtual controller.

    I changed the Robotware version of my system from 5.13.xx to the version 5.14.02, but the problem is still the same.

    What else can I try?
    Steve



  • Just to try out if the code snippet works you could just create a new system. Did you create your VC from a real system?Tongue
    Yes, the UAS for the VC can be "a bit hard" to find. As in, you have to know it to do it.
    Pig I think it's because someone assumed that it would be done for live systems only.
     
     
    Start RS
    Top left corner there is a dropdown symbol [Customize Quick Access Toolbar] select [Customize Commands]
    in the "Show commands from" dropdown select [Online]
    In the list doubleclick [Authenticate]
    You will now see the Authenticate icon on the top bar next to the screenshot camera icon.
    Go to the Offline tab, select the controller in the browser and then click the Authenticate menu
    [Edit User Accounts]
    First tab should show you the current users and the others would let you change them.
    Phew, Pinch...
    They tell me its going to be changed in a future version...