how to control kuka using python

  • dear all

    i need some help to control my kuka kr6 r900 with controller krc4. i already installed kukavaryproxy in my krc4 controller and i need to use a remote computer with python to control my kuka robot can any one help me to tell me the procedure to follow it.

    thanks for your time

  • On KRC (this side is server):

    1. install KukaVarProxy server

    2. make sure to open port 7000

    3. make sure that server runs

    4. Connect Ethernet cable to KLI port


    On remote (this side is client):

    1. Connect Ethernet cable to to your remote.

    2. Make sure that your remote uses compatible network settings. ping KLI to verify.

    3. Write and run python code. (or whatever language you choose to use)


    Note, Your python code need to act as a TCP client, so...

    1. Open connection to KukaVarProxy using KLI port address and port 7000.

    2. Send message to KukaVarProxy. It need to follow correct format/structure.

    3. Receive response from KukaVarProxy. Decode it and use received data as you please.


    If you are writing your own client from scratch, it can be hard (ask me how i know), so use anything that will make the job easier. for example test it first with some other client (regardless what software it was written in). then if when you get stuck, use WireShark to confirm message and response are as expected. KukaVarProxy has simple client as well, but it is written in VB.NET so you will need to either translate or just write your own from scratch... unless of course you can find one created in python by someone else.


    There is a similar product called C3Bridge that implements similar functionality and has quite nice documentation. it is backwards compatible with KukaVarProxy but it also adds more functions. you can still use this documentation as a reference but... to work with KukaVarProxy you only need to implement two functions (0 and 1) - ASCII read and ASCII write.


    all other functions in that document use wide string and new format so they do not work with KukaVarProxy.

    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

  • panic mode


    in first i needs to appreciate you help big thanks for your reply. you right i will not start from scratch in coding i downloaded the code in github

    GitHub - akselov/kukavarproxy-msg-format: A class that can send and receive messages from KUKAVARPROXY throught Python or CPP.

    this code for a class that can send and receive messages from KUKAVARPROXY through Python. also another code for "A Python port of KukaVarProxy client (OpenShowVar)" was downloaded

    GitHub - linuxsand/py_openshowvar: A Python port of KukaVarProxy client (OpenShowVar)

    kindly i need to know from your experience the difference between both codes and when i can use each code.

    also if i used the the first code it is enough to send and receive data from kuka or i must use with it the second code for openshowvar in python.

  • One thing to say:

    when a robot program is running a lot of variables are write protected. In this case it looks like the system is not responding or you get a message like "variable is write protected"


    The reason for that is "Single Point Of Control"


    The idea behind:

    It should not make your life harder (programming), it should make life easier (survive)

  • Not in this file.

    You have to check the windows network cards.

    There should two of them

    one shared memory (192.0.1.2 - leave this one untouched)

    one physical network card (that is the one you need to talk to)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Register a new account
Sign in
Already have an account? Sign in here.
Sign in Now