Communication between kuka lbr iiwa 7 and PC

  • Hello guys,
    I'm working with kuka lbr iiwa 7 r800 and I want to write a program that will wait for signal from the PC and depending on received signal it will execute appropriate function on the robot. In documentation I have found something about UDP protocol. Is it possible to send some information via UDP to robot? And not only to start or stop program like in external control. If yes, then how should I do this?

    I will be really greatfull for your help!

  • I've never done this, but my understanding of the iiWA is that the Sunrise operating system makes it possible to do almost anything a normal PC running Java can do. So it should be possible to write a UDP or TCP/IP communication subroutine in "plain" Java using example code from typical examples available from Java books or sites like StackOverflow.


    A corresponding program would have to be written on the remote PC, of course.

  • Ok I understand, but what about hardware? To which slot should I connect the ethernet cable? X66 Kuka Line Interface or LAN Onboard – KUKA Option Network Interface ? And is it necessary to configure it in Work Visual?
    Sorry for my stupid questions but I've started working with this robot a while ago and there is not much informations about it in documentation.

  • be careful with using WorkVisual with LBR.


    First of all you must make sure that you are using exact WorkVisual version that is compatible with specific SunriseOS version that your system runs.


    And making mistake in WorkVisual (an easy thing to do) can be a pain to fix.


    Fortunately WorkVisual is rarely used here - it is only used to configure IO, everything else is done in SunriseWorkBench itself.

    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

  • You can use KONI for UDP, but it requires FRI as I understand.

    *Point it out if it is wrong, I always use FRI option when I use KONI port.


    Then you should be clear about which port, which IP is set at the KONI port.

    You can edit them at StationSetup.cat.


    For the UDP communications, I think you might use these in code.

    java.net.DatagramPacket;

    java.net.DatagramSocket;

    java.net.InetAddress;


    About UDP there are some port number limitations, it's written in "Operating and Programming Instructions for System Integrators" section 12.3

  • I've never done this, but my understanding of the iiWA is that the Sunrise operating system makes it possible to do almost anything a normal PC running Java can do. So it should be possible to write a UDP or TCP/IP communication subroutine in "plain" Java using example code from typical examples available from Java books or sites like StackOverflow.


    A corresponding program would have to be written on the remote PC, of course.

    I've done it like you said. First I've made client and server between 2 computers just to check if code is OK. Then I've made server on the robot in a thread which I'm starting when I want to receive a message from the PC. It works perfectly, I can easly send any string message to robot and it will receive it.

    I've connected ethernet cable to KLI (didn't try other slots). Configuration in WorkVisual wasn't necessary.

    Yes, on kuka iiwa slots for UDP for user are in range of 30000-30010. If I've used other ones there was an error "the slot is in use".

    Thank you guys very much for help! On Monday I will paste here a code. Maybe it will be helpful for someone. :smiling_face: :top:

  • Main program:

    And thread:

Advertising from our partners