IF Statement in Rapid
mark457b
✭
Hello im thinking of inserting an if statement so if the criteria is fulfilled it jumps to a certain place in the Rapid Program.
If i wanna do this in the program i have attached as a picture here.
I know in other programming tools you could say if diAkselInPos,1 jump to line 41.
How would i go about doing that in RobotStudio?
If i wanna do this in the program i have attached as a picture here.
I know in other programming tools you could say if diAkselInPos,1 jump to line 41.
How would i go about doing that in RobotStudio?
Tagged:
0
Comments
-
Would i use jumplabel ?
0 -
The statement is GOTO in Rapid. Some purists really dislike those. There are many ways in Rapid to accomplish the same result. Some clean and tidy, some not so much. You could call a subroutine if this condition is met and then return to where you leave off in this routine. Many, many ways to go about it. The only limit is your knowledge and creativity. The knowledge will come, keep at it.Lee Justice1
-
Thanks lemster68 😊
I will keep at it !0 -
Hello,RAPID is more like python or other evolute language.You have to insert inside the IF statement what you have to do like in C.So for your example, Add "IF yourcondition THEN" at line 40-41 and "ENDIF" at line 80-81.Here an example from RAPID help:IF reg1 > 5 THEN
Set do1;
Set do2;
ELSE
Reset do1;
Reset do2;
ENDIFLike lemster68 said avoid a max GOTO as this get your code unreadable and may cause bug.1
Categories
- All Categories
- 5.5K RobotStudio
- 394 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 309 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