Setting up some I/O on a KRC2 ed. 2005

  • UGH...


    I hadn't been using the I/Os for some time, and I just ran into a "error on writing driver dn2drv" error message.
    The coupler has got all it's LEDs green, but the digital Inputs and Outputs don't work when they are supposed to while running my program (they remain OFF).


    I haven't changed anything, be it hardware or software.
    The iosys.ini file is the same that got everything working last time.


    I just have no idea why I get this error message...

    Edited once, last by Wall-E ().

  • Hi Panic,


    On the hardware side :
    -The devicenet cable looks just fine, I checked that it had it's 24V.
    -The Beckhoff coupler has green lights all over.


    On the software side :
    - I opened the Telnet console and typed "dnwho" to get some sort of diagnostic, as you suggested in an earlier post but I got an error message ; something like "syntax error".
    I searched for some reference on that Telnet thing, but in vain.
    -When I display the list of loaded drivers, I can see that the Devicenet driver is loaded
    -The first time I run the program , it stops when I get the error message about the "dn2drv", but if I acknowledge, then close and re-open the program, I can run it from start to end, but IOs are ignored.
    -If I display the I/O status panel, I can see that they are all off during execution of the program.


    Where should I look from here ?
    Thanks for your help.

  • have you tried resetting the driver? i have had same sort of problems once which where a result op power loss on the I/O side and it did not reconnect on its own as it normally does

    Every problem has a solution, that isn't the problem. The problem is the solution.

  • Hi, it's me again.


    For now, I've got a very simple setup working fine : a Digital Input with 4 channels and a Digital Output, also with 4 channels.
    The I/O mapping is described in IOSYS.INI as follows :
    OUTB0=5,0,x1 ;$OUT[1-8]
    INB0=5,0,x1 ;$IN[1-8]


    In fact, contrary to the example given by Panic Mode, it seems my Beckhoff coupler reads the outputs first, and then the inputs, but that's no big deal, and he mentionned that this could be the case : "you should read manual for your buscoupler!".

    Now, I want to add analog inputs, and this forces me to actually understand the whole enchilada to type in the proper mapping description.
    This is where I get lost : Panic mentions that, in the Input image and Output image, the bytes from the Analog signals always come first, before the Digital signals, but he proceeds to give the opposite as an example.
    Am I missing something, or is this a mistake ?

  • i assure you, i made no mistake...



    you seem to be confusing order of mapping statements in IOSYS.INI with order of data in the telegram ("image").



    This:

    OUTB0=5,0,x1 ;$OUT[1-8] INB0=5,0,x1 ;$IN[1-8]

    [size=1em]

    and this:

    INB0=5,0,x1 ;$IN[1-8] OUTB0=5,0,x1 ;$OUT[1-8]




    are EXACTLY the same. order of lines does NOT matter. in fact those two lines are not even related. one is mapping INPUTs and other is mapping OUTPUTS. inputs and outputs are in two completely separate images (blocks of data).





    What DOES matter is the order of DATA in the image/telegram. So when mapping something to robot I/O, you need to specify:[/size]


    a) on one side (left of equal sign) what robot I/O you are mapping to


    b) on the other side (right of equal sign) three things:
    1. What node we are mapping
    2. how many bytes are to be skipped to get to data we want
    3. how many bytes are in the data we want to use



    try focusing on item b-2 ("how many bytes are to be skipped to get to data we want").


    if you are mapping to inputs (left side is some sort of input), then right side is reading from INPUT image


    if you are mapping to outputs (left side is some sort of output), then right side is writing to OUTPUT image


    both input and output image are data blocks composed by bus coupler.

    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

    Edited once, last by panic mode ().

  • Panic,


    The issue is not in the order in which are given the Input image and Output image, but the fact that you mention that the ANALOG bytes are generally read before the DIGITAL bytes, and then in the example, you do the opposite :


    INB0 = 11, 4, x4 ; $in[1-32]
    ANIN1 = 11, 0, 16,2, cal32767
    ANIN2 = 11, 2, 16,2, cal32767

    Edited once, last by Wall-E ().

  • that is NOT the opposite.... sequence of statements in IOSYS.INI does NOT matter. lines CAN be shuffled...


    for example:
    INB0 = 11, 4, x4 ; $in[1-32] ; line "1" ANIN1 = 11, 0, 16,2, cal32767 ; line "2" ANIN2 = 11, 2, 16,2, cal32767 ;line "3"


    is same as
    ANIN2 = 11, 2, 16,2, cal32767 ;line "3" INB0 = 11, 4, x4 ; $in[1-32] ; line "1" ANIN1 = 11, 0, 16,2, cal32767 ; line "2"


    is same as

    ANIN2 = 11, 2, 16,2, cal32767 ;line "3" ANIN1 = 11, 0, 16,2, cal32767 ; line "2" INB0 = 11, 4, x4 ; $in[1-32] ; line "1"


    is same as

    Code
    INB0 = 11, 4, x4  ; $in[1-32] ; line "1" 
    ANIN2 = 11, 2, 16,2, cal32767  ;line "3"
    ANIN1 = 11, 0, 16,2, cal32767 ; line "2"


    [size=1em]is same as[/size]

    Code
    ANIN1 = 11, 0, 16,2, cal32767 ; line "2" 
    ANIN2 = 11, 2, 16,2, cal32767  ;line "3"
    INB0 = 11, 4, x4  ; $in[1-32] ; line "1"

    etc.


    note that CONTENT of the lines is always the same, only order is changed. order does not matter but content does.




    Back to the basics:
    bus coupler checks attached IO cards, SOMEHOW determines order how the data is to be composed into an image (usually but not always, analogs are placed at the begin of image), then it transmits that image in a telegram when master/scanner tells it to do so.


    once the telegram is received by the robot, you need to create assignments that are going to extract data from that image.
    image is just an ARRAY of bytes.


    i guess YOU would expect to see them like this (analogs first):




    ANIN1 = 11, 0, 16,2, cal32767 ; line "2"
    ANIN2 = 11, 2, 16,2, cal32767 ;line "3"
    INB0 = 11, 4, x4 ; $in[1-32] ; line "1"



    now focus on SECOND parameter in each line (value after "11"), it has values 0, 2 and 4 in this case. that tells how many image bytes to skip (from begin of image/array) to get to data we need.




    so called line "2", reads FIRST analog input, which is at the begin of image so it skips ZERO bytes because it needs access to bytes 0,1 from array (first analog input is at the begin of image/array)



    so called line "3", reads second analog input so it must skip TWO bytes (bytes 0, 1) because they are data representing first analog input



    so called line "1" is reading digital inputs. they come AFTER analog inputs. so skip FOUR bytes from begin of array (those would be the two analog inputs we need to skip in order to get to digital inputs...).

    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

    Edited once, last by panic mode ().

  • Quote

    i guess YOU would expect to see them like this (analogs first):
    ANIN1 = 11, 0, 16,2, cal32767 ; line "2"
    ANIN2 = 11, 2, 16,2, cal32767 ;line "3"
    INB0 = 11, 4, x4 ; $in[1-32] ; line "1"


    Yes, because as I'm trying to wrap my head around this mapping horror, I tend to get confused with the slightest thing !
    Thanks for your patience ; things are sinking in... slowly.


    So first, just to ease my headache, I'm going to re-position my blocks to match the order stated in the documentation (attached) : Coupler->AO->DO->AI->DI->Terminator
    (Since I don't have any AO, this is going to be : Coupler->DO->AI->DI->Terminator).


    My DO has 4 outputs, so that's 4 bits = 1/2 byte
    My AI has 2 inputs, so that's 2*16 bits = 4 bytes
    My DI has 4 inputs, so that's 4 bits = 1/2 byte


    Soooo, here's a first attempt at translating this into a proper mapping :


    [DEVNET]
    OUTB0=5,0,x1 ;$OUT[1-8] (Only 1 to 4 will be usable)
    ANIN1 = 11, 0, 16,2, cal32767 ; this will read 16-bit (2 bytes: 0 and 1)
    ANIN2 = 11, 2, 16,2, cal32767 ; this will read 16-bit (2 bytes: 2 and 3)
    INB3=5,4,x1 ;$IN[1-8] (Only 1 to 4 will be usable)


    Am I close ?

  • your map shows that you have two bus couplers:
    One is node 5 and it connects to digital IO. other is node 11 and connects to analog IO.
    digital inputs mapping is ok but comment stating range is wrong (INB3 is inputs 25-32)
    And your analog outputs are not mapped at all...



    does that sound like you are close? :icon_mrgreen:



    if there are no analog outputs and node is 5, i would expect this:

    Code
    [DEVNET]
    OUTB0 = 5, 0, x1  ;$OUT[1-8] (Only 1 to 4 will be usable)
    ANIN1 = 5, 0, 16,2, cal32767  ; this will read 16-bit (2 bytes: 0 and 1)
    ANIN2 = 5, 2, 16,2, cal32767  ; this will read 16-bit (2 bytes: 2 and 3)
    INB0   = 5, 4, x1   ;$IN[1-8] (Only 1 to 4 will be usable)




    and if there are two analog outputs, i would expect this:



    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

    Edited once, last by panic mode ().

  • No bananas...


    I ran a plasma cutting program and monitored my analog I/Os, and at the same time measured the Analog input with a Voltmeter :
    Voltmeter gives changing values around 2~3 volts, but the monitor on the pendant stays at zero...


    https://photos.app.goo.gl/x852AjS5vUbCq96M6


    EDIT :


    I checked the Digital input just for the heck of it and I realized that it recieving data during the plasma cutting !!! :


    https://photos.app.goo.gl/TWybPgLRzxN776po7


    Analog input signal received as Digital input signal ?
    Why so much cruelty ?

    Edited once, last by Wall-E ().

  • Hey folks, don't let me down so close to the goal ! :smiling_face:
    How can I get the input voltage as a decimal, and not a byte ?
    Or is there an operator in the Kuka programming language to convert a byte to a decimal ?

  • Those photos bare no resemblance to your previously posted DEVNET.INI data.


    For one thing, why are you looking at a single byte when your analog inputs are (according to your previous posts) 16bit? Do you even have your INB0 mapped to the same DeviceNet location as the ANIN? Wading back through the earlier parts of this thread, I no longer have any clue what your current configuration is.


    If your analog input has 16 bits of resolution, map an actual 16bits of $INs to it. Get your "decimal" value by using a SIGNAL declaration to map the $IN group to an (unsigned) integer variable like so: SIGNAL AnalogIn $IN[1] TO $IN[16].


    Disconnect the analog input from your plasma cutter, wire a potentiometer into the analog input https://www.allaboutcircuits.c…tiometer-voltage-divider/, dial the pot to various fixed voltage with a meter, and for each voltage, log the value of AnalogIn. Make sure to cover the entire input scale.


    Plot in Excel. You should see the linear relationship between your "raw" digilog value and the input voltages.

  • Hi Abdoul-Aziz,


    We discussed this earlier in the thread, https://www.robot-forum.com/ro…d-2005/msg85779/#msg85779
    The devicenet cable is plugged on the "X801" terminal of the MFC board.


    This cable can be ordered from Beckhoff with the proper terminals and resistors : "some assembly required".
    Note that these guys will make you pay a flat fee around 50€ on top of the price of the parts, just because they don't like little guys like us.


  • Hi Skyefire,


    You are right. I'm a moron. It's written right on the module, and in the online documentation : https://www.beckhoff.com/english.asp?bus_terminal/kl3102.htm
    My current configuration is shown in the attached image.
    I'm back to pulling my hair out with
    Hopefully I can manage to wrap my head around all this.
    I wish there was a little program where you would just decribe you input and output blocks (with the fabricator reference perhaps), and it would spit out the proper description for the iosys.ini file...
    This is just tedious as hell, and I suspect it is a huge waste of time for many.

Advertising from our partners