" INTP-311 (MODIF_TCP, 84) Uninitialized data is used"

  • Hello everybody,


    I new in Fanuc, especially in karel (lol).

    I get an issue during the execution of the routine below at the line 84:

    There is no any problem of building, only when i execute.

    I tried many different ways to initialise the variable "xyz_TCP_Set" but i did not success.


    Is anybody here having a solution for my problem ? Thanks ahead.


    PROGRAM Modif_TCP


    --********************************--

    -- PROGRAMME Modif_TCP --

    --********************************--

    --

    --Mettre la variable $KAREL_ENB à 1 pour pouvoir selectionner un programme KAREL

    --

    %ALPHABETIZE -- Specifies that variables will be created in alphabetical order when

    -- p-code is loaded.

    %COMMENT = 'SET TCP PINCEBATTEUR' -- Specifies a comment of up to 16 characters. During load time

    --, the comment is stored as a program attribute and can be displayed

    -- on the SELECT screen of the teach pendant or CRT/KB.

    %NOLOCKGROUP -- Specifies that no motion groups will be locked by this task.

    %NOPAUSE =ERROR + COMMAND + TPENABLE -- option Specifies a set of conditions

    -- which will be prevented from pausing the program.

    %NOPAUSESHFT -- Specifies that the task is not paused if the teach pendant

    %INCLUDE klevccdf -- Character code constants : CHR()


    VAR

    xyz_TCP_Ref : XYZWPR

    xyz_TCP_Set : XYZWPR

    Pose_Modify : XYZWPR


    PR_value: XYZWPREXT


    i_NumToolRef : INTEGER

    i_NumToolSet : INTEGER


    i_Num_PR : INTEGER


    st_NumToolRef : STRING[1]

    st_NumToolSet : STRING[1]


    -- Pour lecture paramètres

    i_val : INTEGER

    r_val : REAL

    st_val : STRING [1]

    i_Status : INTEGER

    i_Entry : INTEGER

    b_Flag : BOOLEAN


    BEGIN

    --Lecture paramètre entrée routine

    --GET_TPE_PRM(param_no, data_type, int_value, real_value, str_value, status)

    --data_type=1 >> int_value

    --data_type=2 >> real_value

    --data_type=3 >> str_value


    --Conversion entier en string

    --CNV_INT_STR(source,length,base,target)

    --source >> integer

    --length >> minimum length of target

    --base >> 0 if (base)10 , between 2-16

    --target >> string destination


    --param 1 : Read TCP Ref number

    GET_TPE_PRM(1,1,i_NumToolRef,r_val,st_val,i_status)

    CNV_INT_STR(i_NumToolRef,1,10,st_NumToolRef)


    --Read TCP Ref

    GET_VAR(i_Entry,'*SYSTEM*','$MNUTOOL[1,'+st_NumToolRef+']',xyz_TCP_Ref,i_Status)


    --param 2 : Read TCP Set number

    GET_TPE_PRM(2,1,i_NumToolSet,r_val,st_val,i_status)

    CNV_INT_STR(i_NumToolSet,1,10,st_NumToolSet)


    --Read TCP Set

    GET_VAR(i_Entry,'*SYSTEM*','$MNUTOOL[1,'+st_NumToolSet+']',xyz_TCP_Set,i_Status)


    --param 3 : Read PR with transform values

    GET_TPE_PRM(3,1,i_Num_PR,r_val,st_val,i_status)

    PR_value=GET_POS_REG(i_Num_PR,i_Status)


    --Affect Pose_Modify

    Pose_Modify.X=PR_value.X

    Pose_Modify.Y=PR_value.Y

    Pose_Modify.Z=PR_value.Z

    Pose_Modify.W=PR_value.W

    Pose_Modify.P=PR_value.P

    Pose_Modify.R=PR_value.R


    --TCP Transform

    xyz_TCP_Set = xyz_TCP_Ref:Pose_Modify >>------------------------------------------------>>" INTP-311 (MODIF_TCP, 84) Uninitialized data is used"


    --Write TCP Set

    SET_VAR(i_Entry,'*SYSTEM*','$MNUTOOL[1,'+st_NumToolSet+']',xyz_TCP_Set,i_Entry)


    END Modif_TCP

  • I think xyz_TCP_Ref is uninitialized.


    Check the value of i_Status after:

    GET_VAR(i_Entry,'*SYSTEM*','$MNUTOOL[1,'+st_NumToolRef+']',xyz_TCP_Ref,i_Status)


    If not equal to 0, then an error occurred.

  • hi


    thanks for the reply is uninitialized because of 2 issues :

    -xyz_TCP_Ref has to be a position (apparently, with this data type i can get tool value not with XYZWPR datatype)

    -st_NumToolRef is equal to ''


    This gets me to another issue:

    >>CNV_INT_STR(i_NumToolRef,1,10,st_NumToolRef) does not work

    >>i can not set a string greater than 1 in the VAR declaration area ?????


    each time i tried, i get the following message:

    "Build Failed: ????-598 $ 182256, no message found

    0x100016 - File modif_tcp.pc"


    Can u help me please ??


    here is the new code:


    PROGRAM Modif_TCP


    --********************************--

    -- PROGRAMME Modif_TCP --

    --********************************--

    --

    --Mettre la variable $KAREL_ENB à 1 pour pouvoir selectionner un programme KAREL

    %CMOSVARS

    %COMMENT = 'SET TCP PINCEBATTEUR' -- Specifies a comment of up to 16 characters. During load time

    VAR

    st_Utool_Ref : STRING[1]

    st_Utool_Set : STRING[1]


    Utool_Ref : POSITION

    Utool_Set : POSITION

    Utool_Tr : POSITION


    PR_value: XYZWPREXT


    i_NumToolRef : INTEGER

    i_NumToolSet : INTEGER

    i_Num_PR : INTEGER


    bMAP : BOOLEAN


    -- Pour lecture paramètres

    i_val : INTEGER

    r_val : REAL

    st_val : STRING [1]

    i_Status : INTEGER

    i_Entry : INTEGER

    b_Flag : BOOLEAN


    ROUTINE EFFACE_ECRAN

    BEGIN

    WRITE (CHR(128),CHR(137))

    WRITE TPERROR (CR,' ',CR)

    WRITE TPSTATUS(CR,' ',CR)

    WRITE TPPROMPT(CR,' ',CR)

    WRITE TPFUNC (CR,' ',CR)

    FORCE_SPMENU(TP_PANEL,SPI_TPUSER,1) -- Force ecran sur USER

    END EFFACE_ECRAN


    BEGIN

    EFFACE_ECRAN

    bMAP = TRUE


    --Lecture paramètre entrée routine

    --GET_TPE_PRM(param_no, data_type, int_value, real_value, str_value, status)

    --data_type=1 >> int_value

    --data_type=2 >> real_value

    --data_type=3 >> str_value


    --param 1 : Read TCP Ref number

    GET_TPE_PRM(1,1,i_NumToolRef,r_val,st_val,i_status)


    --param 2 : Read TCP Set number

    GET_TPE_PRM(2,1,i_NumToolSet,r_val,st_val,i_status)


    --param 3 : Read PR number

    GET_TPE_PRM(3,1,i_Num_PR,r_val,st_val,i_status)


    --Read Tool Ref

    CNV_INT_STR(i_NumToolRef,1,0,st_Utool_Ref)


    st_Utool_Ref='1'


    GET_VAR(i_Entry,'*SYSTEM*','$MNUTOOL[1,'+st_Utool_Ref+']',Utool_Ref,i_Status)

    IF (bMAP=TRUE) THEN

    WRITE ('Utool_Ref:',Utool_Ref,CR)

    ENDIF


    --Read Tool Set

    CNV_INT_STR(i_NumToolSet,1,0,st_Utool_Set)


    st_Utool_Set='1'


    GET_VAR(i_Entry,'*SYSTEM*','$MNUTOOL[1,'+st_Utool_Set+']',Utool_Set,i_Status)

    IF (bMAP=TRUE) THEN

    WRITE ('Utool_Set:',Utool_Set,CR)

    ENDIF


    --Read PR value

    PR_value=GET_POS_REG(i_Num_PR,i_Status)

    IF (bMAP=TRUE) THEN

    WRITE ('PR_value:',PR_value,CR)

    ENDIF


    --TCP Transform

    Utool_Set = Utool_Ref:PR_value

    WRITE (Utool_Set,CR)


    --Write TCP Set

    SET_VAR(i_Entry,'*SYSTEM*','$MNUTOOL[1,'+st_Utool_Set+']',Utool_Set,i_Status)

    WRITE ('i_Status=',i_Status,CR)


    END Modif_TCP

  • st_NumToolRef : STRING[1]


    You declared st_NumToolRef to have a size of 1 character. I think you need to make it the size of the number of digits in your integer plus 1 for the terminating character.

  • I see what you mean now.

    That is weird. I would look in the KAREL user manual for an example that uses STRINGs. Copy the example into a new program and try to build it. Verify that you use the user manual that matches your version of the KAREL compiler.

  • you were right... I have copied the code in a new one, i succeed to modify a string size in the var area . The build was ok and after test in the controller it works very well....


    It was a latent bug in roboguide, amazing....


    really thanks for ur help.

Advertising from our partners