Change tool data
Options
Hi, so I'm doing a project at school, and I want to change the tool data (only the Xvalue) by a value that is the difference between two robot targets.
One of the targets is fixed, the other one will change, depending on the length of my tool. I want to use SearchL to get the second/variable target. I want to calculate the difference in X fore the two targets, and adjust the tooldata by this walue.
Anybody who got some pointers or good tips for a noob?
One of the targets is fixed, the other one will change, depending on the length of my tool. I want to use SearchL to get the second/variable target. I want to calculate the difference in X fore the two targets, and adjust the tooldata by this walue.
Anybody who got some pointers or good tips for a noob?
0
Comments

Hi SolidFloyd,the easy way to calculate the distance between two points is with the distance function. Distance is used to
calculate the distance between two points in the space, in all three directions!second option is to calculate only the X differentiation.! Example first optionVar robtaget pfixpos := [....] ;Var robtarget pfoundpos :=[......];Var toodata tTool := [....] ;Var num nDistance :=0;! calculate distancenDistance := Distance(pfixpos.pos,pfoundpos.pos);! Add distance to X value of toolframe;tTool.tframe.x := tTool.tframe.x + nDistance;! Example second optionVar robtaget pfixpos := [....] ;Var robtarget pfoundpos :=[......];Var toodata tTool := [....] ;Var num nDistance :=0;! calculate distancenDistance := pfixpos.pos.x  pfoundpos.pos.x;! Add distance to X value of toolframe;tTool.tframe.x := tTool.tframe.x + nDistance;0 
Sweet, tnx...
Just had to add .trans and I got it working
0 
how would this work if I want to change the orientation of the tool ?0
Categories
 All Categories
 5.4K RobotStudio
 387 UpFeed
 15 Tutorials
 12 RobotApps
 293 PowerPacs
 406 RobotStudio S4
 1.8K Developer Tools
 247 ScreenMaker
 2.7K Robot Controller
 287 IRC5
 51 OmniCore
 6 RCS (Realistic Controller Simulation)
 3 RobotStudio AR Viewer
 747 RAPID Programming
 16 Wizard Easy Programming
 106 Collaborative Robots
 3 Job listings