Posts by makrobot
-
-
I have another question. When using the CNV_INT_STR function, the result returns a leading blank.
For example, if my variable iArg5 = 5, using the CNV_INT_STR function returns a result of " 5", not "5".
This trips me up as I am trying to utilize this value to get a parameter value which has an array:
CNV_INT_STR(iArg5,1,0,String10)
String20 = '$UALRM_MSG[' + String10 + ']'
The result for String20 is $UALRM_MSG[ 5] rather than $UALRM_MSG[5]. This causes me a problem when using the GET_VAR function where I need the proper string of $UALRM_MSG[5].
Any help is appreciated.
-
-
Looking for a way to combine text and a variable integer for a string in Karel. Tried the following but it will not compile:
VAR
Arg1 : Integer -- This is a variable based on argument value entered when program is called.
String1 : String[32]
String1 = 'UALM', String 1 --DOES NOT COMPILE
String1 = 'UALM' + String1 -- DOES NOT COMPILE
--Trying to utilize result to provide test for
Post_Err(38000, String1, 0 1)
Any ideas if this can be done and if so, what is proper syntax to combine text and integer in string?
-
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?
-
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?
Thanks.