Hi, Im new to programming robots, currently working on my frist big project.
Im working on KR120R2700_2 robot, KS V8.7.441, KR C5.
I'm posting to request help with finding an error or finding the right path to do it.
The robot works as an pick and place unit. There is a need to implement mechanism that detects if the product have been dropped. Im using a set of three inductive sensors that indicate whether the product it properly picked or not. Four interrupts are declared at the start of the program. Three interrupts are executed by xProductDropped subprogram which stops the robot, turns off the interrupts, opens gripper, sends information to PLC about the event, waits for acknowledge, sets reset_req bit on true and performs a homing procedure. Without implementing any additional mechanisms the robot will continue the program from the point where interrupt occured. At this point robot should start the program from the begining. The fourth interrupt declared check for the variable reset_req and is supposed to reset a program if it is true (which is after executing xProductDropped subprogram). I don't know what function to use to make the program reset itself. Or maybe there is another path of making program end/start from the begingin after an event occurs.
The interrupts declaration:
INTERRUPT DECL 11 WHEN di_sensorLeft==FALSE DO xProductDropped()
INTERRUPT DECL 12 WHEN di_sensorMid==FALSE DO xProductDropped()
INTERRUPT DECL 13 WHEN di_sensorRight==FALSE DO xProductDropped()
INTERRUPT DECL 14 WHEN b_reset_req==TRUE DO RESET
xProductDropped subprogram:
&ACCESS RVO1
&REL 3
&PARAM EDITMASK = *
DEF xProductDropped( )
BRAKE F
INTERRUPT OFF 11
INTERRUPT OFF 12
INTERRUPT OFF 13
BRAKE F
xGripper(false);open gripped to drop product, if any left
do_ProductDropped = TRUE
b_reset_req = TRUE
WAIT SEC 3
do_ProductDropped = FALSE
WAIT FOR di_ProductDroppedAck
xHomingProcedure();
END
Display More
Whole sequence of event after dropping a product is properly executed: robot stops, gripper opens, robot sends a signal and waits for ack, and executes a homing procedure. The only thing thats not working is making the program reset.
Ive searched the manuals that I have (KSS_82_SI_en) and found usage of GOTO function. But I also have problems with properly declare labels and use the GOTO function. I've tried to use functions like GOTO, JUMPTO, JUMP,BRA,RESET,ABORT and some other stuff.
Thanks in advance for any help,