Sending UDP packets

  • Hi everyone,


    I am trying to send some values from my iiwa to my Laptop using UDP. I followed simple tutorials for sending a String to an external machine. The Robot class for sending the packets Looks like this:



    and on the PC side I created a simple listener in python but it never receives any data:




    My Laptop is directly connected to the X66 port of the cabinet and I have tried in AUT, T1 but still doesnt work. Is there any configuration I have to do in sunrise or do you have any idea why it is not working?


    Tnhanks in advance

  • Do I need to have any optional package installed for allowing the communication with the PC through UDP? I can´t make it work :icon_frown:

  • Are you sending the data from the cabinet to the cabinet?


    When you construct your datagram packet you need to pass the destination IP address not the source

  • You are right NullReference. I am trying to send from the cabinet to the pc. Which port do I have to pass when constructing the datagram packet?


    I am able to receive info in my cabinet sent from the PC and then get the port of the received datagram to send an answer, but I noticed the port always changes with every datagram and what I really want to do is to first send from the cabinet but I dont know which port to use. Thank you!


  • You are right NullReference. I am trying to send from the cabinet to the pc. Which port do I have to pass when constructing the datagram packet?


    I am able to receive info in my cabinet sent from the PC and then get the port of the received datagram to send an answer, but I noticed the port always changes with every datagram and what I really want to do is to first send from the cabinet but I dont know which port to use. Thank you!


    You don't need to install any optional package to use TCP/UDP. You need to use ports only in the [30000-30010] Range. So, use 30.000 to send from PC--> Robot and 30.000 to send from Robot-->PC, i.e.
    It didn't work because you were sending to your Robot (local machine) and not to the external PC, and you didn't use a robot application to run your class.
    Here's your example adapted. copy both of the to your work-space and run the second. Be sure to use your PC's IP address (the one in the example is (172.31.1.135)


  • Hello
    I am in a similar situation. The robot can not communicate with the PC using UDP.
    I am using port 30000.
    Using the above program did not work well.
    If so, where should I check? Please help me. :help:


    Robot: iiwa 14 R820 SunriseOS 1.13
    Station Server IP : 172.31.1.147
    PC IP : 172.31.1.116



    I tried to find the PC by ping command from iiwa.



    But it does not work well. On the other hand, from the PC I can find 172.31.1.147 with the ping command.



  • Can you send from PC--> IIWA but not IIWA --> PC? Did you check your firewall settings?

Advertising from our partners