1. Home
    1. Dashboard
    2. Search
  2. Forum
    1. Unresolved Threads
    2. Members
      1. Recent Activities
      2. Users Online
      3. Team Members
      4. Search Members
      5. Trophys
  3. Articles
  4. Blog
  5. Videos
  6. Jobs
  7. Shop
    1. Orders
  • Login or register
  • Search
This Thread
  • Everywhere
  • This Thread
  • This Forum
  • Articles
  • Pages
  • Forum
  • Blog Articles
  • Products
  • More Options
  1. Robotforum - Support and discussion community for industrial robots and cobots
  2. Forum
  3. Industrial Robot Support and Discussion Center
  4. KUKA Robot Forum
Your browser does not support videos RoboDK Software for simulation and programming
Visit our Mainsponsor
IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Sponsored Ads

Changing $TOOL not working

  • spacebots
  • April 23, 2024 at 12:32 AM
  • Thread is Resolved
  • spacebots
    Trophies
    1
    Posts
    7
    • April 23, 2024 at 12:32 AM
    • #1

    Hello all,

    KR210-R3100-2F
    KR C4
    KSS 8.6.11
    KS V8.6.567
    ArcTech Basic 3.6


    I'm having trouble changing which tool is selected in a program.

    I'm trying to select the tool from index 4 of the TOOL_DATA array using "$TOOL=TOOL_DATA[4]".

    I've verified that index 4 of the TOOL_DATA array has the correct values in my $config.dat file.

    However, after executing this line of code, the number on the tool icon on the HMI does not change value and the robot movements are executed with the old tool, not tool 4.


    Example of code below:

    DEF example()

    $ADVANCE=3

    HomeApproach() ;This moves the robot to home, then to a position near a table, using tool 1 and base 0, programmed with ILFs

    $TOOL=TOOL_DATA[4]

    LIN {X 1200,Y 200,Z 1500} ;I expected this to move using tool 4, but it moves using tool 1 instead

    END


    Apologies if there is some obvious mistake I'm missing. Still getting used to programming without the ILFs. Thanks!

  • panic mode April 23, 2024 at 2:35 AM

    Approved the thread.
  • panic mode
    Reactions Received
    1,280
    Trophies
    11
    Posts
    13,083
    • April 23, 2024 at 3:07 AM
    • #2

    That does set tool as far as robot is concerned. But this has nothing to with HMI.

    In fact tool_data[4[ is simply a variable of type frane, and the line simply copies the value blindly to $TOOL. Beyond that, the index value is lost or not processed in any way.

    Also tool_data[] array is not even a system variable... Just like

    decl frame my_tool[500]

    ;

    $tool = my_tool[487]

    So how is KSS to know what to do with 4 or 487? The answer is simple...it does not so it does nothing.


    If you want HMI to display the tool index, you need to write code that does just that if i recall, variable name is $ACT_TOOL


    Check punned topic READ FIRST for info on getting documentation...

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • hermann
    Reactions Received
    407
    Trophies
    9
    Posts
    2,611
    • April 23, 2024 at 5:33 AM
    • #3

    Second thing is that an ILF always set the tool according to the tool selected in the ILF. When you set $tool and then use an ILF your assignment to $tool is obsolete.

    Best choice IMHO is to use BAS(#tool, 4) to set tool no 4, this sets everything like tool, load and the number shown on hmi.

  • spacebots
    Trophies
    1
    Posts
    7
    • April 23, 2024 at 3:28 PM
    • #4
    Quote from hermann

    When you set $tool and then use an ILF your assignment to $tool is obsolete.

    Thanks hermann. But I’m setting $TOOL after the execution of HomeApproach ends, not before it begins. I assumed the order mattered. Is that not the case since HomeApproach uses an ILF?


    Thanks for the suggestion to use BAS for this instead.

  • panic mode
    Reactions Received
    1,280
    Trophies
    11
    Posts
    13,083
    • April 23, 2024 at 3:32 PM
    • #5

    yes.. Bas call is more compact than typing two lines

    Code
    $TOOL=TOOL_DATA[4]
    $ACT_TOOL= 4

    or make your own variant, something like

    Code
    Set_Tool(n:in)
      DECL INT n
      $TOOL=TOOL_DATA[n]
      $ACT_TOOL= n
    END

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • spacebots
    Trophies
    1
    Posts
    7
    • April 23, 2024 at 3:48 PM
    • #6

    Thanks panic, I see what you mean about setting $ACT_TOOL as well.

  • hermann
    Reactions Received
    407
    Trophies
    9
    Posts
    2,611
    • April 23, 2024 at 9:37 PM
    • #7

    And what about the load data? If there are questions about precision of movements the first question is about load data.:winking_face:

  • panic mode
    Reactions Received
    1,280
    Trophies
    11
    Posts
    13,083
    • April 23, 2024 at 10:06 PM
    • #8

    sigh...

    that is what inline forms are for. people that do not know enough about the robots should really get someone knowledgeable to do initial commissioning (check supply, power up, use correct MADA, set tools/ bases/loads, configure tech options etc.). only then, those with limited experience may be allowed to modify existing or make new simple programs, and using only inline form instructions.

    KRL programming without inline form motions should be left to experts... and experts will know if and when load changed and if that need to be controlled. just because someone selects another tool, it does not mean that load changed. same goes when one is doing calculations involving flange for example. just because i am changing tool data to get TCP where i need it, it does not mean that load carried by robot is any different.

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • spacebots
    Trophies
    1
    Posts
    7
    • April 23, 2024 at 11:31 PM
    • #9

    Whoa, I never mentioned load data, and I never assumed changing the value assigned to $TOOL would have any affect on load data, given that all it's assigning is a FRAME. I had observed that the TCP's frame wasn't changing when I expected it would, and was curious why, that's all.

  • panic mode
    Reactions Received
    1,280
    Trophies
    11
    Posts
    13,083
    • April 24, 2024 at 12:16 AM
    • #10

    changing $TOOL does not have any effect on $LOAD and the other way around. but the default when using inline form instructions is that selecting tool, also automatically assigns load with same index.

    so if inline form motion is using tool 4, it will assign both tool and load, equivalent to

    Code
    $TOOL=TOOL_DATA[4]
    $ACT_TOOL=4
    $LOAD=LOAD_DATA[4]


    so when robot is used to pick and place parts, one could create two tools,both would have same TCP and orientation, but load data would be different (one is just gripper, the other is gripper with load). one does need to specify load all the time. failure to do so can and will damage the robot.

    i have first hand experience with such cases. my favourite is the one where forced to do something that was not meant for and with load not set correctly. after about a year of bleeping messages, that were ignored, motor failed. was replaced, and client wanted explanation for failure. the only thing wrong was that load data was not entered and robot was using factory default (which happened to be a lot, and this type of mistakes are common). year later same thing happened again. this time they did have entered reasonable load data but they changed the programming and failed to use the load data. so robot was still being stressed exactly the same way.

    the robot was doing weaving while arc welding huge circular paths. so it was constantly accelerating and decelerating unaware that it is using very wrong load data - that happen to be 175kg dumbbell used in factory stress tests, rather than actually mounted federlight torch (maybe 1kg) . robot was literally tearing itself apart and complaining loudly. but the messages were ignored and both motors were cooked... motors just happen to be one component that failed but everything else was also stressed excessively - cables, connectors, gearboxes, bearings. some of them amy fail and need replacement, others will keep on working while sustaining unreasonable levels of wear.

    which is why initial commissioning and correct setup is so important, robot will spend years doing same set of motions over and over and stopping at same few points. so you do not want to let rookies start the robot up or write key programs. they need to start low, take training, tag along with someone experienced, make changes to already good programs, follow good practices until they are up to speed... and there is a lot to learn. for example load is not just the mass of the tooling, it is also inertia. people who do not know how to manually calculate inertia should not be allowed to change load data - they will have no idea if values they are typing in make any sense and their ignorance can literally kill that robot way too soon.

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • spacebots
    Trophies
    1
    Posts
    7
    • April 24, 2024 at 12:30 AM
    • #11

    Thank you for sharing your experience. I've had similar experiences. Not a rookie at robots and have lurked in all parts of robotforum since 2015, just not as familiar with KRL. I understand when to change load data and the dangers of not doing so. This was a simple test to change the tooldata between 2 tools that have the same payload, moments of inertia, etc.

  • panic mode
    Reactions Received
    1,280
    Trophies
    11
    Posts
    13,083
    • April 24, 2024 at 1:36 AM
    • #12

    when in doubt, initialize all thing you need yourself - never assume that things may be right...

    for example all motion parameters including tool ,load, base, velocities etc should be initialized all the time. but this is one thing that is often skipped, specially when mixing ILF and non-ILF code. so i prefer to keep them separate, not because of me but because i am not sure ho may be the next person to work on it.

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

Advertising from our partners

IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Advertise in Robotics
Advertise in Robotics

Job Postings

  • Anyware Robotics is hiring!

    yzhou377 February 23, 2025 at 4:54 AM
  • How to see your Job Posting (search or recruit) here in Robot-Forum.com

    Werner Hampel November 18, 2021 at 3:44 PM
Your browser does not support videos RoboDK Software for simulation and programming

Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Thread Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Similar Threads

  • i try to use for the first time my two kuka agilus kr6 r700 sixx robots and i have some problems,could you please give some help?

    • angelos vassiliou
    • October 24, 2020 at 5:09 PM
    • KUKA Robot Forum
  • KUKA base transformation not accurate enough

    • PauBot
    • November 7, 2022 at 5:59 PM
    • KUKA Robot Forum
  • array/grid-wise measurement with kuka robot

    • El_Mo
    • June 25, 2022 at 3:43 PM
    • KUKA Robot Forum
  • Maintenance of Kuka robot

    • KovBo
    • June 28, 2022 at 11:18 AM
    • KUKA Robot Forum
  • K-Roset Error System.AccessViolationException

    • ShAdOwDrAgOnS
    • June 14, 2022 at 7:10 AM
    • Kawasaki Robot Forum
  • Using KUKA.SafeOperation and avoid

    • ChristianLiinHansen
    • June 15, 2022 at 10:28 PM
    • KUKA Robot Forum
  • kuka krc2 - laser cutting

    • m.dinio
    • April 30, 2022 at 9:50 PM
    • KUKA Robot Forum
  • Changing the Axis Limit to prevent collision

    • SamtheRam
    • November 11, 2021 at 2:35 AM
    • KUKA Robot Forum
  • Motion as IN OUT parameter

    • pavlan1
    • March 26, 2021 at 8:22 AM
    • KUKA Robot Forum
  • Jog frame Data in variables?

    • Hurricaner
    • December 15, 2020 at 3:16 PM
    • Fanuc Robot Forum

Tags

  • KUKA
  • KRL
  • tcp
  • $TOOL
  • TOOL_DATA

Users Viewing This Thread

  • 1 Guest
  1. Privacy Policy
  2. Legal Notice
Powered by WoltLab Suite™
As a registered Member:
* You will see no Google advertising
* You can translate posts into your local language
* You can ask questions or help the community with your knowledge
* You can thank the authors for their help
* You can receive notifications of replies or new topics on request
* We do not sell your data - we promise

JOIN OUR GREAT ROBOTICS COMMUNITY.
Don’t have an account yet? Register yourself now and be a part of our community!
Register Yourself Lost Password
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on Google Play
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on the App Store
Download