Hi,
I am currently controlling an IRB120 using robotstudio and matlab. What I am trying to get working at this moment is:
- Giving the robot a target
- Stopping somewhere along the way
- Giving another target and “forgetting” about the first one.
The robot is controlled using multi-tasking. One task is the motion task and is a simple loop doing:
IF UpdateReady = TRUE THEN
UpdatePos;
ENDIF
The UpdatePos proc has a few IF/ELSE statements in order to move linearly, jointmode, to an XYZ target or to a joint target, and ends with either a MoveL or MoveAbsJ.
The other task receives the targets, stop and run commands.
In that communication task, when receiving a stop command I simply call
StopMove \AllMotionTask; (that argument may or may not be useful?)
and
If IsStopMoveAct ( \FromNonMoveTask) = TRUE THEN
StartMove;
ENDIF
to start it again, this sends it to its old target.
When I want to update the position, I have added this (still in the communication task, since that one runs the stopMove it also has to run the StartMove)
If IsStopMoveAct ( \FromNonMoveTask) = TRUE THEN
ClearPath;
StartMove;
ENDIF
I guess there must be a misunderstanding somewhere, but I can’t find why this wouldn’t work. When looking at the program pointers in robotstudio, it seems that the robot will stay on the “MoveAbsJ” or “MoveL” instruction until it executes it completely. What currently happens is :
- I give a target
- I stop the robot
- Give another target
- The robot goes to the first target, then directly to the second one.
Thanks for any input.