Copy Directory
Hey all, I am new to the RAB 5.11 PC SDK. I am simlpy trying to copy a directory from my pc to the HOME directory of a selected IRC5 controller. This is my code in C# .Net:
ControllerBrowser cb = new ControllerBrowser();
cb.ShowDialog();
Controller selectedController = cb.SelectedController;
selectedController.Logon(UserInfo.DefaultUser);
selectedController.FileSystem.PutDirectory(@C:Documents and SettingsuserMy DocumentsData,true);
The controller browser is similar to the simple PC SDK network scannner application from the RAB User Guide.
When I run the program I get an unhandled "System.Exception" thrown for which there is not much explanation.
Can anybody please help me?
0
Comments
-
BTW I am using a virtual controller right now running on RobotStudio 5.110
-
Do you check the property "LocalDirectory"/"RemoteDirectory" of "FileSystem" before you copy directory?
I got similar problem before when I tried to send/get file from controller? I need assign these properties before I send/get file.
I am not sure if this will work. But you can try it.
0 -
I did check the LocalDirectory and RemoteDirectory properties of the FileSystem. They both seem to be set correctly. Since the controller is virtual the RemoteDirectory is set to be the directory on the local computer in which the system's HOME directory is located (C:/Documents and Settings/user/My Documents/RobotStudio/Systems/System123/HOME)I am also having trouble with the GetDirectory method.selectedController.FileSystem.GetDirectory(@C:/Documents and Settings/user/My Documents/RobotStudio/Systems/System123/HOME, true);This gives me a DirectoryNotFoundException even thought I can browse to this location using the FlexPendant Explorer on the virtual flexpendant in RobotStudio.I'm not sure if the fact that the controller is a virtual controller is giving me a problem?0
-
How about the LocalDirectory? For instance, if you want to copy a file "C:\Folder\test.txt" to the robot's HOME directory, the LocalDirectory should be "C:\Folder". Then when you use PutFile function, you just need specify the file name "test.txt".
For the GetDirectory method, do you try "false" instead. It seems that you want to overwrite the directory as you use "true".
Virtual robot or real robot should not make these functions work differently. We use same functions to manipulate both virtual and real robots.
0 -
Thanks newform.It seems that I was just confused about the usage of the LocalDirectory and RemoteDirectory properties of the FileSystem object. I now have it working correctly.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