Perhaps this will help me explain better. I have attached a simple program with 3 home positions (Home1, Home2, Home3), and 4 targets (Target_1, Target_2, Target_3, Target_4). This is what I need to happen during simulation:
If the “stop” button is pushed, and the robot is between Target_1 and Target_2, then the play button is pushed, the robot needs to first go to Home2, then proceed to Home1.
If the “stop” button is pushed, and the robot is between Target_3 and Target_4, then the play button is pushed, the robot needs to first go to Home3, then proceed to Home1.
If you don’t mind, could you possibly go in to my program and alter the code to do this? I think if I could actually see the code in the works it would help me understand this better, rather than just looking at an algorithm example.
CODE:
MODULE Module1
CONST robtarget Home1:=[[211.807179916,-29.949370435,568.144478505],[0.520572289,0.059862595,0.850928776,-0.036622111],[-1,-1,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];
CONST robtarget Home2:=[[181.96531164,-315.661735855,593.999984225],[0.432928775,0.433264133,0.749854853,-0.25014509],[-1,0,-1,0],[9E9,9E9,9E9,9E9,9E9,9E9]];
CONST robtarget Target_10:=[[246.188134296,-384.823890327,161.657986235],[0.034192382,0.479791458,0.876516249,-0.018716382],[-1,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];
CONST robtarget Target_20:=[[392.05318618,-234.504420514,161.657986235],[0.037572475,0.266073163,0.963164394,-0.010379357],[-1,-1,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];
CONST robtarget Target_30:=[[122.841800553,440.008995444,161.657986235],[0.031048276,-0.604148781,0.795917602,0.023567488],[0,0,-1,0],[9E9,9E9,9E9,9E9,9E9,9E9]];
CONST robtarget Target_40:=[[336.7197606,308.735852884,161.657986235],[0.036327291,-0.362304645,0.931244287,0.014133291],[0,0,-1,0],[9E9,9E9,9E9,9E9,9E9,9E9]];
CONST robtarget Home3:=[[240.020330113,274.1239633,593.999984225],[0.455350888,-0.357723988,0.788691104,0.206531981],[0,-1,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];
CONST robtarget Target_1:=[[246.188134296,-384.823890327,161.657986235],[0.034192382,0.479791458,0.876516249,-0.018716382],[-1,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];
CONST robtarget Target_2:=[[392.05318618,-234.504420514,161.657986235],[0.037572475,0.266073163,0.963164394,-0.010379357],[-1,-1,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];
CONST robtarget Target_3:=[[122.841800553,440.008995444,161.657986235],[0.031048276,-0.604148781,0.795917602,0.023567488],[0,0,-1,0],[9E9,9E9,9E9,9E9,9E9,9E9]];
CONST robtarget Target_4:=[[336.7197606,308.735852884,161.657986235],[0.036327291,-0.362304645,0.931244287,0.014133291],[0,0,-1,0],[9E9,9E9,9E9,9E9,9E9,9E9]];
PROC Path_10() !This is just an example path, it could be a number of things. I just threw this in to show what the path COULD be, but still needs to do what is mentioned above
MoveL Home1,v200,z100,tool0\WObj:=wobj0;
MoveL Target_1,v200,z100,tool0\WObj:=wobj0;
MoveL Target_2,v200,z100,tool0\WObj:=wobj0;
MoveL Home2,v200,z100,tool0\WObj:=wobj0;
MoveL Target_3,v200,z100,tool0\WObj:=wobj0;
MoveL Target_4,v200,z100,tool0\WObj:=wobj0;
MoveL Home3,v200,z100,tool0\WObj:=wobj0;
MoveL Home1,v200,z100,tool0\WObj:=wobj0;
ENDPROC
PROC main()
Path_10;
ENDPROC
ENDMODULE
Thanks for all your help!