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

Sending motion commands to a KUKA arm in server mode via EthernetKRL (from a Windows-host-based Python program)

  • reuben.brewer
  • September 28, 2023 at 7:58 PM
  • Thread is Unresolved
  • reuben.brewer
    Trophies
    1
    Posts
    2
    • September 28, 2023 at 7:58 PM
    • #1

    Hello


    I'm working with a KUKA KR10R1100_2 robot arm and would like to be able to tell it how to move to different poses (positions plus rotations) via a Python program on a Windows machine (as opposed to using the Teach Pendant or just sending over a canned-program).
    I'm curious about how to use RoboDK to:

    1. Put the KUKA robot into "server mode" where the robot's "background submit interpreter" can both
      1. receive raw-string commands (like what positions and angles the arm should move to next) FROM a host Windows computer over EthernetKRL and
      2. send back raw-string reports of its current position/speed/etc TO a host windows computer over EthernetKRL.
    • All code on the Windows host computer will be written in Python.
    • I'd like to send and receive the raw-strings messages (as opposed to XML messages) at 5-10Hz (every 0.1 to 0.2 seconds), which should be achievable over EthernetKRL (without needing the "real-time" control).
      • It's my understanding that we get to control the raw-string message format. I'd like to do this in JSON format, like: {"X": 1.0, "Y": 2.0, "Z": 3.0, "Rx": 0.4, "Ry": 0.5, "Rz": 0.6}

    Since this application involves writing code on BOTH the robot-side and the Windows host computer, I'm looking for sample code for each side (robot and Windows host). Any insights, advice, or sample code would be much appreciated!


    Thanks!


    --Reuben

  • Lemster68 September 28, 2023 at 8:09 PM

    Approved the thread.
  • Online
    panic mode
    Reactions Received
    1,267
    Trophies
    11
    Posts
    13,037
    • September 29, 2023 at 1:42 AM
    • #2

    since you plan on controlling message format yourself, you better read CWRITE manual

    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

  • Online
    SkyeFire
    Reactions Received
    1,042
    Trophies
    12
    Posts
    9,388
    • September 29, 2023 at 10:26 PM
    • #3
    Quote from reuben.brewer

    I'd like to send and receive the raw-strings messages (as opposed to XML messages) at 5-10Hz (every 0.1 to 0.2 seconds), which should be achievable over EthernetKRL (without needing the "real-time" control).

    Is the PC app driving the communications?

    What you're describing doesn't sound too hard. I've seen it done by setting the KRC to run as a server in UDP mode, and using the various Flags to detect if the connection is active, and if a new datagram has been received. It really simplifies things if you can ensure that the incoming datagram is always a fixed number of bytes -- use leading-zero padding, always include sign characters, stuff like that. Grabbing the string from the EKI input buffer and stuffing it into a CHAR array isn't too hard, and is in the manual examples.

    Parsing that raw JSON out will be something you'll have to program yourself, though. KRL doesn't handle JSON natively. It should be doable, I've done it with CSV data. But, again, if you can ensure that your incoming datagram string has a fixed number of bytes for each "variable", that will simplify your task a great deal.

  • reuben.brewer
    Trophies
    1
    Posts
    2
    • October 16, 2023 at 1:06 AM
    • #4

    panic mode : Could you please include a link and a page number for the CWRITE information that you mentioned? ("since you plan on controlling message format yourself, you better read CWRITE manual"). One of the issues that I've been running up against is the many, many manuals and knowing which ones to read :winking_face:

    SkyeFire : Yes, the PC app is driving the communications. Your idea sounds like what I'd like to do. Could you please send any example that you have, whether something from a manual or something that you've written? It doesn't need to be JSON-format specific, just anything where you're sending/receiving strings with KRC running in server mode.

    To both of you, many thanks for taking the time to help me out!

    --Reuben

  • Online
    panic mode
    Reactions Received
    1,267
    Trophies
    11
    Posts
    13,037
    • October 16, 2023 at 1:51 AM
    • #5

    check pinned topic READ FIRST. it tells among other things what the key manuals are,where and how one can get them.

    CWRITE manual covers few instructions that maybe mentioned but not covered in detail in system integrator manual. also searching forum posts for CWRITE will get you plenty of info.

    Few warnings:

    1. Also this is not very fast, so where possible it may be better to stick with XML.

    2. Parsing data is possible but it is tedious and one need to diligently test everything (there will be surprises). I ended writing own library for this reason. I always try to break things down into small and simple functions that are faster to test and behave the way i want.

    3. You will likely have to do similar as even some of built in instructions have limitations that may not be obvious. For example KRL does not really support strings. As a substitute it uses character array and there are some subtle differences and peculiarities.

    4. null character is treated as a string termination. if the received string contains null, anything that follows will still be there but it will not be displayed. In some cases this can be useful, in others it is a pain.

    5. SWRITE function allows creating of string content from different sources. IT is nice and flexible, supporting variety of format characters that could be used as separator. but SREAD which is supposed to be complementary function is not nearly as flexible. in fact it only supports space as separator. guess what you need to do when your message to be parsed contains something else (comma or semicolon... ). that's right, you need to do search and replace which is another performance penalty. and guess what happens when your string (JSON or whatever) contains several separators like commas, curly braces, etc. it is just more fun... but since you are in a position to choose your own format, you can do anything you like.

    also check German forum, there is a lot of tidbits as well.

    Zerstückeln eines Char Arrays und dessen Zuweisung als REAL Variable - Roboterforum.de - die Industrieroboter und Cobot Community
    Hallo zusammen, ich habe eine Frage bezüglich des Zerstückelns eines Char Arrays. Und zwar möchte ich mir bestimmte Zahlen aus dem Char Array rauspicken und…
    www.roboterforum.de

    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

  • DannyDJ
    Reactions Received
    62
    Trophies
    6
    Posts
    493
    • October 16, 2023 at 9:09 AM
    • #6

    Hello, you can also use C3 Bridge.exe for this instead of KUKA.Ethernet KRL. Its faster also than KUKAVarproxy, you have sample videos, etc...

    Thread

    C3 Bridge Interface Server

    Greetings everyone.

    I'd like you to meet the project that I've been working on for the last six months.

    It's called the C3 Bridge Interface.

    robot-forum.com/attachment/27492/

    The C3 Bridge Interface Server is a lightweight network application that allows remote clients to execute requests to the KUKA Cross 3 subsystem and return responses. The application provides advanced functionality and high performance.

    Some distinctive features

    • Well-documented application protocol. It is fully compatible
    …
    VDm
    August 21, 2020 at 12:27 PM

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

Tags

  • EthernetKRL
  • Python
  • server
  • server mode
  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