Karel Post_Err - Data for Parameter Value

  • I am trying to use the Post-Err function to generate a User Alarm.

    I have the following:

    POST_ERR_L(12213,'', 0, iUASeverity)

    This provides the proper TP alarm (INTP-213) and the proper UALM severity code is utilized. However, the text indicated at the top to the TP is

    INTP-213 %s^7 (%s^4, %d^5) UALM[%d^9)

    I believe %^7 is the text comment entered for the User Alarm number, %s^4 is the program name being executed, %d^5 is the program line number being executed, and %d^9 is the User Alarm number.

    The Karel manual indicates the parameter value setting "will be included in error_code's message if %s is specified in the dictionary text. If not necessary, then enter the null string."

    I do not understand how to structure the parameter value so that the proper data is used for %s^7 (%s^4, %d^5) UALM[%d^9).

    Any ideas?


  • Place your Ad here!
  • From what I understand, it is quite normal to have "INTP-213 %s^7 (%s^4, %d^5) UALM[%d^9)" as an error message for "12213".

    POST_ERR and POST_ERR_L are used to get more information about a STATUS output of a Karel function.

    Like this:

    SEND_EVENTPC(12,status) -- built-in call here

    IF status<>0 THEN



    If you want to display the name of the program you are currently using, I suggest looking for an already functional error code that has the program name as output.

  • I've always been told it's not possible for regular Karel programs to provide values for the fields you refer to.

    Whether that's true or not I can't say.

    It's certainly the case Fanuc in their own programs is able to use POST_ERR to post those errors with the error string filled with the values they give to POST_ERR.

  • I am just looking for a method to fault the robot and apply appropriate text when the alarm condition occurs so that the alarm message is useful to the user and is saved to the alarm log - I am not locked into displaying the name of the program. I am able to use the WRITE function to provide appropriate text on the user screen but when also using the POST_ERR_L(12213,...) function to cause a robot fault, the alarm message is not helpful when referring to the active alarm and/or alarm log - INTP-213 %s^7 (%s^4, %d^5) UALM[%d^9).

    I selected POST_ERR_L(12213,...) since the alarm condition in my program is functionally the same as using the UALM[ ] condition in a TP program. In a TP program, the UALM[ ] creates the INTP-213 alarm and I was just trying to follow this format.

    I tried using the WRITE TPERROR command and can display the text message I want to appear but this does not cause the robot to fault nor does it appear in the alarm log.

    Any suggestions?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Register a new account
Sign in
Already have an account? Sign in here.
Sign in Now

Advertising from our partners