Calling local routines
Resident
✭
Hi
Is it possible to call a LOCAL PROC using the FPSDK and callRoutine()? I can successfully call a globally declared PROC but not one declared local.
0
Comments
-
So I got around this in a similar way to the runRoutineButton, in that I set a global string indicating the local function to run, i.e. "myModule:myRoutine" and then I call a global routine that just does a late binding routine call on that string.This is obviously a horrible work around and I'm hoping that there is another option that doesn't require any global routines and variables. I figure that as a routine belongs to a module, there must be some way of passing in the module so that a local routine can be called.0
-
For anyone that is interested, here is the code I use:C#://Create bindingsController controller = new Controller();Task task = controller.Rapid.GetTask("myTask");Module runRoutineModule = task.GetModule("runRoutineModule");RapidData routineName = runRoutineModule.GetRapidData("routineToCall");//Set string indicating routine to callroutineName.Value = new ABB.Robotics.Controllers.RapidDomain.String("myModule:myRoutine");//Call global routinemyTask.CallRoutine("runRapidRoutine");//Dispose bindingsroutineName.Dispose();runRoutineModule.Dispose();task.Dispose();controller.Dispose();RAPID:MODULE runRoutineModule(SYSMODULE)PERS string routineToCall := "";PROC runRapidRoutine()IF routineToCall <> "" THEN%routineToCall%;ELSETPWrite "Routine name must be set before call";RETURN;ENDIF
routineToCall := "";ERROR
routineToCall := "";RETURN;UNDO
routineToCall := "";ENDPROCENDMODULE
Resident2012-01-17 05:04:450
Categories
- All Categories
- 5.5K RobotStudio
- 395 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 310 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