Hi All.
Running into trouble with one of FANUC's KAREL example programs. The error I am encountering pertains specifically to the handling of data types within the program. It occurs when the interpreter tries to assign a value to the identifier TMP_XYZ. Here are my declared variables and lines of code where I'm getting the error:
VAR --Variable Declaration
cont_timer,
last_node, node_ind,
status :INTEGER --Status from builtin calls
prg_abrt :BOOLEAN --Set when the program is aborted
pth1 :PATH --Process Path
stop_pos :XYZWPREXT --Process Stop Postion
perch_pos :XYZWPR --Process Perch Position
tmp_xyz :XYZWPR --XYZWPR variable for temp use
indx :INTEGER -- Used a FOR loop Counter
ports_ready: BOOLEAN --Check if Port is assigned.
cmt_str :STRING[10] --Comment String
.
.
.
.
.
IF DOUT[EQIP_READY] THEN
tmp_xyz = pth1[1] -- Convert path node to XYZWPR
SET_POS_REG(25, tmp_xyz, status) -- Put position in PR[25]
frst_nod -- Call TP program to do move
FOR node_ind = 2 TO (last_node - 1) DO
tmp_xyz = pth1[node_ind]
SET_POS_REG(25, tmp_xyz, status)
mid_nods
ENDFOR
tmp_xyz = pth1[last_node]
SET_POS_REG(25, tmp_xyz, status)
end_nod
ELSE
FORCE_SPMENU(TP_PANEL,SPI_TPUSER,1)
WRITE (' Equipment is NOT READY',CR)
WRITE (' Set equipment TO READY MODE',CR)
WRITE (' BEFORE executing this PROGRAM.',CR)
WRITE (' SET DOUT[’,EQIP_READY,’] = TRUE ',CR)
ABORT
ENDIF
Display More
I am then met with the following errors when trying to compile:
397 tmp_xyz = pth1[1] -- Convert path node to XYZWPR
^ ERROR
Data type of Id is incompatible with right hand side. Id: TMP_XYZ
401 tmp_xyz = pth1[node_ind]
^ ERROR
Data type of Id is incompatible with right hand side. Id: TMP_XYZ
405 tmp_xyz = pth1[last_node]
^ ERROR
Data type of Id is incompatible with right hand side. Id: TMP_XYZ
Display More
These lines of code are directly from Example B.1 in the KAREL reference manual. Considering this, it seems likely that the issue might involve either an incorrect data type declaration or a mismatch between the data types expected by the operation and those actually provided. I've tried declaring temp_xyz as XYZWPREXT and that unfortunately did not resolve the issue.
Any thoughts appreciated! Thanks.