Forum Migration Notice
We're transitioning to a more modern community platform by the end of this year. Learn about the upcoming changes and what to expect.

Execution of Trap Routine during movement of MoveAbsJ

Hi all,

ROOBOT STUDIO - USING 5500-27

I am trying to split a moveabsJ into several robtargets. Currently I have the following.
How can I get the interrupt to trigger at the same time as the moveabsj & continually interrupt the movement home?

If I place the moveabsj in my trap, it goes all the way home and all my targets in the array become the same value.

VAR robtarget pfarmed;
VAR intnum int_temp;

PROC MAIN ()
....
MOTION;
IDelete int_temp;
waittime 0.5;
Connect int_temp WITH temp_routine;
isignalDO do_interrupt1,1, int_temp; 
waittime 0.5;
reset do_interrupt1;
pulsedo do_interrupt1;
WAITtime 1;
IDelete int_temp;
....
ENDPROC

TRAP temp_routine


    For i from 1 to 10 DO
ErrWrite "Awesome","Awesome"; !checking in RS if I am executing
StopMove;
StorePath;
pfarmed := CRobT (\Tool:=TOOL\WObj:=Wobj_01);
pfarm{i} := CRobT (\Tool:=TOOL\WObj:=Wobj_01); !storing to an array
MoveL pfarmed,v2000,fine,TOOL\WObj:=Wobj_01;
RestoPath;
Startmove;
! MOVEABSJ HERE
WaitTime 1;
ENDFOR

ENDTRAP

Any help would be appreciated.

Answers

  • Fixed my own problem

    1. subbed out isignalDO do_interrupt1,1, int_temp;  for an itimer
    2. Calling my moveabsJ in the main, excluded it from TRAP
    3. TRAP is now an IF statement calling a variable, replacing the "i" in the for loop, & running x amount of times.