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. Cobot Help and Discussion Center
  4. KUKA LBR IIWA
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

Testing External control via UDP interface KUKA LBR iiwa

  • AndreaC
  • October 4, 2022 at 9:17 AM
  • Thread is Resolved
  • AndreaC
    Trophies
    1
    Posts
    4
    • October 4, 2022 at 9:17 AM
    • #1

    Hello, I'm testing the external control via the udp interface between the robot and a pc. I followed all the steps described in the user manual (chapter 12) in order to setup correctly the ports and ip. On my pc I'm running the simple example described in the doc. The execution is blocked in correspondence of the first receive statement, seems that the controller dosen't send the answer to the get_state message. Do you have any advice?

    -controller ip 172.31.1.10

    -pc ip 172.31.1.15

    The get_state message is sent to 172.31.1.10:30300 and I'm waiting on port 30001 (the port that I configured in the sunrise project setting).

  • AndreaC
    Trophies
    1
    Posts
    4
    • October 4, 2022 at 9:21 AM
    • #2
    Java
    import java.net.*;
    import java.util.concurrent.TimeUnit;
    class UdpSample{
        public static void main(String args[]) throws Exception{
            DatagramSocket mySocket = new DatagramSocket(30001);
    
            // robot address (please adjust IP!)
            InetSocketAddress robotAddress = new InetSocketAddress("172.31.1.10", 30300);
            System.out.println("--> pre send");
            
            // get robot state
            
            byte[] msg = String.format("%d;1;Get_State;true", System.currentTimeMillis()).getBytes("UTF-8");
            
            
            System.out.println(String.format("%d;1;Get_State;true", System.currentTimeMillis()));
            mySocket.send(new DatagramPacket(msg, msg.length, robotAddress));
            System.out.println("--> after send");
            
            // receive answer state message
            byte[] receiveData = new byte[508];
            DatagramPacket receivePacket = new DatagramPacket(receiveData, receiveData.length);
            System.out.println("--> pre receive");
            mySocket.receive(receivePacket);
            
            
            System.out.println("--> blocked  before this statement");
            /*
            // extract counter
            String[] stateMessage = new String(receivePacket.getData()).split(";");
            long counter = Long.parseLong(stateMessage[2]);
            System.out.println("--> COUNTER");
            // start application by sending a rising edge
            // (false->true) for App_Start
            msg = String.format("%d;%d;App_Start;false",System.currentTimeMillis(), ++counter).getBytes("UTF-8");
            mySocket.send(new DatagramPacket(msg, msg.length, robotAddress));
            msg = String.format("%d;%d;App_Start;true",System.currentTimeMillis(), ++counter).getBytes("UTF-8");
            mySocket.send(new DatagramPacket(msg, msg.length, robotAddress));
            */
    
        }
    }
    Display More
  • mabot
    Trophies
    1
    Posts
    17
    • October 16, 2022 at 12:06 PM
    • #3

    I think you can check PC's firewall or security software.

  • kiiwa
    Reactions Received
    9
    Trophies
    4
    Posts
    369
    • October 21, 2022 at 2:03 PM
    • #4

    You can only use ports in the (30000-30010) range on the LBR iiwa. Try changing 30300 to 30003.


    Images

    • pasted-from-clipboard.png
      • 19.83 kB
      • 740 × 194
      • 1

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

  • KUKA
  • lbr
  • Sunrise.Workbench
  • udp
  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