<< Click to Display Table of Contents >> Navigation: 3. Script Language > Debugging - Commands > Debugging Commands |
MiniRobotLanguage (MRL)
USM. - prevent error messages
Use Silent Mode * prevent and redirect error messages
Intention
These command is used to tell the robot what to do in case of errors. Its mostly used to prevent errors popping up on client computers. Use it together with the
Label 2.2 :on_Error - Label.
For more details on Error handling see: 1.B Error handling .
Syntax
USM.[P1][|P2]
Parameter Explanation
P1 -(optional) numeric parameter, if omitted, 32 is the default value
0 - immediately end the script, no error handling.
Can not be combined with other flags.
:on_Error Label will be ignored!
1 - just Beep on error, no error message,
add +4 to make script continue running
2 - redirect all console Messages to a file,
use this together with Flag 8 to log all errors in a file
4 - ignore error-line and continue script execution,
if possible. :on_Error Label will be ignored! Has priority
over additional options, like 32 (pressing CANCEL).
8 - Redirect Error-Message to Console window,
use this together with Flag 2 to log all errors in a file
16 - Show error-message for ~ 50 Seconds, then kill Message
and End Script.
32 - Normal / default-Mode:
Show Messagebox with "Retry/Cancel". If user presses
"Retry", Error line will be skipped, like in Option 4.
64 - Clear ":on_Error" Stop-Flag. See remark below for this
special option.
P2 - Path of the Error-Log file. If omitted:
In case the script runs from Editor, ?path\MR_Error.log
else, ?cdesktop\MR_Error.log is used.
Example
'***********************************************
' USM. - Samples
'***********************************************
'Switch on silent Mode
USM.10
' Switch on Silent Mode with Error-Log file
USM.10|?pfad\MyLog.txt
' Clear ":on_Error" Retry Flag
USM.64
' Switch off Silent Mode
USM.0
END.
:on_Error
MBX. There was an Error
'***********************************
' USM.-Demo
'***********************************
'
USM.10|?desktop\MR_Error.log
STW.tw|Nix|0
MBX.Ready
'-----------------------------------------------------------
ENR.
:on_Error
: $$ERF=?exepath\MR_Error.log
MBX.$$ERF
IEF.$$ERF
COP.$$ERF|?cdesktop\MR_Error.log
EIF.
MBX. AN error happened!
ENR.
Remarks
Remark to Option "64":
In case there is a Label ":on_Error" somewhere in the script,
the robot will jump there in case of an error.
To prevent a circular reference, if the error is in the part after ":on_Error", there is an internal safety-flag that will prevent the "on_Error" to be called a second time.
This flag can be cleared to (retry aomething) using USM.64
USM.0 does not do any defined action in case of error. The script will just end.
However it will not even run into the :on_Error Label.
USM.2 will redirect all console output to the error-log file. This includes all output from any command that writes to the console.
ParallelRobots (PRR. - PRE.) do actually not run in he Editor and may use the ?cdesktop\MR_Error.log Log-Path
even, if the Main-Script runs in the Editor.
Limitations:
-
See also: