Is it possible to return current Proc/Function name as a string?
jjwempe2
✭
in RobotStudio
I'd like to be able to reference the name of the currently executing Proc/Func/Trap with a simple call (see example below). Is there a function similar to "ArgName" that will work in this manner?
ex:
Expected on pendant: "Current Proc is TestProcName"
ex:
PROC TestProcName()
VAR string name;
name:=CurProcName();
TPWrite "Current Proc is "+name;
!rest of code
ENDPROC
Expected on pendant: "Current Proc is TestProcName"
0
Answers
-
Hi jjwempe2,
I don't know of anything built into RAPID, could you store the name in a global variable?
This implementation would require re-work of every function you use, which is probably extensive.
It would also require careful thought of error handling, error handling with long jump etc.
Do you just need to print the current function to the screen?
Regards,
Harry
0 -
What's the point of this instruction?
Is this done to make it easier to copy and paste the code, even if it might increase CPU usage?
It's not like the line:
TPWrite "Current Proc is "+name;
can move to a different routine at runtime?Systemintegrator - Web / C# / Rapid / Robotstudio
If I helped, please press Vote Up1 -
You can also try a Screenmaker Screen if you are using IRC5. You will have to modify/add variables to your system to get this screen working as you want it.
This is what I have done on my system to make my life a bit easier.
https://imgur.com/Xo0c32k
https://imgur.com/AK1LO9Y
There are other ways but this one seems to be working good enough for me.
0
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