Author Topic: Setting up some I/O on a KRC2 ed. 2005  (Read 16479 times)

0 Members and 1 Guest are viewing this topic.

Offline Wall-E

  • Jr. Member
  • **
  • Thank You
  • -Given: 7
  • -Receive: 1
  • Posts: 89
Re: Setting up some I/O on a KRC2 ed. 2005
« Reply #60 on: May 16, 2017, 09:02:08 PM »
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...

« Last Edit: May 16, 2017, 09:23:43 PM by Wall-E »

Offline panic mode

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 59
  • -Receive: 716
  • Posts: 4453
Re: Setting up some I/O on a KRC2 ed. 2005
« Reply #61 on: May 17, 2017, 01:19:55 AM »
be it hardware, or software or wiring or ...?  :-)
1) http://www.robot-forum.com/robotforum/kuka-robot-forum/read-first/
2) if you want reply about robot, post it in forum
3) read 1 and 2

Offline Wall-E

  • Jr. Member
  • **
  • Thank You
  • -Given: 7
  • -Receive: 1
  • Posts: 89
Re: Setting up some I/O on a KRC2 ed. 2005
« Reply #62 on: May 17, 2017, 06:23:27 AM »
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.


Offline Leon

  • Full Member
  • ***
  • Thank You
  • -Given: 3
  • -Receive: 39
  • Posts: 182
Re: Setting up some I/O on a KRC2 ed. 2005
« Reply #63 on: May 17, 2017, 07:09:39 AM »
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.

Offline Wall-E

  • Jr. Member
  • **
  • Thank You
  • -Given: 7
  • -Receive: 1
  • Posts: 89
Re: Setting up some I/O on a KRC2 ed. 2005
« Reply #64 on: May 17, 2017, 07:17:02 AM »
Hi Leon,

do you mean Configure > I/O Driver > Reconfigure I/O Driver ?
Yes, I have tried this, with no effect.


Offline Wall-E

  • Jr. Member
  • **
  • Thank You
  • -Given: 7
  • -Receive: 1
  • Posts: 89
Re: Setting up some I/O on a KRC2 ed. 2005
« Reply #65 on: May 17, 2017, 09:17:01 PM »
OK folks, I found the solution :

Configuration- IO Driver - Reconfiguration- Reset.
I just needed to log into the "Expert" profile to access this.

Cheers

Offline Wall-E

  • Jr. Member
  • **
  • Thank You
  • -Given: 7
  • -Receive: 1
  • Posts: 89
Re: Setting up some I/O on a KRC2 ed. 2005
« Reply #66 on: June 13, 2018, 08:10:01 AM »
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 ?


Offline panic mode

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 59
  • -Receive: 716
  • Posts: 4453
Re: Setting up some I/O on a KRC2 ed. 2005
« Reply #67 on: June 13, 2018, 12:14:06 PM »
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:
Code: [Select]
OUTB0=5,0,x1  ;$OUT[1-8]
INB0=5,0,x1   ;$IN[1-8]


and this:

Code: [Select]
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:


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.


« Last Edit: June 13, 2018, 12:19:52 PM by panic mode »
1) http://www.robot-forum.com/robotforum/kuka-robot-forum/read-first/
2) if you want reply about robot, post it in forum
3) read 1 and 2

Offline Wall-E

  • Jr. Member
  • **
  • Thank You
  • -Given: 7
  • -Receive: 1
  • Posts: 89
Re: Setting up some I/O on a KRC2 ed. 2005
« Reply #68 on: June 13, 2018, 12:35:22 PM »
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

« Last Edit: June 13, 2018, 12:38:19 PM by Wall-E »

Offline panic mode

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 59
  • -Receive: 716
  • Posts: 4453
Re: Setting up some I/O on a KRC2 ed. 2005
« Reply #69 on: June 13, 2018, 01:07:24 PM »
that is NOT the opposite.... sequence of statements in IOSYS.INI does NOT matter. lines CAN be shuffled...

for example:
Code: [Select]
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
Code: [Select]
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
Code: [Select]
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: [Select]
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"

is same as
Code: [Select]
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...).


« Last Edit: June 13, 2018, 01:17:39 PM by panic mode »
1) http://www.robot-forum.com/robotforum/kuka-robot-forum/read-first/
2) if you want reply about robot, post it in forum
3) read 1 and 2

Offline Wall-E

  • Jr. Member
  • **
  • Thank You
  • -Given: 7
  • -Receive: 1
  • Posts: 89
Re: Setting up some I/O on a KRC2 ed. 2005
« Reply #70 on: June 13, 2018, 02:12:18 PM »

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 ?

Offline panic mode

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 59
  • -Receive: 716
  • Posts: 4453
Re: Setting up some I/O on a KRC2 ed. 2005
« Reply #71 on: June 13, 2018, 02:29:40 PM »
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: [Select]
[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:


Code: [Select]
[DEVNET]
 ; map outputs image
ANOUT1 = 5, 0, 16,2, cal32767  ; this will write 16-bit (2 bytes: 0 and 1)
ANOUT2 = 5, 2, 16,2, cal32767  ; this will write 16-bit (2 bytes: 2 and 3)
OUTB0 = 5, 4, x1  ;$OUT[1-8] (Only 1 to 4 will be usable)


  ; map inputs image
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)
« Last Edit: June 13, 2018, 02:44:49 PM by panic mode »
1) http://www.robot-forum.com/robotforum/kuka-robot-forum/read-first/
2) if you want reply about robot, post it in forum
3) read 1 and 2

Offline Wall-E

  • Jr. Member
  • **
  • Thank You
  • -Given: 7
  • -Receive: 1
  • Posts: 89
Re: Setting up some I/O on a KRC2 ed. 2005
« Reply #72 on: June 13, 2018, 05:01:35 PM »
I was so CLOSE !
I just forgot to edit my Copy-Paste for the node number, but I knew it ! Honnest !

Thank you so much, Panic !
I'll try that as soon as possible !

Offline panic mode

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 59
  • -Receive: 716
  • Posts: 4453
Re: Setting up some I/O on a KRC2 ed. 2005
« Reply #73 on: June 13, 2018, 05:16:22 PM »

if you say so. in my book that is being miles off course... :grinning-smiley:
1) http://www.robot-forum.com/robotforum/kuka-robot-forum/read-first/
2) if you want reply about robot, post it in forum
3) read 1 and 2

Offline Wall-E

  • Jr. Member
  • **
  • Thank You
  • -Given: 7
  • -Receive: 1
  • Posts: 89
Re: Setting up some I/O on a KRC2 ed. 2005
« Reply #74 on: June 15, 2018, 08:13:10 AM »
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 ?

« Last Edit: June 15, 2018, 09:15:48 AM by Wall-E »