Hello all!
Working on a bin-picking solution and require some assistance to improve/optimize the execution.
Specs:
KRC5 micro, KSS 8.7.5
KR8 R1640-2
Question:
Is there a way to handle a timer/wait request within a .sub program without it interrupting/halting the motion of the robot? If not, do you have any other suggestions for replacing the wait function that still allow for connectivity flags to function in submit program.
Description:
The motion in question is shown in the Move code underneath. MM_TakePicture needs connection to an external software. The software in question needs a wait or timer function for connectivity flags as shown in code Flag_Alive. Currently when executing the program it begins the MM_TakePicture as intended but when the WAIT in Flag_Alive is called, it interrupts robot motion until it is finished.
TRIGGER WHEN DISTANCE = 0 DELAY = 0 DO MM_TakePicture() PRIO = 1
;FOLD PTP PrePlacePose CONT Vel=65 % PDAT2 Tool[2]:toolEmneGrip Base[0] ColDetect[1] ;%{PE}
;FOLD LIN PlacingPose Vel=0.6 m/s CPDAT1 Tool[2]:toolEmneGrip Base[0] ColDetect[1] ;%{PE}
;PARTDROPOFF()
TRIGGER WHEN DISTANCE = 0 DELAY = 400 DO PARTPICKUP() PRIO = 2
;FOLD LIN PostPlacingPose CONT Vel=1.3 m/s CPDAT3 Tool[2]:toolEmneGrip Base[0] ColDetect[1] ;%{PE}
Display More
DEF MM_Flag_Alive(Timeout:IN)
INT Timeout
INT Wait_Times
;Wait EKI open
Wait_Times=0
Try_Again1:
IF $FLAG[MM_F_Alive]==FALSE THEN
Wait_Times=Wait_Times+1
WAIT SEC 0.05
IF Wait_Times>Timeout/0.05 THEN
MM_Log("ROBOT_SOCKET_CLOSED")
User_Error_Handle(ROBOT_SOCKET_CLOSED)
ENDIF
GOTO Try_Again1
ENDIF
END
Display More