how to stop a robot in a sub-program using rob_stop() & rob_stop_release()

  • Hello everyone,

    i need to stop my robot using a $IN[150] == true,

    I've already tried the halt, I can't configure it well with the rob_stop & rob_stop_release intructions.

    thank in advance for the help. :wallbash: :wallbash: :wallbash: :wallbash: :wallbash:

  • looks like you placed


    Code
       IF $IN[150] == TRUE THEN
             bResult = ROB_STOP(#RAMP_DOWN)
             paused  = TRUE       
       ENDIF
       
       IF $IN[151] == TRUE THEN
             ROB_STOP_RELEASE()
             resumed = TRUE
       ENDIF    

    inside robot program module.


    syntax looks good but the code is inside the very program that gets disabled. if it is disabled, how is it going to RUN long enough to process release request?

    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

  • so, i have to put it on my source program ( cell.src )???

    because the logic of the depScan1 program is to pause, resume, reset and cancel the movement of the robot at any time.. inside

  • no....


    CELL.SRC and this program as well as pretty much any other SRC file are still meant to be executed by the Robot interpreter. and robot interpreter can only do one thing. and it should be obvious that once it is stopped - it is dead. and process that is not running cannot magically restart itself. some external influence would be needed for that (manual or another process).


    so if you need something that runs independently from dead robot interpreter, that code need to be executed by a different interpreter. that means your code need to be executed by one of Submit interpreters.

    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

  • i'm honest with you, i undestood the part of not touching the cell program, but i didn't undestand the rest of the message, it was a bit complex your explanation for me.


    :wallbash: :wallbash: :wallbash:

  • imagine you are a trained medical professional so you know how to help people and know how to revive them when they are passed out or having heart attack or overdosing on some medication etc.


    but one day you are alone and have such condition yourself. guess what - you cannot help yourself. you re incapacitated. you need external help - without someone else to bring you back to the world of living you are gone and will die....


    same things is with programs. program can do work... if someone else started them.... but once the program execution is stopped (not waiting!) it cannot do anything. it is dead... so to continue running (and executing some code) it need to be started - again by someone else.


    that "someone else" could be human operator pressing some button... or... that could be another program that happens to be running. if the other program is also dead or incapacitated, it cannot do squat for you... you both are goners.


    robot has two or more interpreters. they are behind the familiar buttons on top of the smartPad:

    S = Submit interpreter (or interpreters if there is more than one)

    R = Robot interpreter (only one)



    one interpreter can start and stop another interpreter. but none of them can start themselves. that is impossible.



    Program code is stored in files.

    *.SRC files are used to store programs that can be run by Robot intrepreter

    *.SUB files are used to store programs that can be run by Submit interpreters


    even though you can have several SRC programs and few of them could be linked together - in reality only one of them is being executed.


    for example CELL can be used to call programs A, B and C. you (external influence) select and run CELL. then at some point of time, Robot interpreter leaves CELL and it is processing program B for example. But when robot interpreter is program B, absolutely nothing is going on in program CELL any more - it is paused and waiting for Robot interpreter to finish with program B and returns to CELL. At that moment B is dead and CELL continues to run.


    in other words Robot interpreter (like any other) can only process one program block at any time but it can move from one block to another - if they are linked.


    But once that interpreter is dead, all of the linked blocks are dead. revival code placed in one of the linked files does nothing. revival need to come from outside, for example from human operator or from another program - and that other program can only help if it is running itself (in Submit...).

    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

  • how do you pause a program and continue it afterwards.?

    any way you like. you did not provide any details. first you need to know how to do that yourself. and if you want programs to do something for you you need to know exact circumstances, conditions and limitations...

    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

Advertising from our partners