Hi I’m having a behaviour that I consider “weird” might be perfectly logical but I don’t see it at this moment. So some help in explaining this would be very helpfull.
Here’s the code:
MODULE StopTest
VAR intnum tra;
VAR errnum ERR_RESUME:=-1;
VAR errstr ErrMed:= "";
TRAP trap_move
VAR robtarget pPosition;
BookErrNo ERR_RESUME;
ISleep tra; StopMove;
!StorePath;
ClearPath;
StartMove;
pNoll.rot:=OrientZYX(45,0,-180);
GetSysData curtoolvalue;
GetSysData curwobjvalue;
pPosition := CRobT(Tool:=curtoolvalue, WObj:=curwobjvalue);
nVridning:=45;
FOR i FROM EulerZYX(Z, pPosition.rot) TO nVridning STEP NegPos(1,EulerZYX(Z, pPosition.rot), nVridning) DO
pPosition.rot := OrientZYX(i,0,-180);
pTemp.rot := OrientZYX(i,0,-180);
MoveL pPosition, v1000, z0,curtoolvalueWObj:=curwobjvalue;
ENDFOR
!MoveL Offs(pNoll,300,2000,300), v100, fine, to12mmFrA?sWObj:=woBlad;
IWatch tra;
!RestoPath;
!StartMove;
ENDTRAP
PROC interrupt()
CONNECT tra WITH trap_move;
ISignalDI viInterupt1, 1, tra;
SM;
ENDPROC
PROC SB()
Return;
ENDPROC
PROC SM()
MoveJ Offs(pNoll,300,0,300), v1000, z100, to12mmFrA?sWObj:=woBlad; pTemp:=pNoll; pTemp.trans.x := 300;
pTemp.trans.Y := 2000;
MoveL pTemp, v100, fine, to12mmFrA?sWObj:=woBlad;
pTemp.rot:=OrientZYX(90,0,-180);
ENDPROC
ENDMODULE
NegPos function returns either a negative number or positive depending on which of the two values that are bigger then the other. The value that’s returned is the first parameter (in this case “1”)
What this is ment to do:
This is a test to try and make an interupt that handles orientation based on different world zones, while executing the normal move instructions the interupt will stop the movment and initiate an orientation change (the tool will be turned around it’s z axis) and then initiate the last known move instruction.
Now I can see why it would not start:
“MoveL pTemp, v100, fine, to12mmFrA?sWObj:=woBlad;” (this is where the interupt is also started, while this is executed so it’s somewhere on the path when the orientation is started)
I can understand if it would toss me an error and refuse to start execution at this instruction, but it does start the execution of the move instruction, doesn’t toss me an error and it just sits there for all eternity trying to execute the move instruction.
I do see a flaw as the path has been cleared and it is no longer vaild either(as we’ve rotated around the z axis), so there is no path to follow, but I don’t recive any error.
Even if i put the program pointer somewhere else and then back on this move instruction it does not go to it’s final destination, it changes it’s orientation to something that’s never been apart of that position but it doesn’t move to it’s final destination thats 100’s of mm away. I tried deleting and disable the trap and then execute the instruction but it’s still the same, it decides it’s in position even if it’s not. This was done with the “FWD” button doing a one step execution.
Whenever I set the program pointer to the move instruction and then press play it starts to move to the correct position, the FWD no longer works after this on the specific move instruction but works on other move instructions.
This was executed on robotstudio, I don’t have a real robot to test this on until several weeks from now and then it’s a bit too late.
Thank you for any assistance you may be able to give me!
