Serial port communication on KRC2 4.1.5

  • Hello,


    I am trying to communicate with a KR16 / KR C2 controller running the 4.1.5 version using a serial port.


    I tried changing the settings in the hw_inf.ini & serial.ini file so that I can use the COM1 port but without any success (COPEN would always return a 0 handle regardless whether COM1=ENABLE or DISABLE) . Eventually I tried using the COM3 port on the MFC card with copen(:ser_3,handle) and I succeeded in opening the connection.


    On the other end of the cable I have a WIN2K machine running a diagnosis tool which is listening on the serial port, however whenever I try sending any information using cwrite(handle,sw_t,mw_t,"%s","hello") but I always get the same data regardless of what I try sending (be it a string, a %i or %d etc.) :
    7 bytes as follow:
    00000010
    00000010
    00000010
    00000010
    00000010
    00000010
    00001111


    Furthermore, sw_t.RET1 is not equal to #CMD_OK after cwrite executes.


    I thought that since I am getting the same bytes everytime it might be the protocol or something like that (handshake?). But I made sure that in my serial.ini I have PROC = 4 for COM3 and in [XONXOFF] I set both XON_VAL and XOFF_VAL to 0 to use pure communication (and yes, I always restart when I change serial.ini).
    BAUD = 9600 / CHAR_LEN = 8 / STOP_BIT = 1 / PARITY = 0
    and the WIN2K machine has the same settings in the diagnosis tool. (Note that I am able to communicate using COM1 with hyperterminal between the KRC2 and WIN2K without any problems)
    But still nothing, it seems as if the changes I make to the files are pointless. Heck, even if I set COM3 = ENABLE or DISABLE it doesn't make a difference.


    Please if you have any idea on why I am unable to send data through cwrite drop me a few lines (be it in german or english)


    Thanks in advance.

  • Schritt für Schritt zum Roboterprofi!
  • Hi snowbee,
    looks like you haven't made a "cold boot" after changing hw_inf.ini or serial.ini.


    - with KRC2 you can only use COM3
    - the 7 bytes represent the protocol bytes of the 3964R (protocol 1)
    stx, stx, stx, stx, stx, stx, nak. KRC2 is sending each 500msec a send request, then a nak
    in case of no answer


    Make a "cold boot" with the KRC2 and the communication will run.
    Hope so :mrgreen:
    Allways open for further questions
    Paul

    Wer nach allen Seiten offen ist kann nicht ganz dicht sein

  • Hi,
    I did see mention of the cold boot (kaltstart) in both the cwrite/cread documentation and in some topics here, but when I asked the person who's supposed to know about the robot how to do this he said that all I needed to do "turn off the switch" to have windows shut down then turn it back on again. Is there an other way to do a cold boot? could you maybe refer me to a documentation / procedure?


    Thanks :)

  • Hmm... seems like some posts were lost after the server was reset or whatnot.


    Anyway, I fixed my problem by doing a coldstart. Now I can send data to my WIN2K machine without any problem. However I can't receive data. I tried using WAIT FOR $DATA_SER3 > 0 but the condition never becomes true although I am trying to send data from the WIN2K machine. So for now I only have a one way communication :s


    Any ideas :) ?

  • bad news Snowbee :wallbash:
    i've forgotten an existing bug - your last mail reminds me on it


    - the XON/XOFF protocol need the serial hardware signal DSR (data set ready)
    to receive datas
    - on the KRC2, this DSR signal line ist not connected from COM3 to the serial
    chip on the MFC2 (sometimes i love hardware developers :aufsmaul:)
    - a software switch (set in serial.ini) was implemented to eliminate the request
    of DSR line


    this bugfix is implemented only after Version V5.x !!!
    - i'm not sure, could be implemented in V4.1.7 yet
    is a new entry (DSR_LINE .. someting) in section XONXOFF in serial.ini


    sorry about my bad new
    Gruesse Paul :blumen:

    Wer nach allen Seiten offen ist kann nicht ganz dicht sein

  • Hi,


    Well, There is an option actually in the serial.ini on our controller which has a DSR line option under xon/xoff options. I will try to play with that option tomorrow and see if it fixes things.


    We actually called the kuka hotline and they sent us an upgrade to 4.1.7. I did not upgrade yet and would rather not since other people use this robot for their research. If the option does not fix it then I will try calling them again to confirm that the 4.1.7 will fix the bug, if not we will ask if it's possible to get a 5.x version.


    Thanks a lot for your help, so far you've been the bright light in a very dark tunnel :)

Erstelle ein Benutzerkonto oder melde dich an um zu kommentieren

Du musst ein Benutzerkonto haben um einen Kommentar hinterlassen zu können

Benutzerkonto erstellen
Neues Benutzerkonto für unsere Community erstellen. Geht einfach!
Neues Benutzerkonto erstellen
Anmelden
Du hast bereits ein Benutzerkonto? Melde dich hier an.
Jetzt anmelden