RobotStudio event

Anti loop Procedure

Options
Hello !

I have a question for you on IRC5:

How to avoid looping when the cursor reaches the end of a procedure (ENDPROC) ?

In fact when the cursor reaches the end of the routine the robot loops back to its first point
at the start of the routine and I would like to stop it only when the robot loops back.

Thanks for your help !

Best Answers

  • lemster68
    lemster68 ✭✭✭
    Answer ✓
    Options
    It really sounds to me like you simply just need to have it set for single cycle and not continuous.
    Lee Justice
  • lemster68
    lemster68 ✭✭✭
    Answer ✓
    Options
    That would be in the controller topic, Run Mode settings.
    Lee Justice
  • DenisFR
    DenisFR ✭✭✭
    edited December 2023 Answer ✓
    Options
    Hello,
    Or you can use Controller - Run Mode Setting parameters:


    Or in your SYS.cfg:
    RUN_MODE_SETTINGS:
        -name "AutoToManual" -SwitchTo "Single"
        -name "ManualToAuto" -SwitchTo "Single"
    #
    Post edited by DenisFR on

Answers

  • lemster68
    Options
    You can change it from continuous to single using the quickset menu.  Better yet, you can change the sytem parameter to set it to single when putting the robot in teach.
    Lee Justice
  • Poupack
    Options
    Thanks Lemster for your quick reply !

    But would it be possible to do a function at the start of the proc to avoid anti-looping ?

  • lemster68
    Options
    Under what condistions?  Are you talking specifically about teach mode?
    Lee Justice
  • DenisFR
    DenisFR ✭✭✭
    edited November 2023
    Options
    Hello,
    You can use a global bool value:
    PERS bool bAntiLoop:=FALSE;
    Make a AntiLoop procedure:
    PROC AntiLoop()
      IF NOT bAntiLoop THEN
        ErrWrite "AntiLoop detect a loop","Set bAntiLoop to TRUE before use it.";
        EXIT;
      ENDIF
      bAntiLoop:=FALSE;
    ENDPROC
    Then add it at start of Movement PROC
    PROC MoveToPick()
      AntiLoop;
      ...
    ENDPROC
    
    PROC MoveToPlace()
      AntiLoop;
      ...
    ENDPROC
    And set bAntiLoop at TRUE before calling them:
    PROC Main()
      ...
      bAntiLoop:=TRUE;
      MoveToPick;
      ...
      bAntiLoop:=TRUE;
      MoveToPlace;
      ...
    ENDPROC
  • Poupack
    Options

    Thank you DenisFr,

    The solution is perfect for automatic execution also if I select the proc alone then there will always be a loop.

    I'm trying to find a solution for a single procedure selection.

    Do you have an idea ? Thanks in advance !
  • Poupack
    Options
    Thanks Lemster68

    I will try tomorrow!
  • Poupack
    Options
    Lemster68, where is the system parameter to modify ? What menu?

    Thanks everyone!
  • Braap
    Options
    lemster68 said:
    That would be in the controller topic, Run Mode settings.
    Hey @Poupack | Here is a Screenshot for Lemster's reply;

    https://imgur.com/a/ZaWsxUu

    here you can swap to Single cycle in Handmode, when the robot is in Automatic there is no loop normally,

    Do you also have this problems when robot is in Auto mode?

    Greets.





    Robotic Software Engineer
  • Braap
    Options
    You can also check it in Robotsutio here;

    https://imgur.com/a/IuqfC3T

    Robotic Software Engineer
  • Poupack
    Options
    Perfect ! Thanks you !