Triggering a python script

  • Hello!
    I'm extremely new to robotics and am now working with a KR3 Agilus R540 off a KRC4 compact with KSS V8.3.20.
    I'm slowly working through simple guides and will undergo some training soon from KUKA themselves. I was just wondering however whether it is possible to, through KRL or WorkVisual (or infact any other method), trigger a python script to communicate with some external devices acting on the work project. For example triggering a script on a PC (or maybe the KRC4?) that will run small external motors turning knobs and actuators pulling levers.


    Is this a stupid question or is there a workaround? Sorry if this is doesn't make sense or is a naive question.
    Thanks alot

  • Place your Ad here!
  • Workvisual is used to configure robot, it would not be something that is used in operation.



    KSS has no way of starting external program. The only way to accomplish this is to have external program run in the background and check for something that KRL program influences (some variable). One rather crude workaround (that does not require access to variables) is to have KRL generate small file. External program could monitor for file presence and do some action (and delete file).

    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

  • That seems like it could work but the software limitations say "KicVarGateway could not be used in real-time applications". Should I take this to mean that i could not operate and pull variables from the KRC4 while its moving? I need to activate motors at a certain step in the robots path.


  • One rather crude workaround (that does not require access to variables) is to have KRL generate small file. External program could monitor for file presence and do some action (and delete file).


    How would i go about getting KRL to write this file?


  • That seems like it could work but the software limitations say "KicVarGateway could not be used in real-time applications". Should I take this to mean that i could not operate and pull variables from the KRC4 while its moving? I need to activate motors at a certain step in the robots path.


    You can read or write KRL variables using KicVarGateway while robot is moving. It is not suitable for establishing cyclic communication at the real-time cycle rate of the robot controller, either is KUKA.Ethernet KRL


    Try this:



    Python Module of KicVarGateway.KRC4: https://github.com/linuxsand/py_openshowvar


  • This is really great thanks! Last bit, what are the connections between krc4 and the pc?

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

Advertising from our partners