Click or drag to resize

ControllerBackup Method

This method starts a backup of the current robot system.

Namespace:  ABB.Robotics.Controllers
Assembly:  ABB.Robotics.Controllers (in ABB.Robotics.Controllers.dll) Version: 6.5.129.0
Syntax
C#
public void Backup(
	string backupDir
)

Parameters

backupDir
Type: SystemString
Path to backup directory
Exceptions
ExceptionCondition
GeneralExceptionA General Exception has occurred.
Examples
This example takes a backup and stores it on the robot controller. In this example a controller object 'c' has already been created. The event is a button clicked event. The naming of the backup is just an example, you can create your own standard.
private string _formatInteger(int number)
{
   string answer = string.Empty;
   if (number >= 10)
   {
         answer = integer.ToString(); 
   }
   else
   {
         answer = "0" + integer.ToString();
   }
    return answer;
}
private void c_BackupFinished(object sender, ABB.Robotics.Controllers.BackupEventArgs mode)
{
   c.BackupFinished -= new ABB.Robotics.Controllers.BackupEventHandler(c_BackupFinished);
   if (mode.Succeeded)
   {
       // Do something
   }
   else
   {
       // Report the error
   }
}

private void backup_Click(object sender, System.EventArgs e)
{
    try
    {
        c.BackupFinished +=new ABB.Robotics.Controllers.BackupEventHandler(c_BackupFinished);
        FileSystem f = c.FileSystem;
        f.RemoteDirectory = "(TEMP$)";
        // Compose backup directory name
        string nameOfDir = "Backup_" + _formatInteger(c.Time.Year) + _formatInteger(c.Time.Month) + 
            _formatInteger(c.Time.Day);
        c.Backup(f.RemoteDirectory+nameOfDir);    
    }
    catch (System.Exception ee)
    {
        c.BackupFinished -=new ABB.Robotics.Controllers.BackupEventHandler(c_BackupFinished);
        // handle error situation
    }
}
See Also