Test if PROC is defined
Laro88
✭
I have a case where I would like to execute a PROC if it is defined.
My case is that I upload a RAPID program, and if the program has a special PROC defined, then I would like to execute it...
Basically in pseudocode
IF (defined(nn)=true) THEN
EXEC nn;
ENDIF
Is this possible in RAPID?
My case is that I upload a RAPID program, and if the program has a special PROC defined, then I would like to execute it...
Basically in pseudocode
IF (defined(nn)=true) THEN
EXEC nn;
ENDIF
Is this possible in RAPID?
0
Comments
-
Hello,Yes, you should be able to do this. One suggestion is by first searching for the Proc symbol (see SetDataSeach and GetNextSym instructions) to find the Proc name, and then use "late binding" to execute the proceedure (put the Proc Name into a string and then call the string as a proc with %stringname%)You could also skip the symbol searching and simply call the procedure using late binding, if the procedure exists, it will be called, otherwise an error will occur and you can handle the error automatically in the error handler of the procedure.Steve0
-
Ok, thanks for the suggestions - I will try it out soon.
Too bad there is not "PROC_isDeFined(String_ProcName)" method hidden somewhere
0 -
Steve_Murphy said:Hello,Yes, you should be able to do this. One suggestion is by first searching for the Proc symbol (see SetDataSeach and GetNextSym instructions) to find the Proc name,I'm trying to do exactly this, but I can't figure out how to do it.How can you search PROC names with SetDataSearch?For example if i'm trying to find all PROCs that begin with a word Process. What should I use as SetDataSearch Type argument?SetDataSearch "??????"\Object:="Process*";WHILE GetNextSym(name,block \Recursive) DOTPWrite("found: " + name);ENDWHILE0
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)
- 801 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings