Get current executed Code in PC SDK?

Neuling
✭
Hello,
I'm new to PC SDK.
We start a program on the Flexpendant and now we want to get the currently running code via PC SDK. I've already tried a lot. I can get all sorts of information about the PC SDK, just not the code that is currently running. Is there a possibility? If yes how?
We start a program on the Flexpendant and now we want to get the currently running code via PC SDK. I've already tried a lot. I can get all sorts of information about the PC SDK, just not the code that is currently running. Is there a possibility? If yes how?
0
Answers
-
I believe what you may be looking for is something like the following.strmod=controller.Rapid.GetTask("").ProgramPointer.Module;strRout=controller.Rapid.GetTask("").ProgramPointer.Routine;
This will return the string that shows the current robot module and routine. If you are trying to get the line of code that it is currently on in a text format, it appears you may be best off saving the mod file to the computer using the pcsdk and using controller.Rapid.GetTask("").ProgramPointer.Range; to get the exact line of code and reading it from the text file. I hope that is not what you mean as it will change very quickly, and I don't see how it would be of much use. If you have a use case for it I would be interested as you may be better off using the motion pointer as your reference instead.0 -
I have made a component that does what you want, so it is fully possible.
I think it's useful when running background tasks, as they are not as easy to view in the flexpendant.
Systemintegrator - Web / C# / Rapid / Robotstudio
If I helped, please press Vote Up0
Categories
- 10.4K All Categories
- 5.3K RobotStudio
- 352 UpFeed
- 15 Tutorials
- 9 RobotApps
- 282 PowerPacs
- 404 RobotStudio S4
- 1.8K Developer Tools
- 239 ScreenMaker
- 2.6K Robot Controller
- 252 IRC5
- 36 OmniCore
- 6 RCS (Realistic Controller Simulation)
- 3 RobotStudio AR Viewer
- 703 RAPID Programming
- 14 Wizard Easy Programming
- 107 Collaborative Robots
- 3 Job listings