So based on an input from my plc I want to JOG UP, or DOWN,
I can't see why my code doesn't work,
I get a error unable to alter accl_axis in BAS]]
Jogging from a PLC
-
bman84 -
April 8, 2014 at 3:16 PM -
Thread is marked as Resolved.
-
-
Try moving the BAS call above the LOOP command.
-
That's how I originally had it.... still get the error
-
Hmm, I just tried it on my office pc and it worked.
Replace bas(#vel....) with
$vel.cp = 0.2Make sure you reset a program so it goes over INI first
-
Ahh,
just realised one of my photos didn't upload,
I'm calling that program from the sps.
Well I was until I ran out of test time,
which if proberbly why KR16-2 it ran ok in Office.
as it runs ok when I run through by hand. -
Oh. Well, that's the problem. You CANNOT run motion commands from the SPS, or from any program called by the SPS. The only exception to this is external axes that are in Async mode.
You can use the SPS to perform CANCEL, STOP, and RUN commands on motion programs, but after than those programs have to run on their own, independently from the SPS.
-
That's odd as I call a recovery program currently from the sps and that works?
I just need to be able to jog Z + - off an input then reset the cell.... -
Unless something has seriously changed with the KRC4, motion commands to the robot cannot be executed in the Level 0 interpreter. Can you describe the exact nature of this "recovery program" you refer to?
-
I cancel the cell call my recovery . Ptp pos act, if z<1200 then Lin_rel z400 endif ptp home. End Select cell, run cell
Sent from my iPhone using Tapatalk
-
Unless something has seriously changed with the KRC4, motion commands to the robot cannot be executed in the Level 0 interpreter. Can you describe the exact nature of this "recovery program" you refer to?Nothing is change as far as motions from SPS.
You can cancel current program CWRITE(...STOP , CWRITE(...CANCEL
Then load a new program by calling CWRITE( .......RUN /R1/something()
Then cancel it again and load something else.There is no way you are calling actual motion program directly from SPS by means of subprogram call.
...
Something() ; motion program to home called from sps NOT POSSIBLE
...UNLESS ....i don't know any better
Please post you working code where this happens.
-
Right.... I'm doubting myself now, I'm now away from the robot and away from it for a few weeks.
Sent from my iPhone using Tapatalk
-
But I'm convinced its in the sps....
Sent from my iPhone using Tapatalk
-
You can probably get an archive from it?
-
I'm a Liar, Cheat, And Scoundrel,
I have no program call for the recovery its just the check home now in the Cell.src that works wonderfully,SPS
Quote;FOLD USER PLC
;IF $IN[11]==TRUE THEN
;JOGUP ()
;CWRITE($CMD,STAT,MODE,"STOP /R1/CELL ()")
;CWRITE($CMD,STAT,MODE,"RESET /R1/CELL ()")
;CWRITE($CMD,STAT,MODE,"RUN /R1/CELL ()")
;ENDIF;IF $IN[12]==TRUE THEN
;JOGDOWN ()
;CWRITE($CMD,STAT,MODE,"STOP /R1/CELL ()")
;CWRITE($CMD,STAT,MODE,"RESET /R1/CELL ()")
;CWRITE($CMD,STAT,MODE,"RUN /R1/CELL ()")
;ENDIFIF $IN[9]==TRUE THEN
CWRITE($CMD,STAT,MODE,"STOP /R1/CELL ()")
CWRITE($CMD,STAT,MODE,"RESET /R1/CELL ()")
CWRITE($CMD,STAT,MODE,"RUN /R1/CELL ()")
ENDIF
IF $EXT==TRUE THEN
$OV_PRO=SPEEDOVERRIDE
ENDIF
;ENDFOLD (USER PLC)In the cell I have.
Quote
;FOLD CHECK HOME
IF $IN_HOME==FALSE THEN
RECOVERHOME()
HALT
ENDIF
;ENDFOLD (CHECK HOME)QuoteDEF JOGDOWN( )
;FOLD INI;%{PE}
;FOLD BASISTECH INI
GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS==TRUE DO IR_STOPM ( )
INTERRUPT ON 3
BAS (#INITMOV,0 )
;ENDFOLD (BASISTECH INI)
;FOLD SPOTTECH INI
USERSPOT(#INIT)
;ENDFOLD (SPOTTECH INI)
;FOLD GRIPPERTECH INI
USER_GRP(0,DUMMY,DUMMY,GDEFAULT)
;ENDFOLD (GRIPPERTECH INI)
;FOLD USER INI
;Make your modifications here;ENDFOLD (USER INI)
;ENDFOLD (INI)
BAS(#BASE, 0)
BAS(#TOOL, 0)
PTP $POS_ACT
BAS(#VEL_CP,0.2)
IF $IN(11)==TRUE THEN
LOOP
LIN_REL {Z -5}
IF $IN(11)==FALSE THEN
EXIT
ENDIF
ENDLOOP
ENDIF
END -
Move plc
Sent from my iPhone using Tapatalk
-
OOOH my head hurts....
Back on this after a break and my latest Idea still doesn't work.
any one got any suggestions?
I just want to jog the robot up in world z whilst an input is true.I now have a cwrite command reseting the cell.src in the sps. and an if statement in the cell.src before my home check of..
if $in[11]==true then
jogup()
endifhowever the cwrite keeps reseting the cell.src so no movement occurs......
help...
Bman84
-
Right so I've come up with a different way.
I the cell.src I have a interrupt,
so
in Cell.src I have
Global Interrupt Decl 90 when $in[11]==true Do Jogup()
Interrupt ON 90
Interrupt Enable 90then in my JOGUP() I have
ini
interrupt off
bas stuff
ptp post act
loop
in $in[11]==True then
lin rel [z 5]
else
exit
endif
endloop
interrupt on 90the jogup program works.
and when I trigger in 11 in jumps to the jogup ()
however I get a instructin inadmiissable in cell.src.
Any Ideas?
Daniel
-
Sorted will post my solution later but simply... the ini was ballsing it up
-
So in the Cell.src I have
GLOBAL INTERRUPT DECL 90 WHEN $IN[11]==TRUE DO JOGUP()
INTERRUPT ON 90
INTERRUPT ENABLE 90Jogup.SRC is
DEF JOGUP( )
;FOLD INI;%{PE}
IF $T1 THEN
;FOLD BASISTECH INI
GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS==TRUE DO IR_STOPM ( )
INTERRUPT ON 3
BAS (#INITMOV,0 )
;ENDFOLD (BASISTECH INI)
;FOLD SPOTTECH INI
USERSPOT(#INIT)
;ENDFOLD (SPOTTECH INI)
;FOLD GRIPPERTECH INI
USER_GRP(0,DUMMY,DUMMY,GDEFAULT)
;ENDFOLD (GRIPPERTECH INI)
;FOLD USER INI
;Make your modifications here
;ENDFOLD (USER INI)
ENDIF
;ENDFOLD (INI)
BRAKE
PTP $POS_ACT
BAS(#VEL_CP,0.2)
LOOP
;FOLD PULSE 11 '' State=TRUE Time=0.2 sec;%{PE}%R 8.3.26,%MKUKATPBASIS,%COUT,%VPULSE,%P 2:11, 3:, 5:TRUE, 6:, 8:0.2
PULSE($OUT[11], TRUE,0.2)
;ENDFOLD
IF $IN[11]==TRUE THEN
LIN_REL {Z 5}
ENDIF
ENDLOOP
ENDthe only way to exit this is then to run my homing routine which is a cwrite command back to cell.