What is the difference in the 2 following examples, and why would you choose one over the other:
example 1:
BAS(#TOOL,1)
example 2:
$TOOL=TOOL_DATA[1]
$ACT_TOOL=1
What is the difference in the 2 following examples, and why would you choose one over the other:
example 1:
BAS(#TOOL,1)
example 2:
$TOOL=TOOL_DATA[1]
$ACT_TOOL=1
The code of bas is readable, you can have a look into it and check by yourself what the difference is.
Thanks for your reply. I took a peek in BAS.src and it seems that using BAS(#TOOL,1) also sets $LOAD variables according to the tool number
Am I correct in thinking that using example 2 in my previous post would be more suitable for most cases? (eg. moving robot to a given point without using ILF)
I don't think that example 2 is the better way.
You checked that the first example also sets the load, I think load should also be set when you don't use ILF, don't You?
With $TOOL = TOOL_DATA[1] you move the robot without load data when you write the move command in KRL
Edit says
oops Hermann was faster
I don't think that example 2 is the better way.
You checked that the first example also sets the load, I think load should also be set when you don't use ILF, don't You?
Oops! I meant to say example 1 is the better way
Using BAS is convenient, but not necessary. KUKA included BAS mostly to support Inline Form programming. As you've seen, setting the Tool with BAS automatically sets $ACT_TOOL and $LOAD, along with $TOOL. This allows Inline Form motion points to only select a Tool number and let BAS do everything else for them.
As far as I am aware, $ACT_TOOL has no effect on the robot, it just updates the "active tool" number shown in the pendant display. If you control $TOOL directly, it's possible to forget to update $ACT_TOOL, so the pendant display will not match your actual active tool.
OTOH, avoiding BAS lets you do things like change $LOAD when you pick/drop a payload without needing to set up duplicate Tools (Tool 1 for an empty gripper, Tool 2 for a full gripper, with identical XYZABC but different LOAD_DATA values). It's also handy if, for some reason, you don't want to use the TOOL_DATA array.
Most of the time, BAS is the better option. But KRL allows you the flexibility to choose.
One more question: I have a robot with an external axis (E1), and there at a certain point I want to move only that axis. I have done this with the following code:
StartPos = $pos_act
StartPos.E1 = 30.0
;FOLD SPTP StartPos Vel=10 % PDAT1 Tool[1] Base[17] ;%{PE}
;FOLD Parameters ;%{h}
;Params IlfProvider=kukaroboter.basistech.inlineforms.movement.spline; Kuka.PointName=StartPos; Kuka.BlendingEnabled=False; Kuka.MoveDataPtpName=PDAT1; Kuka.VelocityPtp=100; Kuka.VelocityFieldEnabled=True; Kuka.MovementParameterFieldEnabled=True; IlfCommand=SPTP
;ENDFOLD
SPTP XStartPos WITH $VEL_AXIS[1] = SVEL_JOINT(100.0), $TOOL = STOOL2(FStartPos), $BASE = SBASE(FStartPos.BASE_NO), $IPO_MODE = SIPO_MODE(FStartPos.IPO_FRAME), $LOAD = SLOAD(FStartPos.TOOL_NO), $ACC_AXIS[1] = SACC_JOINT(PPDAT1), $APO = SAPO_PTP(PPDAT1), $GEAR_JERK[1] = SGEAR_JERK(PPDAT1), $COLLMON_TOL_PRO[1] = USE_CM_PRO_VALUES(0)
;ENDFOLD
This works fine
This also works, but E1 is rotating extremely slow:
StartPos = $pos_act
StartPos.E1 = 30.0
BAS(#VEL_PTP,30)
BAS(#ACC_PTP,30)
BAS(#TOOL,1)
BAS(#BASE,17)
PTP StartPos
Is there something else I need to do to initialize speed for axis E1? Something that is happening in the inline form that I'm skipping?