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
Best 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 Up
☑️2024 - RobotStudio® User Group0
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
- 60 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 796 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings