RobotStudio event

Problem in programming a loop during the movements

<font size="2" style="font-weight: normal;">Hi everyone, I'm Filippo, and i'm an industrial designer with a very low knowledge in robotics!</font><div style="font-weight: normal; font-size: 10pt; font-style: normal;">I'm currently working on a 3d printing development project, wich involve an ABB robot.</div><div style="font-weight: normal; font-size: 10pt; font-style: normal;">Since i'm new in the world of robotics, i still have some problems in the programming phase, and i hope someone can help me!</div><div style="font-weight: normal; font-size: 10pt; font-style: normal;"><br></div><div style="font-weight: normal; font-size: 10pt; font-style: normal;">I think what i'm tryng to do is pretty simple, especcialy for someone who knows well the rapid language.</div><div style="font-weight: normal; font-size: 10pt; font-style: normal;"><br></div><div style="font-weight: normal; font-size: 10pt; font-style: normal;">I connected my extruder directly to the I\O board of the robot, and set the output to one of the free keys on the teach pendant so that i can control it manually while the robot is moving.</div><div style="font-weight: normal; font-size: 10pt; font-style: normal;">That was fine for the very first testing phase, but now i'd like to integrate the output pulsation directly in my rapid file, so that everithing is controlled by the robot.</div><div style="font-weight: normal; font-size: 10pt; font-style: normal;"><br></div><div style="font-weight: normal; font-size: 10pt; font-style: normal;">My target is having a continous series of regular pause and pulsation during the whole moving process. For instance, while the robot is making a straight line of 100mm, the extruder should generate 50 pulsation every 2 seconds.</div><div style="font-weight: normal; font-size: 10pt; font-style: normal;"><br></div><div style="font-weight: normal; font-size: 10pt; font-style: normal;">I tried myself with something like that:</div><div style="font-weight: normal;"><div><i><font size="1"><br></font></i></div><div><i><font size="1">MODULE lnpls</font></i></div><div><i><font size="1">   PERS tooldata WelTor := [TRUE,300.499969482422,0.0694613456726074,83.9059276580811],[1,0,0,0,[1,[-103.249973297119,-7.22313165664673,-55.985221862793],[1,0,0,0],0,0,0]];</font></i></div><div><i><font size="1">   VAR speeddata SSlow := [50,21,5000,1000];</font></i></div><div><i><font size="1">   VAR bool repeat;</font></i></div><div><i><font size="1">   VAR num times;</font></i></div><div><i><font size="1">   CONST robtarget Target0:=1205.85040283203,0,131],[0.705697660668477,2.79396772384644E-09,0.708513099192273,0],[0,0,0,0],[0,9E9,9E9,9E9,9E9,9E9;</font></i></div><div><i><font size="1">   CONST robtarget Target1:=1205.85040283203,0,931],[0.705697660668477,2.79396772384644E-09,0.708513099192273,0],[0,0,0,0],[0,9E9,9E9,9E9,9E9,9E9;</font></i></div><div><i><font size="1">   CONST robtarget Target2:=1205.85040283203,0,950],[0.705697660668477,2.79396772384644E-09,0.708513099192273,0],[0,0,0,0],[0,9E9,9E9,9E9,9E9,9E9;</font></i></div><div><i><font size="1">   PROC Main()</font></i></div><div><i><font size="1">      ConfJ \Off;</font></i></div><div><i><font size="1">      ConfL \Off;</font></i></div><div><i><font size="1">      MoveL Target0,SSlow,z1,WelTor \Wobj:=Wobj0;</font></i></div><div><i><font size="1">   repeat := TRUE;</font></i></div><div><i><font size="1">   times := 50;</font></i></div><div><i><font size="1">      IF repeat THEN</font></i></div><div><i><font size="1">          FOR i FROM 1 TO times DO</font></i></div><div><i><font size="1">          WaitTime 1;</font></i></div><div><i><font size="1">      PulseDo\PLength:=1,do11;</font></i></div><div><i><font size="1">       ENDFOR</font></i></div><div><i><font size="1">     ENDIF</font></i></div><div><i><font size="1">      MoveL Target1,SSlow,z1,WelTor \Wobj:=Wobj0;</font></i></div><div><i><font size="1">      MoveL Target2,SSlow,z1,WelTor \Wobj:=Wobj0;</font></i></div><div><i><font size="1">     ENDPROC</font></i></div><div><i><font size="1">ENDMODULE</font></i></div></div><div style="font-weight: normal;"><i><font size="1"><br></font></i></div><div><font size="2">But of course, what happen is that the robot reach the firs target, stops,  start making the pulsation cycle and once the 50th pulsation is done starts moving again to the second target!</font></div><div><font size="2"><br></font></div><div><font size="2">I really hope someone can give me a hand,</font></div><div><font size="2">   Thanks  F.</font></div><div><font size="2"><br></font></div><div><font size="2"><br></font></div><div><font size="2"><br></font></div><div style="font-weight: normal; font-size: 10pt; font-style: normal;"><br></div><div style="font-weight: normal; font-size: 10pt; font-style: normal;"><br></div>