DECl INT speed
oldspeed=$ov_pro
IF $IN[xsignal]==TRUE THEN
$ov_pro=50
$ov_pro=25
$ov_pro=10
$ov_pro=5
$ov_pro=0
ENDIF
Waiting for xsignal==FALSE
$ov_pro=oldspeed
I want to write like this to SPS.
I hope, I set it right way
DECl INT speed
oldspeed=$ov_pro
IF $IN[xsignal]==TRUE THEN
$ov_pro=50
$ov_pro=25
$ov_pro=10
$ov_pro=5
$ov_pro=0
ENDIF
Waiting for xsignal==FALSE
$ov_pro=oldspeed
I want to write like this to SPS.
I hope, I set it right way
You will need to declare the variables at the top of the SPS in the USER DECL fold, then put the code between the LOOP/ENDLOOP
Waiting for xsignal==FALSE shouldn't be used in the SPS as there should be no code which halts it's operation, it should be able to run continuously.
For info, WAIT FOR (NOT xsignal) or WAIT FOR (xsignal==0) is the correct syntax
I'm not sure what effect just switching the program speed to 0 will have, but reducing it on alternate lines won't have any effect without a delay between them, which should be avoided as noted above.
Display More
You will need to declare the variables at the top of the SPS in the USER DECL fold, then put the code between the LOOP/ENDLOOP
Waiting for xsignal==FALSE shouldn't be used in the SPS as there should be no code which halts it's operation, it should be able to run continuously.
For info, WAIT FOR (NOT xsignal) or WAIT FOR (xsignal==0) is the correct syntax
I'm not sure what effect just switching the program speed to 0 will have, but reducing it on alternate lines won't have any effect without a delay between them, which should be avoided as noted above.
yes always be careful with OV_pro could be dangerus always remember the setting as Eusty said
but this wont allow it to stop at point B if on the way
Well, but I still did not understand how can I make and what is the best way of the soft stop..
for short cycle times (spot welding, handling etc.) you could just use:
LOOP
PTP HOME
WAIT FOR NOT $in[122]
PTP ... ; do some work
PTP ... ; keep doing whatever...
PTP ...
ENDLOOP
Display More
but this will not be suitable for applications as the "quick" stop may be just too long. also perhaps you may not want to move robot away in the middle of the cycle. in such cases interrupt is a better idea.
this means inserting interrupt declaration in your main program:
then create a small program (no DAT file needed):
DEF quick_brake()
brake ; this line initiates stop of the robot
wait for not $in[122] ; here we stay until $in[122] goes off
halt ; still wait, until new start is issued
END
but this is just to give you an idea. it goes without saying that you are on your own and any idea need to be tested thoroughly before being considered as a possible solution.