How I tried to accomplish this:
PERS num vSpraySpeed:=500;
PERS speeddata vSpray_Fast:=[vSpraySpeed,500,5000,1000];
MoveL Spray_pos10, vSpray_Fast, fine, t_spray;
But, this doesn’t work.
Is there another way to accomplish this?
How I tried to accomplish this:
PERS num vSpraySpeed:=500;
PERS speeddata vSpray_Fast:=[vSpraySpeed,500,5000,1000];
MoveL Spray_pos10, vSpray_Fast, fine, t_spray;
But, this doesn’t work.
Is there another way to accomplish this?
MODULE aModule(SYSMODULE)
PERS speeddata vSpray_Fast;
PERS num vSpraySpeed:=500;
PROC aProcedure()
vSpray_Fast:=[vSpraySpeed,500,5000,1000];
MoveL Spray_pos10, vSpray_Fast, fine, t_spray;
ENDPROC
ENDMODULE
It works perfectly! Thank you so much!
In case you would like to reduce speed globally (via percentage override) you can use “SpeedRefresh” instruction… Like this:
*VAR intnum time_int;*
`
VAR num override;
…
PROC main()
CONNECT time_int WITH speed_refresh;
ITimer 0.1, time_int;
ISleep time_int;
…
MoveL p1, v100, fine, tool2;
! Read current speed override set from FlexPendant
override := CSpeedOverride (\CTask);
IWatch time_int;
MoveL p2, v100, fine, tool2;
IDelete time_int;
! Reset to FlexPendant old speed override
WaitTime 0.5;
SpeedRefresh override;
…
TRAP speed_refresh
VAR speed_corr;
! Analog input signal value from sensor, value 0 … 10
speed_corr := (ai_sensor * 10);
SpeedRefresh speed_corr;
ERROR
IF ERRNO = ERR_SPEED_REFRESH_LIM THEN
IF speed_corr > 100 speed_corr := 100;
IF speed_corr < 0 speed_corr := 0;
RETRY;
ENDIF
ENDTRAP
`
For speed reducing to the exact value there is probably the best way using LimitSpeed SYS_DI and TRAP routine with SpeedLimCheckPoint instruction. Like this:
VAR num limit_speed:=200;
SpeedLimCheckPoint limit_speed;
This will limit the speed to 200 mm/s for the TCP robot when system input LimitSpeed is set to 1.
BR
In case you would like to reduce speed globally (via percentage override) you can use “SpeedRefresh” instruction… Like this:
*VAR intnum time_int;*
`
VAR num override;
…
PROC main()
CONNECT time_int WITH speed_refresh;
ITimer 0.1, time_int;
ISleep time_int;
…
MoveL p1, v100, fine, tool2;
! Read current speed override set from FlexPendant
override := CSpeedOverride (\CTask);
IWatch time_int;
MoveL p2, v100, fine, tool2;
IDelete time_int;
! Reset to FlexPendant old speed override
WaitTime 0.5;
SpeedRefresh override;
…
TRAP speed_refresh
VAR speed_corr;
! Analog input signal value from sensor, value 0 … 10
speed_corr := (ai_sensor * 10);
SpeedRefresh speed_corr;
ERROR
IF ERRNO = ERR_SPEED_REFRESH_LIM THEN
IF speed_corr > 100 speed_corr := 100;
IF speed_corr < 0 speed_corr := 0;
RETRY;
ENDIF
ENDTRAP
`
For speed reducing to the exact value there is probably the best way using LimitSpeed SYS_DI and TRAP routine with SpeedLimCheckPoint instruction. Like this:
VAR num limit_speed:=200;
SpeedLimCheckPoint limit_speed;
This will limit the speed to 200 mm/s for the TCP robot when system input LimitSpeed is set to 1.
BR