RobotStudio event

Path decleration

Hi, I create about 50 Paths. I Need a decleration, with which i can choose the Paths i Need. I Connect robotstudio with another PC via OPC. The other PC has to choose the Paths he Needs.

Comments

  • Hello,

     

    You can use an string declaration (array) to store the paths you want to execute.

    Then you can use this proccall instruction:

     

    PERS String path_stored{5}:=("path1","path2","path3","path4","path5");

     PERS String path_execute:="path1";  

    %path_execute%;

     

    So you can change the name of the path by

    path_execute:=path_stored{5};

    You can do it in a loop and when the string is empty the program is ready.

    greetings

     

     

     

  • hi,

    if i wanna change the name. i have to use the decleration  PERS String path_execute:="path1";  %path_execute%;?
    What you mean with a loop ?
  • Here is an example of how you can do it.

     

    MODULE

    ts

    PERS String path_stored{6}:=["path1","path2","path3","path4","path5",""];

    PERS String path_execute:="path1";

    PROC Main_Rot()

    !

    MoveAbsJ [[0,20,0,0,0,0],[9E+09,0,0,9E+09,9E+09,9E+09]],v200,fine,tool0\WObj:=wobj0;

    !

    FOR i FROM 1 TO 99 DO

    path_execute:=path_stored{i};

    IF path_execute="" GOTO end;

    %path_execute%;

    WaitTime 1;

    ENDFOR

    end:

    ENDPROC

    PROC Path1()

    MoveAbsJ [[0,0,0,0,0,0],[9E+09,0,0,9E+09,9E+09,9E+09]],v200,fine,tool0\WObj:=wobj0;

    ENDPROC

    PROC Path2()

    MoveAbsJ [[45,0,0,0,0,0],[9E+09,0,0,9E+09,9E+09,9E+09]],v200,fine,tool0\WObj:=wobj0;

    ENDPROC

    PROC Path3()

    MoveAbsJ [[90,0,0,0,0,0],[9E+09,0,0,9E+09,9E+09,9E+09]],v200,fine,tool0\WObj:=wobj0;

    ENDPROC

    PROC Path4()

    MoveAbsJ [[-45,0,0,0,0,0],[9E+09,0,0,9E+09,9E+09,9E+09]],v200,fine,tool0\WObj:=wobj0;

    ENDPROC

    PROC Path5()

    MoveAbsJ [[-90,0,0,0,0,0],[9E+09,0,0,9E+09,9E+09,9E+09]],v200,fine,tool0\WObj:=wobj0;

    ENDPROC

    ENDMODULE

     

    You need an change the executed routine.

     

    gr

  • hi,

    thanks for the answer.
    I dont understand the decleration after proc main.
    I mean:,,MoveAbsJ [[0,20,0,0,0,0],[9E+09,0,0,9E+09,9E+09,9E+09]],v200,fine,tool0\WObj:=wobj0;'', from where you get this decleration?