good morning everyone I ask you a question.
I have an r30ib plus controller that must take a fragile object and put it in a stamp. during the insertion movement, I must monitor a signal which, if activated, generates the immediate stop of the movement and causes the robot to go back.
Then I have to retry the insertion.
I need to do all of this with the CONDITION HANDLER statement but I don't know how. For now I have written this, but I think it is not correct and I don't understand how to go back from the current position
Code
PROGRAM CheckAbortCycle
VAR
numPar,status:INTEGER
pAct=XYZWPR
CONST
STOP_ACTION=1
PR_AUS=100
ROUTINE MoveRecovery
BEGIN
pAct=CURPOS(0,0) --read currentposition
SET_POS_REG(PR_AUS,pAct,status) --store current position on PR[100]
END MoveRecovery
BEGIN
CONDITION[STOP_ACTION]:
WHEN DIN[5] DO
STOP
CANCEL
MoveRecovery
ENDCONDITION
GET_TPE_PRM(numPar,data_type,real_type,str_type,status)
IF (str_type='ON') THEN
ENABLE CONDITION [STOP_ACTION]
END IF
IF (str_type='OFF') THEN
DISABLE CONDITION [STOP_ACTION]
END IF
END CheckAbortCycle
Display More
and from TP the code is like this:
Code
CALL CheckAbortCycle('ON')
PR[100]=[PR6] --PR100 is an Auxiliary position
L PR[100] 800mm/sec cnt50
L PR[100] 400mm/sec cnt5
L PR[100] 10mm/sec fine
CALL OPENGRIPPER
PULSE DO 1 --INSERTION OK
---
CALL CheckAbortCycle('OFF')
Display More
can someone help me?