Reading and Writing to KRC4 IOs?

  • Hi all,
    Im wondering if anyone has tried reading and writing to the KRC4 IOs?
    Is there an IO mapping document, indicating what can be accessed from where?
    Currently we are programming the robot using the pendant in 'raw' format $IN and $OUT, so are they just boolean in such cases?
    Or do they get stored in a specific memory map and need to be accessed from the same?
    Any comments appreciated.
    Cheers
    N

  • Hello,
    what do you mean, if you say "mapping"?
    1. You can map physical IO's to kuka IO's in WorkVisual, in IO Mapping tab (and then you are mapping for example INPUT 1 from Beckhoff EL1809 to $IN[1] accessible in your programs)
    2. You can define signals, for example:
    Add line:

    Code
    SIGNAL iButtonStart $IN[8]


    in R1/System/config.dat file in USER GLOBALS fold. If you do it, you can simply use "iBtnStart" variable in your logic.


    Both cases are good described in System Integrator Manual.

  • robot has digital I/Os in address space $IN[1-4096] and $OUT[1-4069].
    those are logical I/O that programs can access.



    to connect those logical I/O to some fieldbus or physical I/O (PLC or input and output card for example) you need to do I/O mapping in WorkVisual. This is documented in WoV help and manual. Also it was discussed many times in this forum.

    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 guys,
    Thanks for your responses.


    So I'm trying to map the robots digital IOs to my Anybus x gateway module.
    I'm mapping IN[1] to IN[xx] and OUT[1] to OUT[xx] to my Gateway IOs 8 input bytes and 8 output bytes.
    And now the Anybus side the IOs are addressed as 16,18,20... and outputs as 19,21,23...
    Apologies as I know it's over my technical knowledge to set this up but I'm a quick learner so please bear with me.


    The Other end of the Anybus gateway is a generic hmi working on modbus tcp.


    I have connected the test rig as such,


    PC <-> Anybus <-> Modbus tcp side <-> generic hmi and the PIO will be connected to the network switch where the KRC is connected.


    I tried ping and the network switch, anybus and hmi are all responding successfully.


    Now my question regarding the Modbus TCP.


    I have created some tags like CONF_MESS , STOPMESS, DRIVE_START,....etc


    So based on both responses above I'm not really creating the right tags on my generic hmi side to send valid data.


    Now My Question is what tags should I create ? And what values need to be send through those tags?
    But I'm aware that the tags will be corresponding to match the address range of the gateway side.


    Please advice,
    Thanks

  • For system signals like CONF_MESS, you don't create tags for them -- the tags already exist internally to the robot. You simply re-assign the mapping (in /R1/STEU/$MADA.DAT) to the $IN and $OUT indices that correspond to those signals on the Gateway.


    For any non-system I/O, you can create a tag similarly to creating a variable, using SIGNAL bMyBooleanInput $IN[1] for a one-bit signal, or (more complex) create an Integer-type variable across multiple bits using SIGNAL bMyIntegerOutput $OUT[1] TO $OUT[8], for example.

  • Hi SkyeFire,
    Thanks for your response.
    Now I am making some progress and going in the right direction.
    So are all these signals BOOLEAN? like 1 bit coil type data?
    Please have a look at the screenshot attached and let me know how do we tell the robot what program to select? We have a welding robot with two programs for two sides. How can this be done?
    And how should this be performed?
    Im looking at making a desired program true for the robot to select and use $AUT $OUT[995] true?? or $MODE_AUTO to TRUE?
    Please advice?
    Thanks
    nar

  • hi if you want yourr robot to perform more than 1 program ,it s better to use ext mode , and the cell.crc , also you have to configure other signals (program type 1 2 or 3),the easiest lne is type 3.
    than in cell.crc , you select the program you want in case structure,

  • In AUT mode, an operator would have to hand-select the program on the teach pendant. The only way around this would be to create a single program that would loop endlessly, waiting for a program-select input, and then wire in inputs to support those signals. Then the top-level program would call your desired production program, once, as a subroutine, based on which input had been received.


    In EXT mode, the CELL.SRC infrastructure is already provided to support this. CELL could probably be modified to work for AUT mode as well.

  • Hi SkyeFire, tayechi_hayet,
    Appreciate your responses.


    I would like to know whether the robot logical signals $OUT[993] to [997] Boolean?
    As they correspond to the T1 T2 AUT and other modes can I trigger a single coil bit to turn them true/false. Is this validated and accepted by the robot?


    Also with $IN[1026] and [1025] can these be used to stop the robot/operation? Is this a safe way to do it or is there something I'm missing?




    I have the above code in my CELL.SRC and I have 3 different programs in my project and I would like to assign each PGNO to a program, how can this be done ? while my programs are named differently?
    Can i be able to do this ?
    Assigning an IO to the switch pgno to a location say $OUT[1200] and triggering that coil bit true/false to tell the robot to pick the one that's true? or is there a way we could set 3 buttons on the generic hmi mapped to three io regions say $OUT[1300]..[1400]..[1500] (so assume its something like CASE $OUT[1300], CASE $OUT[1400] and CASE $OUT[1500] )and trigger the bit true/false? Can this be done?


    Please refer the screenshot that shows our 3 programs we use the robot for...down,Jig1 and Jig2.


    Please advice

    Warm Regards
    nar

  • yes those signals are bolean,
    so in your case you create 3 programs, than you have a signal which called first bit of program ( you can display it on automatic external inputs output),for example in adress 33, so yoj will maps 33 34 and 35 , if you are using type of program 3,=>if 33 =1 you select program 1 , of 34 =1 , => program 2... etc


    cell part:
    in fact case 1 : means case signal 33 :(first bit of progr) =1
    , in place of example 1 you write the name of the program you want to run

  • Hi tayechi_hayet,
    Thanks for your response.
    So please let me know if the below code in CELL.SRC seems valid.




    So i create coils with $OUT[33] to [35] and trigger them after mapping?


    Please advice
    Cheers

  • Close, but CELL requires a degree of configuration. Support variables like PGNO, PGNO_VALID, PGNO_REQ, etc, all need to be assigned to $IN and $OUT indices. You also need to set PGNO size (bits number) and type (one-of-many, binary, negative binary, etc). This is all documented under External Auto in the manuals.

  • Hi SkyeFire,
    Thanks for the guidance.
    I have created an INT for PGNO and mapped to the gateway as it can support up to 1024 bytes.
    And I have grouped two bytes on the gateway to create an INT and made the IO connection.
    So the PGNO_VALID and PGNO_REQD are set to Boolean will my theory work?
    Please advice
    Regards
    Nar

    Edited once, last by n0909 ().

  • sure but ... why bother....? sounds like a potentially colossal waste of time to me...


    just use GW to move block of data from one place to another. don't try to rearrange them or create some intermediate formatting.



    this is not WWII where message had to be translated by Navajo back and forth before it can be used. just send it plain (as is)... nobody cares what it looks like while message is somewhere in-between two end nodes.

    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

  • Perfect panic mode :respect:


    So as a final touch please look at the below code and let me know for any mistakes.



    But i don't see any PGNO_VALID signal?
    I am sorry panic mode maybe it sounds silly but i am putting an effort to gain some experience.


    Regards
    n

  • that's the right attitude. i would recommend Kuka training or - reading manual (check READ FIRST).



    the idea behind the CELL program is that you are NOT supposed to alter the structure...



    just define what program name will be called when PLC requests some program number - that's it.



    you ended corrupting file by inserting robot inputs into P00 parameters. don't do that.
    P00 and cell are already written and work fine. you can create new (clean) CELL.SRC and start over.



    since you call same program in case 2 and 4, they can be combined (or left separate...).



    here are ALL changes one need to do in CELL.SRC.
    rest is done by parametrizing AutoExternal interface...

  • Great!
    I know understood the concept but when you said "just define what program name will be called when PLC requests some program number"?
    So did i get that part right ?


  • yes but you are still screwing around with program structure, like replacing CHECK_HOME with input 2048.
    why don't you just read manual and do it the proper way first time? configuring CELL.SRC is only few pages.

    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 guys,
    So I have tried most of the setup today and the kuka controller cannot connect to the Anybus Gateway.
    We tried ping on all devices and they all seem to respond but when we try right click and connect on the gateway module in workvisual we get an error as,
    Error in DTM Profinet, cannot find device 'abx' on the network.
    But the Kempii welder connected in the same network works okay.
    Please suggest on what could be wrong.
    Thanks


    The connection goes as follows,
    NetSwitch1 - controller, welder, my pc, wire to switch2
    NetSwitch2 - abx,abx mtcp, generic hmi.

Advertising from our partners