Hi Everybody!
I have a question about krl programming. I use to program also ABB robots since long time and I wrote a func on Krl to replicate a func present in abb rapid. Basically, this func move the robot to an offset of a point, that is to avoid the touch_up of hundreds of point I have in my program. I pass trough the func 3 different values that I add to the point and the robot will move to those offsets. My problem is to set the speed, the approximation, the base and the tool. I tried to pass those values but the speed doesn't seems to change, even the approximation and also the base and the tool! I set $VEL and $APO and I set also the fdat parameters but if the robot comes from an e6axis point with a different base or tool setted early it doesn't change the base! I need this to palletize with different bases. The function works just if I execute a point created with the kcp. My question is how can I change the current base for the next point I need to reach? $Base=base_data[n] doesn't work and fdat_act called from this func even! Sometimes I hate Kuka robot for this things...Abb is more user friendly.. kuka manuals are a hell.Please help! Thanks!
Krc fdat
-
Dig -
August 28, 2016 at 6:45 PM -
Thread is Resolved
-
-
i moved post for you, please don't post programming questions in manuals download area.
if finding place where everyone asks programming questions was a challenge, i can see how reading programming manual can be hard.can you please show your code? what exactly did you try that seem to not work correctly? are you using inline form instructions or KRL motions?
it appears that you are mixing both and - don't know the difference yet (am i right?).
parameters set through KRL code (instructions that you type) are valid until ... something changes them.
each ILF instructions sets/changes all motion parameters. if you want to program in KRL, stick with KRL motions. do not use KRL to set motion parameters if you are going to use ILF motion instructions. -
Try for example:
BAS(#BASE,1) for setting base to no. 1
...
have a look into BAS.SRC for more intructions or to look which global parameter is used for a specific functionality. -
Try for example:
BAS(#BASE,1) for setting base to no. 1
...
have a look into BAS.SRC for more intructions or to look which global parameter is used for a specific functionality.Well, thank you yes I did it...I created a sub that is exactly as in bad.src but it's like the controller doesn't load the value in the movement if you set it from a sub or from a sub in a sub...
-
it works for me. can you post your test code? as already mentioned, it appears that you expect inline form motions to use base that was set using
$BASE=base_data[n]
or
BAS(#BASE,n)that works fine but... if your motion is inline form motion instruction, it will use it's own base number no matter what. in that case rather than altering base number, base value would need to change.
-
Hi thanks for the reply. I'm trying to avoid the use of inline forms so I wrote this function, also to avoid the touch-up of many points and also because I have 11 bases to palletize. My func is something like:
Fct e6pos movoffset(pointoff:in,xoff:in,yoff:in,zoff:in,zone:in,vel:in,tool:in, base:in)
Decl e6pos pointoff
Deck real xoff,yoff,zoff,zone,vel
Decl int tool,base$base=base_data[base]
$apo.Cdis=zone
$vel.cdis=velPointoff.x=pointoff.x+xoff
Pointoff.y=pointoff.y+yoff
Pointoff.z=pointoff.z+zoffReturn pointoff
Don't take care of writing errors I made now is that I'm writing from the phone. The function works and move where I want but just if I put an I line movement before my problem is that I don't want to put those before to set the base and another problem is that the robot doesn't seem to change the speed and the approximation. Today I tried to execute in T1 and it moved at same speed like it was in t2 and plus it tries to move respect the last base I used in the program. For example: I have a base with A=0° and another with A=180° if I move to the 180° base from the 0° after the first movement that is an e6axis position it tries to move to the offset but respect the 0° base! It doesn't take care of the instructions inside the sub! I tried also adding a fdat variable but it doesn't work. Tomorrow I will try to set $bas_act also but it's strange to me, that if it works in bas.src it should work also in mine! For approximation and speed I didn't find any clues yet...I'be also copy the code of speed from the bas.src and put it in my func but the speed doesn't change yet...Thanks for your help! -
your function does not do any motion, it only computes offset.
what is the code that uses result of that function? need to see your motion instructions...
-
I Just use this instruction:
LIN offset(point,0,0,100,10,50,1,1) c_dis -
I don't think KRL has offset function, the closest to ABB's offset is LIN_REL which "Executes a linear motion to the end point. The coordinates of the end point are relative to the current position." But I am new here so I don't know everything.
-
So your function is called movoffset(...) and by
LIN offset(point,0,0,100,10,50,1,1) c_dis
you call a function called offset(...). How is this supposed to work?
Does it work in the following fashion:
e6pos mye6pos
...
mye6pos = offset(whatever)
LIN mye6pos c_dis
...And what is $vel.cdis=vel? $vel has no member cdis.
Have you tried running your program in incremental step? Does it enter your function offset then?
Are you familiar with the concept of main and advance run? What are the values of main run variables $BASE_C, $VEL_C, $APO_C , ... in your error cases?
Fubini
-
So your function is called movoffset(...) and byLIN offset(point,0,0,100,10,50,1,1) c_dis
you call a function called offset(...). How is this supposed to work?
Does it work in the following fashion:
e6pos mye6pos
...
mye6pos = offset(whatever)
LIN mye6pos c_dis
...And what is $vel.cdis=vel? $vel has no member cdis.
Have you tried running your program in incremental step? Does it enter your function offset then?
Are you familiar with the concept of main and advance run? What are the values of main run variables $BASE_C, $VEL_C, $APO_C , ... in your error cases?
Fubini
Will I'm sorry you're correct it's called moveoffset but I wrote the message down from my phone, at least what I remembered so there is some mistakes...Anyway the function works very well if you call it through LIN instruction.
The problem is not the offset, the problem are bases, speed and approximation. Thanks anyway... -
I don't think KRL has offset function, the closest to ABB's offset is LIN_REL which "Executes a linear motion to the end point. The coordinates of the end point are relative to the current position." But I am new here so I don't know everything.Yes, thanks but LIN_REL works for backwards path! I need something to reach a final point so I create this function that, sorry I repeat myself, works very well except for setting base, tool, speed and approximation...
-
-
Well, thank you i think i solved the $Tool and $Base problem...
I added $ACT_BASE and $ACT_TOOL intructions into the function and the $base and $tool set seem to work!
My exact function is as follow so if somebody as some new idea about speed and aproximation
may help, thanks!GLOBAL DEFFCT E6POS POffset(Point:IN,OfX:IN,OfY:IN,OfZ:IN,Zone:IN,Vel:IN,nTool:IN,nBase:IN)
E6POS Point
REAL OfX,OfY,OfZ
REAL Zone,Vel
INT nTool,nBaseSet_Lin_Zone(Zone) ;From Bas.src
Set_Lin_Vel(Vel) ;From Bas.src;Set Tool
$TOOL=TOOL_DATA[nTool]
$ACT_TOOL=nTool
;Set Base
$BASE=BASE_DATA[nBase]
$ACT_BASE=nBasePunto.X = Punto.X + OfX
Punto.Y = Punto.Y + OfY
Punto.Z = Punto.Z + OfZRETURN(Punto)
ENDFCTand i call it from anywhere in the program in this way :
LIN POffset(XFirstPiece,0,0,nPalletHeight,fine,vL08,1,4) C_DIS
fine = is declared in config.dat
vL08 = is declared in config.dat -
$VEL.CP = ... ; for CP motions
-
So your problem was not the controller did not USE the base you programmed but it did just not SHOW the corresponding number on the upper right corner on the teach pendant, $ACT_BASE and $ACT_TOOL are only used for the display and not inside the real-time the robot controller. The real-time robot controller always uses what was set in advance run with $BASE = whatever ans/or $TOOL = whatever. In fact the real-time robot controller (inside VxWorks) does not even know there are more then one BASE_DATA's. This Information is only available on the user/application side (inside Windows). This is the same for any user/application variable, that is all variables without a leading '$'.
This is why most user should use the predefined functions inside bas.src in expert programming mode (e.g. BAS(#BASE,1) sets everything expected for BASE_DATA[1], BAS(#TOOL,2) everything expected for TOOL_DATA[2], including LOAD_DATA[2].)
Fubini