Hi, I am doing a project which is linking a PLC with KUKA KRC 4. I have successfully sending signal and control the robot through PLC. I was trying to control each axis by sending out signal but I has some problem to control each of them separately and individually. Eg, I wish to move Axis 1 and stop axis1 and move axis1 again, which is ok by using Brake and resume function, but when comes to controlling other axis simulataenously, the brake fucntion will cause all the axis to stop. How to control each of them individually which one of the axis stop will not cause other axis to stop moving.
Code
DEF beeInter()
DECL AXIS HOME
DECL AXIS MOV1
;----DECLARATION----
INT VEL,ACC
HOME={AXIS: A1 -90,A2 -90,A3 90,A4 0,A5 0,A6 0} ;declare Home Axis
;----INITIALIZATION----
VEL=50
$VEL_AXIS[1]=VEL ;velocity of the axis
$VEL_AXIS[2]=VEL
$VEL_AXIS[3]=VEL
$VEL_AXIS[4]=VEL
$VEL_AXIS[5]=VEL
$VEL_AXIS[6]=VEL
ACC=50
$ACC_AXIS[1]=ACC ;velocity of the axis
$ACC_AXIS[2]=ACC
$ACC_AXIS[3]=ACC
$ACC_AXIS[4]=ACC
$ACC_AXIS[5]=ACC
$ACC_AXIS[6]=ACC
;----INSTRUCTION----
PTP HOME
LOOP
INTERRUPT DECL 1 WHEN $IN[16]==TRUE DO brakeTest()
beeMove( )
ENDLOOP
PTP HOME
END
Display More
Code
DEF beeMove( )
DECL AXIS HOME
DECL AXIS MOV1
;----DECLARATION----
INT VEL,ACC
HOME={AXIS: A1 -90,A2 -90,A3 90,A4 0,A5 0,A6 0} ;declare Home Axis
INTERRUPT ON
;----INITIALIZATION----
VEL=50
$VEL_AXIS[1]=VEL ;velocity of the axis
$VEL_AXIS[2]=VEL
$VEL_AXIS[3]=VEL
$VEL_AXIS[4]=VEL
$VEL_AXIS[5]=VEL
$VEL_AXIS[6]=VEL
ACC=50
$ACC_AXIS[1]=ACC ;velocity of the axis
$ACC_AXIS[2]=ACC
$ACC_AXIS[3]=ACC
$ACC_AXIS[4]=ACC
$ACC_AXIS[5]=ACC
$ACC_AXIS[6]=ACC
;----INSTRUCTION----
LOOP
IF $IN[9]==TRUE THEN ;A1 Positive degree
MOV1.A1 = 90
PTP MOV1
ELSE
IF $IN[10]==TRUE THEN ;A2 positive degree
MOV1.A2=90
PTP MOV1
ELSE
IF $IN[24]==TRUE THEN ;A3 positive degree
MOV1.A3=90
PTP MOV1
ELSE
ENDIF
ENDIF
ENDIF
IF $IN[24]==TRUE THEN
EXIT
ENDIF
ENDLOOP
INTERRUPT OFF
PTP HOME
END
Display More