RobotStudio event

Backing up a controller via an Addin

I have an addin with a button to be able to backup all controller found on a network scan.

This works perfectly for virtual controllers but i get a generic error when attempting to backup online (real world) controllers. See below for how i currently do it. Any suggestions on another approach?

            NetworkScanner runningcontrollers = new NetworkScanner();
            runningcontrollers.Scan();
            ControllerInfo[] aCollection = runningcontrollers.GetControllers();
            int NumOfActiveControllers = aCollection.Count();

            if (NumOfActiveControllers != 0)
            {
                for (int i = 0; i < aCollection.Count(); i++)
                {
                    systemId = aCollection[i].SystemId;
                    Controller con = new Controller(systemId);
                    con.BackupCompleted += Con_BackupCompleted;

                    con.Logon(UserInfo.DefaultUser);

                    con.Backup("C:\temp\backups");

Comments

  • Hello!

    When you backup using con.Backup the path you specify as an argument is the path on the remote controller and not the path on your local machine. It could for example be
    /hd0a/XXX-XXXXX/HOME/MyBackup.

    If you want to save the backup to your local machine you could first copy it over from the remote controller to your local machine and then remove the backup from the controller.

    Adam Gustavsson
    PC Software Support Engineer
  • scottMHA
    scottMHA
    edited October 2018
    thanks
  • AdamSG said:
    Hello!

    When you backup using con.Backup the path you specify as an argument is the path on the remote controller and not the path on your local machine. It could for example be
    /hd0a/XXX-XXXXX/HOME/MyBackup.

    If you want to save the backup to your local machine you could first copy it over from the remote controller to your local machine and then remove the backup from the controller.
    Hi Adam,

    You mention above that i need to copy the backup from the remote controller but when attempting to do so using both the FileSystem.GetDirectory and FileSystem.CopyDirectory i get the exception "Object reference not set to an instance of an object".

    Both the remote file and destination exists, any ideas on this?
  • What version of PCSDK are you using?
    Johannes Weiman
    Software Engineer
    RobotStudio Team, ABB Robotics
  • What version of PCSDK are you using?
    6.07