RobotStudio event

Is it possible to start a virtual controller from command line?

I have a machine that is constatnly running a virtual controller for various test purposes. I would like it to start the virtual machine automatically after a restart.
So, is it possible to start a virtual machine from commandline or by other means possible to schedule at startup of windows?

Best regards
Markus
//Markus Näslund

Best Answers

  • scottdf93
    scottdf93
    Answer ✓
    I have a machine that is constatnly running a virtual controller for various test purposes. I would like it to start the virtual machine automatically after a restart.
    So, is it possible to start a virtual machine from commandline or by other means possible to schedule at startup of windows?

    Best regards
    Markus
    Most likely as its ran as a process using the communication server so an educated guess would be that you could call it parsing through arguments. You can create a console app which you can call from the command line with the following to start a controller;

    using ABB.Robotics.RobotStudio.Stations;

    RsIrc5Controller irc5= new RsIrc5Controller(directoryOfTheController);
    await irc5Controller.StartAsync(VirtualControllerRestartMode.WarmStart, mechanisms, false);

Answers

  • scottdf93 said:
    I have a machine that is constatnly running a virtual controller for various test purposes. I would like it to start the virtual machine automatically after a restart.
    So, is it possible to start a virtual machine from commandline or by other means possible to schedule at startup of windows?

    Best regards
    Markus
    Most likely as its ran as a process using the communication server so an educated guess would be that you could call it parsing through arguments. You can create a console app which you can call from the command line with the following to start a controller;

    using ABB.Robotics.RobotStudio.Stations;

    RsIrc5Controller irc5= new RsIrc5Controller(directoryOfTheController);
    await irc5Controller.StartAsync(VirtualControllerRestartMode.WarmStart, mechanisms, false);
    I just tried this but it does not seem to work that easily. Too bad, it would have been a great solution.
    If anybody knows a way to start a virtual controller with the RobotStudio SDK and a console application any help would be greatly appreciated.
    //Markus Näslund
  • Hello Markus,

    Try this:

    1. Add the dependencies RobotStudio.Services.RobApi and RobotStudio.Services.RobApi.Desktop
    2. RobVcFactory.StartVC("PathToVC",VCStartType.WarmStart,VcStartOptions.Default);
    Thank you, I had already solved it another way but it didn't seem right although it worked.
    This was the solution I managed to find:

                RobotStudioAPI.Initialize();

                ApiServices.Simulator = new RobotStudio.Services.Simulation.SimulatorService();

                ApiServices.Controller = new RobotStudio.Services.Controller.ControllerService();

                RsIrc5Controller c = new RsIrc5Controller("PathToVC");

                Task tc = c.StartAsync(VirtualControllerRestartMode.WarmStart, null, false);

    Thanks again, I will replace my solution with yours since it feels cleaner.


    Br

    Markus

    //Markus Näslund
  • I have a machine that is constatnly running a virtual controller for various test purposes. I would like it to start the virtual machine automatically after a restart.
    So, is it possible to start a virtual machine from commandline or by other means possible to schedule at startup of windows?

    Best regards
    Markus
    OK, you have mentioned both virtual controller and virtual machine.  Are you using them synonymously or are you running a virtual controller on a virtual machine?
    Lee Justice
  • lemster68 said:
    I have a machine that is constatnly running a virtual controller for various test purposes. I would like it to start the virtual machine automatically after a restart.
    So, is it possible to start a virtual machine from commandline or by other means possible to schedule at startup of windows?

    Best regards
    Markus
    OK, you have mentioned both virtual controller and virtual machine.  Are you using them synonymously or are you running a virtual controller on a virtual machine?
    My bad, I meant Virtual Controller both times, it is running on a real machine :)
    //Markus Näslund
  • scottdf93 said:
    I have a machine that is constatnly running a virtual controller for various test purposes. I would like it to start the virtual machine automatically after a restart.
    So, is it possible to start a virtual machine from commandline or by other means possible to schedule at startup of windows?

    Best regards
    Markus
    Most likely as its ran as a process using the communication server so an educated guess would be that you could call it parsing through arguments. You can create a console app which you can call from the command line with the following to start a controller;

    using ABB.Robotics.RobotStudio.Stations;

    RsIrc5Controller irc5= new RsIrc5Controller(directoryOfTheController);
    await irc5Controller.StartAsync(VirtualControllerRestartMode.WarmStart, mechanisms, false);
    I just tried this but it does not seem to work that easily. Too bad, it would have been a great solution.
    If anybody knows a way to start a virtual controller with the RobotStudio SDK and a console application any help would be greatly appreciated.
    I see you managed to get it to work in a similar way, the solution provided required using the dll for the RIM controller factory (this is how the installation manager creates controllers). Forgot to mention the mechanisms can be parsed as nulls.