Generate a program error with a custom program error number

edited January 9 in RobotStudio

The instruction "ErrWrite" is used to generate and display an error message on the teach pendant and, in case of a program error, the error number is 80001.
Is it possible to define a custom error number?
Thank you


  • lemster68
    lemster68 ✭✭✭
    I  think that you might use BookErrNo to first RAISE the error, then use ErrWrite to write to the log and/or pendant.  I think that the only real significance for the 80001 is that it has it's own error domain then.
    Other than that, a programmer can declare their own error numbers, just like any pre-defined data, and Raise an error using that number.
    Lee Justice
  • dragolollo
    I think the way is to use ErrLog.
    It seems like if you use ErrWrite the only possible error number is 80001and if you use ErrRaise you can define your own error number but it only generates warnings.