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 xml files using Server/Client TCP socket.

  • Jasser
  • November 4, 2021 at 11:44 AM
  • Thread is Unresolved
  • Jasser
    Trophies
    2
    Posts
    3
    • November 4, 2021 at 11:44 AM
    • #1

    Hello everyone,

    In my works I want to send XML files throw a TCP/IP connection (ETHERNET cable) from my pc as a severe to my KRC 4 as a client (robot KUKA KR-16-2).

    I'm working on a python program that suppose to send XML file to the KUKA controller robot using Server/Client TCP socket.

    But the problem is I have to send my XML file always like a bytes (image1). So can the kuka controller understand that the information received is an XML file and used in a KRL code ?

    In my XML file I want to send the variation of an analogic signal (angular variation of a joystick) so the value inside the XML file need to be updated every time the angulation value of the joystick change, so it's possible to do that using Server/Client TCP socket?

    Thanks for help.

    Images

    • image1.png
      • 29.68 kB
      • 617 × 529
      • 62
  • panic mode
    Reactions Received
    1,296
    Trophies
    11
    Posts
    13,136
    • November 4, 2021 at 1:40 PM
    • #2

    check documentation for EthernetKRL

    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

  • johncena690
    Trophies
    1
    Posts
    5
    • March 30, 2023 at 4:27 PM
    • #3

    any chance this issue was resolved. I tried a similar method and it says "Machine Actively refused the connection".

    Do you have any idea how to rectify this error?

  • panic mode
    Reactions Received
    1,296
    Trophies
    11
    Posts
    13,136
    • March 30, 2023 at 5:17 PM
    • #4

    the XML structure in your TCP message that you are sending must match EKI configuration...

    if the format does not match, received messages will not be decoded.

    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

  • johncena690
    Trophies
    1
    Posts
    5
    • March 30, 2023 at 6:38 PM
    • #5

    <cloud>

    <para>

    <weld>

    <ps1pow>10</ps1pow>

    <ps1al>5</ps1al>

    <ps1dc>6.6</ps1dc>

    <ps1bb>-5.8</ps1bb>

    <ps2pow>1.1</ps2pow>

    <ps2al>5.5</ps2al>

    <ps2dc>6.6</ps2dc>

    <ps2bb>-5.8</ps2bb>

    <weldvel>0.5</weldvel>

    </weld>

    </para>

    </cloud>

    this is the .xml file I have. Can you let me know if this is right?

  • panic mode
    Reactions Received
    1,296
    Trophies
    11
    Posts
    13,136
    • March 30, 2023 at 7:54 PM
    • #6

    how would i know? you did not share the EKI configuration. both message and configuration need to match.

    when send config looks like this:

    Code
    <SEND> 
      <XML>            
        <ELEMENT Tag="FromKRC/TickCount"/>              <!-- INT -->
        <ELEMENT Tag="FromKRC/Ready"/>                  <!-- bool -->
        <ELEMENT Tag="FromKRC/Faulted"/>                <!-- bool -->
        <ELEMENT Tag="FromKRC/DrivesOn"/>               <!-- bool -->
        <ELEMENT Tag="FromKRC/AtHome"/>                 <!-- bool -->
     </XML>
    </SEND>

    message sent by robot would look like this (shown with line breaks):

    Quote

    <FromKRC>

    <TickCount>666</TickCount>

    <Ready>1</Ready>

    <Faulted>0</Faulted>

    <DrivesOn>1</DrivesOn>

    <AtHome>1</AtHome>

    </FromKRC>

    Display More

    the same thing is for reverse (robot receiving).

    the XML configuration tells to EKI how to format send message (encode) and parse received message (decode).

    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

  • johncena690
    Trophies
    1
    Posts
    5
    • March 30, 2023 at 8:10 PM
    • #7

    This code snippet you shared is when the external pc is receiving data from kuka krl right?

  • panic mode
    Reactions Received
    1,296
    Trophies
    11
    Posts
    13,136
    • March 30, 2023 at 8:17 PM
    • #8

    yes... as stated in the previous post.

    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

  • johncena690
    Trophies
    1
    Posts
    5
    • March 30, 2023 at 8:26 PM
    • #9

    this is the config file snippet

    Code
    <RECEIVE>
        <XML>
            <ELEMENT Type="REAL" Tag="cloud/para/weld/ps1pow"/>
            <ELEMENT Type="REAL" Tag="cloud/para/weld/ps1al"/>
            <ELEMENT Type="REAL" Tag="cloud/para/weld/ps1dc"/>
            <ELEMENT Type="REAL" Tag="cloud/para/weld/ps1bb"/>
            <ELEMENT Type="REAL" Tag="cloud/para/weld/ps2pow"/>
            <ELEMENT Type="REAL" Tag="cloud/para/weld/ps2a1"/>
            <ELEMENT Type="REAL" Tag="cloud/para/weld/ps2dc"/>
            <ELEMENT Type="REAL" Tag="cloud/para/weld/ps2bb"/>
            <ELEMENT Type="REAL" Tag="cloud/para/weld/weldvel"/>
        </XML>
    </RECEIVE>
    Display More

    this is the xml file snippet

    Code
    <cloud>
      <para>
        <weld>
          <ps1pow>10</ps1pow>
          <ps1al>5</ps1al>
          <ps1dc>6.6</ps1dc>
          <ps1bb>-5.8</ps1bb>
          <ps2pow>1.1</ps2pow>
          <ps2al>5.5</ps2al>
          <ps2dc>6.6</ps2dc>
          <ps2bb>-5.8</ps2bb>
          <weldvel>0.5</weldvel>
        </weld>
      </para>
    </cloud>
    Display More

    I am trying to send the data from my PC to the KUKA Controller

  • panic mode
    Reactions Received
    1,296
    Trophies
    11
    Posts
    13,136
    • March 30, 2023 at 8:34 PM
    • #10

    before message exchange can take place, connection need to be established. this also means one node is to work as a client, the other as server, server must be started first then client need to connect to server etc.

    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

  • johncena690
    Trophies
    1
    Posts
    5
    • March 30, 2023 at 8:39 PM
    • #11

    So If I start the server first and then send this xml straight forward using python based TCP/IP it should work right.

    But still the same error keeps coming (Target Machine Refusing the connection). Can you let me know how to send the xml file directly through python and are any more modifications required in the xml or config file?


    I used EthernetKRL_Server.exe file to send data using their own interface and then there wasnt any issue( by directly copy-pasting the xml file).

    But while using python the connection issue is popping up.

  • SkyeFire
    Reactions Received
    1,060
    Trophies
    12
    Posts
    9,456
    • March 30, 2023 at 8:56 PM
    • #12
    Quote from johncena690

    I used EthernetKRL_Server.exe file to send data using their own interface and then there wasnt any issue( by directly copy-pasting the xml file).

    But while using python the connection issue is popping up.

    Same computer/cables/network switch/etc?

    Then the problem probably has to be with your Python program. But there are about 5000 different methods to open TCP/IP connections in Python. And since whatever Python library you're using is throwing that error, you need to look into the documentation for that Python library.

  • panic mode
    Reactions Received
    1,296
    Trophies
    11
    Posts
    13,136
    • March 30, 2023 at 8:56 PM
    • #13

    if you want your computer and robot controller to talk to each other, they need to be on a same network and have compatible network settings. and make sure you are connecting to a correct port.

    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

  • MOM
    Reactions Received
    176
    Trophies
    7
    Posts
    1,424
    • March 31, 2023 at 4:53 PM
    • #14
    Quote from johncena690

    I used EthernetKRL_Server.exe file to send data using their own interface and then there wasnt any issue( by directly copy-pasting the xml file).

    I think here a different network is used (SMEM)

    Quote from johncena690

    But while using python the connection issue is popping up.

    did you run your python on the krc (SEM) or from a different computer (LAN)?

    In this case you are using a network which cannot be reached by your program unless your kli settings are correct

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
  • krc5
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • 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
  • krc5
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Tags

  • KRC4
  • Python
  • TCP/IP
  • xml file
  • KUKA kr16
  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