PC SDK "GetDirectory" problem
PeterG
✭
Hi All,
Basic concept is to creat a backup on the flexpendent controller and the copy that directory to the local HDD of the PC that is running the SDK but I keep having a problem getting the "CopyDirectory" or "GetDirectory" methods to work!
My Code:
//string st_BackUp = this.controller.SystemName;
string st_BackUp = this.controller.SystemName + "_TEST";
string st_RobotDirectoryPathCk = ("");
string st_folderName = "C:\\TEMP_NS";
string st_RobotDirectoryPath = "";
string st_LocalBackupPath = Path.Combine(st_folderName, st_BackUp);
//Create string for comparision between path name methods
st_RobotDirectoryPathCk = this.controller.FileSystem.RemoteDirectory;
// Create second controller directory path string using different method
st_RobotDirectoryPath = controller.GetEnvironmentVariable("HOME") + @/;
string st_RobotBackupPath = (st_RobotDirectoryPath + "/" + st_BackUp);
// Display path
MessageBox.Show("current Robot Directory is set to: " + st_RobotDirectoryPath);
MessageBox.Show("current Robot Directory check is set to: " + st_RobotDirectoryPathCk);
//Create backup in HOME or BACKUP directory with system name.
this.controller.Backup(st_BackUp);
while (this.controller.BackupInProgress)
{
MessageBox.Show("Backup In progress");
}
MessageBox.Show("Backup complete");
// Create directory on local system and copy backup to that location.
Directory.CreateDirectory(st_LocalBackupPath);
this.controller.FileSystem.GetDirectory(st_RobotBackupPath, st_LocalBackupPath);
I Have tried writing the file paths but stll have the same problem.
error message when running "GetDirectory": "Operation is not valid due to the current state of the object"
Any help appreciated,
Running RS 5.15.02, VS2010 C# Express.
Basic concept is to creat a backup on the flexpendent controller and the copy that directory to the local HDD of the PC that is running the SDK but I keep having a problem getting the "CopyDirectory" or "GetDirectory" methods to work!
My Code:
//string st_BackUp = this.controller.SystemName;
string st_BackUp = this.controller.SystemName + "_TEST";
string st_RobotDirectoryPathCk = ("");
string st_folderName = "C:\\TEMP_NS";
string st_RobotDirectoryPath = "";
string st_LocalBackupPath = Path.Combine(st_folderName, st_BackUp);
//Create string for comparision between path name methods
st_RobotDirectoryPathCk = this.controller.FileSystem.RemoteDirectory;
// Create second controller directory path string using different method
st_RobotDirectoryPath = controller.GetEnvironmentVariable("HOME") + @/;
string st_RobotBackupPath = (st_RobotDirectoryPath + "/" + st_BackUp);
// Display path
MessageBox.Show("current Robot Directory is set to: " + st_RobotDirectoryPath);
MessageBox.Show("current Robot Directory check is set to: " + st_RobotDirectoryPathCk);
//Create backup in HOME or BACKUP directory with system name.
this.controller.Backup(st_BackUp);
while (this.controller.BackupInProgress)
{
MessageBox.Show("Backup In progress");
}
MessageBox.Show("Backup complete");
// Create directory on local system and copy backup to that location.
Directory.CreateDirectory(st_LocalBackupPath);
this.controller.FileSystem.GetDirectory(st_RobotBackupPath, st_LocalBackupPath);
I Have tried writing the file paths but stll have the same problem.
error message when running "GetDirectory": "Operation is not valid due to the current state of the object"
Any help appreciated,
Running RS 5.15.02, VS2010 C# Express.
0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 799 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings