I have taken a few C-based programming classes, but am new to KRL. I am creating a program that at the end of every iteration of the for loop, it goes to a separate point (out of the way) where the HALT command will be called. The problem is that after every iteration of the for loop, the position is different. I was trying to think of a way for the program to define the robot's current position as a new point, so I can do one PTP to the out-of-the-way spot, and then another PTP to the program-defined point. I discovered the $AXIS_ACT_MES variable and was thinking I could use that, but I am unsure how to hard code a point that I can use $AXIS_ACT_MES with to define the point. Hopefully, this makes sense, any help would be appreciated! Also, if there would be a better way to do this, please let me know!
if you read pinned topic READ FIRST, you will find all kind of info.
in KRL there are different types of structured that can be used to define robot position but they can be grouped into two types: Axis specific and Cartesian.
when assigning value or copying value from one variable to another, one must use compatible types.
in your case $AXIS_ACT_MES is an axis type variable so you would need to make a declaration such as
DECL AXIS AxPos1
DECL E6AXIS AxPos27
then you can assign it value such as
AxPos1 = $AXIS_ACT_MES
AxPos27 = hHOME
Thank you so much! I was trying to go through some of the manuals and wasn't getting much luck!
And to clarify I can go ahead and use the variable AxPos1 right in my PTP code, such as PTP AxPos1?
yes but that is not enough. before motion instruction is used you need to initialize all motion parameters needed by your motion instruction (in this case PTP). depending on what you are doing that may include velocity, acceleration, approximation, IPO mode, tool, base etc.
Thank you! I have other motion instructions coded earlier in the program, so all the motion parameters are already defined. The only hang up now is even though I am using KSS 8.3, I am getting an error that $AXIS_ACT_MES is not declared. Is there a declaration line needed in the beginning in order to use this? In examples I have looked at others do not seem to need one. Thank you again for all your help.
$AXIS_ACT_MEAS. "Meas", not "Mes."
For some reason, KUKA decided to name $POS_ACT_MES and $AXIS_ACT_MEAS differently....