KSS8.6.2
A sendRobotStatus.sub program which send robot postion (pos, and axis value) to external system as below,
RET=EKI_Init("sendRobotStatus")
RET=EKI_Open("sendRobotStatus")
WAIT FOR $FLAG[101]
LOOP
$BASE=$NULLfRAME
$TOOL=TOOL_DATA[1]
b_clear=strclear(send_Status[])
b_clear=strclear(axis_Status[])
b_clear=strclear(pos_Status[])
OFFSET=0
send_Status[]="Status,"
SWRITE(axis_Status[],STAT,OFFSET,"%0.2f,%0.2f,%0.2f,%0.2f,%0.2f,%0.2f,",$AXIS_ACT.A1,$AXIS_ACT.A2,$AXIS_ACT.A3,$AXIS_ACT.A4,$AXIS_ACT.A5,$AXIS_ACT.A6)
OFFSET=0
SWRITE(pos_Status[],STAT,OFFSET,"%0.2f,%0.2f,%0.2f,%0.2f,%0.2f,%0.2f,",$POS_ACT.X,$POS_ACT.Y,$POS_ACT.Z,$POS_ACT.C,$POS_ACT.B,$POS_ACT.A)
OFFSET=0
SWRITE(gi16_Status[],STAT,OFFSET,"%d,",gi_16)
OFFSET=0
SWRITE(go16_Status[],STAT,OFFSET,"%d",go_16)
strLenth=StrAdd(send_Status[],pos_Status[])
strLenth=StrAdd(send_Status[],axis_Status[])
strLenth=StrAdd(send_Status[],gi16_Status[])
strLenth=StrAdd(send_Status[],go16_Status[])
IF strLenth<>0 THEN
RET = EKI_Send("sendRobotStatus",send_Status[])
ELSE
; send MSG on smartPad msgQuee
ENDIF
WAIT SEC sendInterval
ENDLOOP
$FLAG[101]=FALSE
RET=EKI_Close("sendRobotStatus")
RET=EKI_Clear("sendRobotStatus")
when it was submit , a message hint that $BASE is write- protected,yes I have know the reason why it occurre.
I try to Comment :
;$BASE=$NULLfRAME
;$TOOL=TOOL_DATA[1]
another message hint that XYZABC TOOL not Program
So Is there a method to get robot Pos(X Y Z A B C) in .sub program .
sinece robot motion was exected in the robot Interpreter while sending robot status is need in parra