APAS KUKA Robot Communication Problem

  • Hello!

    I have a project with APAS KUKA robot, with KRC4 robot controller. The robot has Nexeed option package, to communicate with a Bosch Rexroth PLC. I want to send REAL variables to the PLC, but as you can see in the attached video, the variables are not working perfectly in the PLC.

    I have REAL global variables in the config.dat files, that I write only, when some statement become true. Then I have to convert the real variables, to integer variables with the following conversion function.

    After the conversion (that I do only when some statements become true), I store the values in global integer variables in the config.dat, and in the sps.sub I send out these integer variables to the output (output signal size is 32 bit long) every sps.sub cycle.

    Do you have any idea what can cause the problem? The variables are not not written at any other place. In the KUKA Actual Variable display the variables are consistent, the values are good, and not "jumping" back to 0, as I can see in the PLC variable list.

    Thanks very much for your help!


  • AD
  • In cases like this every small thing matters. Your flowery description doesn't help to find those traps.

    Here only helps the complete code, that handles the i/o.

    Setting global variables and using them in sps.sub sometimes make trouble. Why don't you calculate the variables in sps.sub? That would be the better solution, as you don't have any trouble with synchronizing.

  • I am calculating and converting the variables in the sps.sub, but only if some statement become true (boolean variable from PLC). Here is an example code, what I would like to do. I have to calculate for example a sum of real variables, but only when the PLC sends me a CALCULATE_REQUEST. If there is no CALCULATE_REQUEST I have to hold the variable in robot memory and send it to the PLC as well. This example code is similar like mine, but there is more variables to calculate in my program.

  • while code can run (no syntax errors) there are other problems with this and this is not going to work as you may have expected.

    1. For increment you should use one-shot logic. otherwise when PLC turns that input on, you will see random number of increments depending on how long the input is active.

    2. incrementing REAL variable makes no sense. REAL variable has fewer bits for mantisa/significand so REAL variable will have smaller range. Also REAL values are not evenly distributed meaning that adding fixed value will sooner or later reach some limit where the increment is too small to notice or make difference. And that is regardless how large the increment is. You can change 1 to something bigger such as 1000000 and it will still happen (only sooner) - variable value will stop increasing despite increment being added. this is common blunder as most people do not understand how REAL numbers work.

    3. your REAL_TO_INT code contains useless things. there is no need for lines 5,10,11,12.

    so it would be better to do this:

    but... that still does not solve issue of values being reset. and as already stated, that is not something caused here. check the nexeed option and PLC code. From what i see all values are cleared at once.

    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

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