Load program/module from file
neil
✭
Hi,
I am trying to use RAB 5.10 to load program/module files, located on the robot controller memory. The program and module I am trying to access is located in "/hd0a/SystemName/Test".
I have created a controller object, logged into the controller as the default user and taken mastership:
###############################################
controller = ControllerFactory.CreateFrom(controllerInfo);
tasks = controller.Rapid.GetTasks();
using (Mastership m = Mastership.Request(controller.Rapid))
{
string remoteDir = controller.FileSystem.RemoteDirectory + "/../Test/";
string fileP = remoteDir + "Test.pgf";
string fileM = remoteDir + "MainModule.mod";
tasks[0].LoadProgramFromFile(fileP, RapidLoadMode.Replace);
tasks[0].LoadModuleFromFile(fileM, RapidLoadMode.Add);
MessageBox.Show(fileP + "is active program");
}
##############################################
controller.FileSystem.RemoteDirectory returns the
string, "/hd0a/SystemName/Home"
The string fileP returns: "/hd0a/SystemName/Home/../Test/Test.pgf"
The string fileM returns: "/hd0a/SystemName/Home/../Test/MainModule.mod"
I get a "General file hadling error", and there is no program loaded onto the controller. The files do exist on the controller memory.
Any ideas what the problem is??
Thanks in advance,
Neil
neil2008-1-29 14:47:34
0
Comments
-
I tried exactly the code you supplied, and it worked for me.
When I loaded the .pgf first and then the .mod, like you do, however, I got an exception when loading the module "Operation is illegal in current execution state", which should not be exposed to the RAB user. It is because a .pgf always executes a short while when loaded, and when trying to load the module the program is still executing. So we try once again to load the module and succeed because execution has now stopped. (When I loaded the module first and then the program I did not get any exception. In both cases both .pfg and .mod were loaded.)
So, I don't know what the File handling error you got can be. Have you figured it out? Is there anything wrong with the files?Best regards,
Ingela Brorsson
Software Engineer
ABB Robotics, Sweden0
Categories
- All Categories
- 5.5K RobotStudio
- 394 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 309 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings