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