program reset

  • 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:



    Code
          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:


    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,

  • Fubini

    Approved the thread.
  • why use old manual for KSS8.2 (KSS_82_SI_en) when you are using much newer KSS (8.7)?

    three are rules when and unconditional jumps are possible. for example you cannot jump out of program or across incompatible blocks (for example from one CASE block to another, jumping into loop etc.).



    also i am way to skeptical that someone unable to figure out GOTO can understand how interrupts function. and one should not do anything time consuming inside interrupts, or something involving complex motions like moving robot through the maze even if one calls that home recovery (bringing robot home).


    same goes for selecting/cancelling/resetting program. all of this is documented and as stated in the documentation - this need to be done in another interpreter. if you want to start submit #4, you can do that from robot program or submit #7 or submit #2 but not from submit #4 (never itself). if you want to start (or reset) robot pram you can do that from one of submits bit from robot program itself.

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • just a sidenote but you can bind your sensors together in 1 $cycflag and use that as condition to trigger interrupt from any of your sensors instead of declaring 4 separate interrupts.

  • Regarding those GOTO, what sets the end of the Marke/Label?

Advertising from our partners