Try, Catch equivalent [moved from RobotStudio]
Patient
✭
Hi,
Is there anything in RAPID, equivalent to using try and catch statements in C#?
I am trying to read CSV files but want my program pointer to go back to main when it fails to open a file without resetting the robot or acknowledging any errors.
Is there anything in RAPID, equivalent to using try and catch statements in C#?
I am trying to read CSV files but want my program pointer to go back to main when it fails to open a file without resetting the robot or acknowledging any errors.
Post edited by Jonathan Karlsson on
0
Comments
-
Hi,
you can use the error handler inside each routine to handle this problem.
Example:
PROC ReadCSV()
Open "HOME:" \File:= "Mydata.CSV", logfile \Read;
ERROR
IF ERRNO = ERR_FILEOPEN THEN
!Handle the error
EXIT;
ENDIF
ENDPROC
Please refer to the RAPID manual for further information.
Regards
Micky
0
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