How to load RAPID into VC with PC SDK
Dear All
According to PC SDK user manual v2, I wrote some codes by CAPI to connect virtual controller and load RAPID module as follows:
... ...
m_controller = ControllerFactory.CreateFrom(controller);
m_controller.Logon(UserInfo.DefaultUser);
if(m_controller.OperatingMode != ControllerOperatingMode.Auto)
{
//set to Auto mode
VirtualPanel vp = VirtualPanel.Attach(m_controller);
vp.ChangeMode(ControllerOperatingMode.Auto);
}
using(Mastership master = Mastership.Request(m_controller.Rapid))
{
try
{
Task taskMain = m_controller.Rapid.GetTask("T_ROB1");
taskMain.LoadProgramFromFile("C:\Data\System1\HOME\MainMod.pgf", RapidLoadMode.Replace);
master.Release();
}
catch(GeneralException)
{
master.Release();
throw;
}
}
The code did work until calling LoadProgramFromFile/LoadModuleFromFile, which threw InternalException. "CDataSystem1Internal" is the directory of virtual controller.
Could you please tell me the correct way to use LoadProgramFromFile/LoadModuleFromFile? Thanks.
Comments
-
Hi Levy,
you should use FileSystem.RemoteDirectory+"rest of path". Observe that RemoteDirectory is RobotWare_xxxxx/vcbin if you use VIRC5, but System/HOME on the real controller. LocalDirectory is System/INTERNAL for VIRC5. Try to place your program file in one of these places.
Reply if this works out. I'm interested in finding out why else it doesn't work. Please specify version 5.05 or 5.06 also.
Urban Vikblom
CONTAB0
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)
- 798 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings