RobotStudio event

TriggSpeed and TriggJ

Hello everyone!

For a future project i'm starting to test some things that we need to be able to do in project. One of the things is the possibility to change a analog output value with the TCP speed of the robot, but we need to change the AO value 1 second before the robot changes speed. I have tried to use TriggSpeed and TriggJ to do this in my test, what i understand from the RAPID Reference Manual, TriggSpeed would be able to do this.

My code:

PROC Trigg()
        VAR triggdata Trigger;
        
        MoveJ Target_50,vmax,fine,tGun\WObj:=wPart;
        MoveJ Target_120,vSpeedStraight,z200,tGun\WObj:=wPart;
        TriggSpeed Trigger,0,1,AO_Gun,0.5\DipLag:=0;
        TriggJ Target_210,vSpeedStraight,Trigger,z0,tGun\WObj:=wPart;
        TriggSpeed Trigger,0,1,AO_Gun,0.5\DipLag:=0;
        TriggJ Target_450,vSpeedCorner,Trigger,z0,tGun\WObj:=wPart;
        TriggSpeed Trigger,0,1,AO_Gun,0.5\DipLag:=0;
        TriggJ Target_880,vSpeedStraight,Trigger,z0,tGun\WObj:=wPart;
        MoveJ Target_1960,vSpeedStraight,fine,tGun\WObj:=wPart;
ENDPROC

With the "\DipLag" argument in TriggSpeed i'm able to change the analog output up to half a second before the robot change speed, but as I said, i need to be able to do it 1 second before the speed change. My first thought was that a combination between the arguments "Distance" and "ScaleLag" would be able do this, but in my "Signal analyzer" wíth speed and value of the output AO_Gun i cant see that this is happens.

I'm very thankful of any help i can get. And have a nice weekend!

/Erik