kuka configuration in Tia portal

  • Could anybody advise me how to configure a system s1500 - master and kuka krc4 - slave in the tia portal v15+? I mean that I don't understand should I use Tsend/Trecieve blocks to set I/O exchange between s1500 and kuka krc4? either not?
    For example,when I needed to connect s300 plc as master to kuka krc4 and create i/o exchange, I had to create different FC blocks, OB80, OB81 -- OB86 (clearly don't know the purpose, these were empty, but the manual told me to use it). Moreover, PNIO_send and PNIO_recv were also used to control inputs of kuka by s300 and outputs of s300 by kuka . So what's he difference while making the same kind of connection by Tia Portal? I didn't manage to find useful manual on this theme.

    Besides, I know about MxAutomation, but that's not what I want.

  • you know, you could take the training or read the manual...


    OB = "Organizational Block", basically it is a program.


    for example:

    OB1 = main program, this is where you put your own code (or call to program where your code is)

    OB1 is called cyclically to give illusion of "continuous" run


    Some other OBs are used to handle various situations like connection timeouts etc. They are normally only called when some event occurs (for example lost PNET connection, scan time exceeds WDT limit, backplane error, power supply error etc.).


    OB81 is related to power supply error if i remember...


    so your project CAN have just the OB1 ... but .... if any diagnostic event occurs and related OB is not added, PLC will fault out and stop running. but if you add related OB to your blocks, PLC will have a chance to keep on running even if there is a fault... because corresponding OB will be called or executed (even if empty). for example OB81 is only executed when powering down, meaning you cannot even monitor it... but it will work when event takes place.

    so if you want to detect connection is broken or one of partner modules is no longer responding, or similar, your program need to contain related OB and you can add your own code inside them.


    nowdays i hardly touch PLCs. a while ago i did training cell with small Siemens safety PLC and as i recall you should not need to use functions to do cyclical transfer. but you do need to configure both PLC and robot according to documentation.


    for me this meant upgrading PLC firmware, importing GSDML from WoV folder into TIA catalog, then adding it to a project, configuring, rebooting and testing. worked like a charm

    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

  • Thanks for your detailed response, but the only thing I worry about right now is 'do I have to use Psend/Precv / Tsend/Trecv blocks in the Tia portal for inputs/outputs mapping or not?'

  • No PSEND/PRECV needed

    If the connection is done over ProfiNet than:


    • You load the GSDML file into TIA portal
    • You add the KUKA controller to your hardware configuration
      • Under this configuration you set the start address for your communication... I guess it was 4096 inputs and 4096 outputs...
      • You set your profinet device name and IP address.
    • In Kuka Work Visual software you map your inputs and outputs to this ProfiNet range.
      • $IN[1] to ProfiNet input [1]
      • $IN[2] to ProfiNet input [2]
      • $OUT[1] to Profinet output [1]
      • $OUT[2] to Profinet output [2]
      • If your start address was 100 then this $IN[1] to KUKA would be Output Q100.0 from the PLC
        $OUT[2] would be Input I100.1 to the PLC
    • After you Deploy the modified WorkVisual project to your KUKA controller, the connection should go GREEN between the KUKA contoller and the PLC. The I/O-s come through.
  • No PSEND/PRECV needed

    If the connection is done over ProfiNet than:


    • You load the GSDML file into TIA portal
    • You add the KUKA controller to your hardware configuration
      • Under this configuration you set the start address for your communication... I guess it was 4096 inputs and 4096 outputs...
      • You set your profinet device name and IP address.
    • In Kuka Work Visual software you map your inputs and outputs to this ProfiNet range.
      • $IN[1] to ProfiNet input [1]
      • $IN[2] to ProfiNet input [2]
      • $OUT[1] to Profinet output [1]
      • $OUT[2] to Profinet output [2]
      • If your start address was 100 then this $IN[1] to KUKA would be Output Q100.0 from the PLC
        $OUT[2] would be Input I100.1 to the PLC
    • After you Deploy the modified WorkVisual project to your KUKA controller, the connection should go GREEN between the KUKA contoller and the PLC. The I/O-s come through.

    1. When I add PROFINET into WorkVisual's tree, inputs from the right side start from 16.0, while outputs start from 15.0 and I can't edit it. I've set 64 I/O profinet device, I've set a name 'krc4' in the profinet settings and tia portal respectively, but! To what device of kuka's three devices in the tree of Tia Portal should I set a name 'krc4'? I will attach a snap, that's really hard to realise!

    2. Kuka has a massage on smart pad "error while reading PNIO-DEV; Connection between PLC and krc4 could not be established in 2000 ms" - the translation in english could be different!!!
    3. I have a connection between plc 1500 and kuka krc4 trough wi-fi, is it ok? Everything pings nicely, I have no any error while being online in Tia Portal.

  • 1. You should drag one thing to TIA hardware. KRC4-ProfiNet_4.1

    I have the following hierarchy.

    • KRC4
      • Interface1
        • Port1
    • 256 digital in- and outputs_1

    And if you open the KRC4 under "Device View" tab and you open the properties pane for that, you can see additional settings.

    General > Profinet Interface [X1] > Ethernet addresses > ...

    I have checked "IP address is set directly at the device"

    And further down there is:

    - PROFINET device name: kuka-noname

    - Converted name: kuka-noname

    - Device number: 1


    2. I think I have seen this error... I guess you have used a wrong version of the GSDML file - too old. All the the versions are under Program Files/Kuka/WorkVisual 6.0/DeviceDescriptions/GSDML. Pick the one that you have in the actual controller. Import that to TIA Portal and use it in your hardware configuration.

    3. I have not tried with WiFi... I would connect the Kuka controller, the PLC and the PC with a wired network.

    Edited 2 times, last by Koppel ().

  • Yes, you are right. The problem was in a wrong GSDML file, I've replaced it, but now I have an error 'no neighbourhood could be detected',

    "The port cabling or configuration is inconsistent:

    Description: You have configured a port interconnection but no partner was detected at the port.

    Possible causes: A non-PNIO-compliant device is connected to this port. The port interconnection is configured but there is no device connected or the partner device is switched off or the cable is defective.

    Solution: Adapt the configuration or the interconnection."

  • bad topology, you need to interconnect the devices:


    https://support.industry.sieme…45519/?page=0&pageSize=10

    Thanks. The problem has occured due to using wi-fi instead on ethernet cable. As soon as I've replaced wi-fi connection by cable, an error has gone.

    But now, after mapping of I/O in work visual and making simpe program in tia portal, I don't see correct relation between i/o of plc and kuka. I mean that when, for example, input 16.0==true on plc, at the same time input [1], which is mapped as in[1]==input 16.0 in WV, doesn't turn TRUE on kuka.
    So my thoughts are coming again to an idea that that's necessary to use some kind of Tsend/Trecieve blocks to make an exchange. :frowning_face:

  • what do you mean by "no correct relation between i/o of plc and kuka"?


    there is no signals turned on... or....they do turn on but do not correspond to your expecations?


    are you familiar with big/small endian?

    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

  • what do you mean by "no correct relation between i/o of plc and kuka"?


    there is no signals turned on... or....they do turn on but do not correspond to your expecations?


    are you familiar with big/small endian?

    what do you mean by "no correct relation between i/o of plc and kuka"? - I mean that I expect in[1] (of kuka) turning ON (==TRUE) when I turn ON in[16.0] (of PLC 1500), which are mapped to each other in work visual.

    Input on kuka, which is mapped to input of PLC, doesn't become ==TRUE (switched on), when I switch on (by force table) input on PLC to 1 (==TRUE).


    are you familiar with big/small endian? - I don't know what it is.

  • Yeah... that's some weird mapping.

    I also explained in my post

    "... $OUT[2] would be Input I100.1 to the PLC"


    The two devices are talking to each other.

    One speaks and the other one listens...

    In your case both are listening... hence the silence.


    Don't worry, you will get there... I know all of this is frustrating but this is how we all have learned - by making mistakes... a lot of mistakes.

  • It only make sense if you connect an output to an input.

    Setting one output at KRC should give you in input at the plc.


    As panic mode mentioned you also have to take "big/small endian" into account.

    (depending on the cpu type of plc low and high byte could in the opposite order)


    I also explained in my post

    "... $OUT[2] would be Input I100.1 to the PLC"

    Setting $OUT[2] would be seen either by I100.1 (same cpu type) or by I101.1 if in different byte order

  • 1. Guys, there is absolutely no difference between mapping PLC's input to kuka's input either PLC's output to kuka's input. If configuration is set correctly and right, both cases have to show the same result.

    2. Unfortunately, no one has explained, what "are you familiar with big/small endian?" is. No problem, I will google it after this post :winking_face:

    3. As I have already mentioned, block of DATA (i/o) exchange have to be added and used in tia portal configuration. I didn't find any clear solution of my problem in the net,but fortunately I've decided to test it and it's finally given a result!!!

    4. So, I guess that it would be respectful to all robo-programmers comrades to make a little resume of how it really configures.


    Resume:

    1. Load GSDML file of kuka, corresponding to your profinet version, into Tia Portal.

    2. Make a configuration in the hardware, where siemens plc - master, kuka plc - slave.

    3. Set start addresses of i/o in kuka's properties.

    4. Create FC block. Add 2 networks withe following blocks- 1st - DPWR_dat, 2nd - DPRD_dat. Fill the inputs and outputs of these blocks. LADDER - kuka's module of inputs/outputs, which you've added inside you gsdml kuka device (device & network). RECORD - your DB for write data and DB for read data. RET_VAL - any variable of integer (#retval - example).

    5.Call FC in the OB1.

    6. Don't forget to set right IP addresses.

    7. Might I've missed something obvious, but the most important steps inside Tia portal - are mentioned.

    8. In Work Visual add PROFINET, make necessary setting (corresponding to previously set parameters in Tia Portal)

    9. Mapping of outputs and inputs.You are able to map as master's inputs to slave's outputs as master's inputs to slave's outputs respectively.
    Example:

    • $IN[1] to ProfiNet input [10.0]
    • $IN[2] to ProfiNet input 10.1]
    • $OUT[1] to Profinet output [8.0]
    • $OUT[2] to Profinet output [8.1]

    10. Test dependence of kuka's I/O on master's I/O. If mapping has shown you what you've expected, everything is done!


    Don't forget to deploy your projects :winking_face:

  • 2. Unfortunately, no one has explained, what "are you familiar with big/small endian?" is. No problem, I will google it after this post :winking_face:

    As panic mode mentioned you also have to take "big/small endian" into account.

    (depending on the cpu type of plc low and high byte could in the opposite order)

    Checking google you may also find same results by searching LSB and MSB.

    (In profinet normally the big endian format ist used)

  • Quick note about sending bytes across KUKA and Siemens PLC:

    These devices use opposite endianness, which essentially means they order their bytes opposite of eachother when sending bigger data, like an integer.


    You can send an integer from the plc to the robot by:

    1. make a %QD# tag in the PLC tag list that you want to send to the robot.
    2. set up the IO mapping as usual on Workvisual (bit to bit) for your entire supported IO range that is allocated for PLC talk.
    3. In robot $config.dat, make a new signal with a 32 bit range (ie: SIGNAL my_integer $IN[153]  TO $IN[184]). Replace the values inside with the values needed to match up with the address byte you chose on the PLC side. This can sometimes be hard to match up.
    4. my_integer is now a global variable int, whose value is the integer made up by the bits between $IN[153]  TO $IN[184]
    5. Very important step: Siemens and Kuka have opposite endianness, so the integer value that you want to send has to go through a SWAP instruction in plc ladder logic so the bytes get flipped. (ie. int_you_want_to_send -> SWAP -> %QD#)


    • for sending integers to PLC, its similar but you have to flip the INs for OUTs and the QD for and ID
    • for sending REALS, you have to mulitply the value by, say 100, then convert to int, then divide it down by 100 on the other device. That would preserve 2 places after the decimal.
  • endianness matching can be also done in WoV IO mapping.


    for transferring REAL, what you describe is probably most commonly used (using conversion of floating point to fixed point). but it means data loss and reduced range. for certain application this may be ok but one could also transfer REAL - as is. all it needs is bit-by-bit copy of value which can be done in different ways. the fastest version (and easiest to program) is using CAST_TO/CAST_FROM like in some of examples i shared before.

    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

  • Hi everyone.


    I have a doubt, if the variables are declared in a db in tia portal, how do they communicate with the workvisual variables?


    Since the variables are in dbs they do not have addresses.

  • sure they do... everything has an address.


    how would you transfer value of something declared in one DB... to something else declared in another DB? exactly, you would have to write some code. same goes if you want to transfer values between DB and I/O.

    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

Advertising from our partners