hello dears,
i'm new in krl.
please help me to start with serial comunication on krc2.
how to open COM2 and send and receive data to another pc.
may you send simple example program.
thanks alot
hello dears,
i'm new in krl.
please help me to start with serial comunication on krc2.
how to open COM2 and send and receive data to another pc.
may you send simple example program.
thanks alot
Depends on what generation KRC2, and what KSS version it's running.
I have an old example program for KSS 5 (KRC2 ed2005) at http://kuka.skyefire.org/
But you would also have to configure the serial port in... HW.INF, if I recall correctly.
ed2005 KRC2s used COM3. I think the pre-2005 models used COM2.
it also depends on the protocol you want to use
- for sensor communication you want to use the 3964r protocol (it is like tcp)
- for other communication you want to use XON/XOFF (it is like udp)
Question: what is your goal?
thanks for your response.
i want to use this protocol for sensor communication (gripper and conveyor sensors )
You still didn't mention what generation KRC2 you're using.
Dug out some old backup files. These are from ed2005s, running KSS 5.4:
HW_INF.INI:
[SERIAL]
;ENABLE: COM is accessible by robot (vxWorks)
;DISABLE: COM is accessible by Win95
;CONSOLE: for developer only
COM3=ENABLE ;[ENABLE, DISABLE, CONSOLE]
SERIAL.INI contains the settings for the serial port: baud rate, protocol, parity, etc.
; SERIAL.INI
; Configuration of the serial ports and their protocols
;
; Lindemann 27.02.2002 KUKA Controls:
; update comments and COM4 removed
; Lindemann/Scheffold 25.10.2002 KUKA Controls:
; XONXOFF: DSR signal now setable
;
; Protocol description:
; 3964R Standard software protocol (Siemens)
; SRVT Servo Robot Vision Telegram (use only with Servo Robot)
; WTC Spot Weld Controller (use only with Weltronic Controler)
; XONXOFF Xon/Xoff software protocol (use also as pure serial communication)
;
[COM1]
BAUD=9600
CHAR_LEN=8 ; 7,8
STOP_BIT=1 ; 1,2 at time not changeable
PARITY=2 ; EVEN=2, ODD=1, NONE=0
PROC=1 ; 3964R=1, SRVT=2, WTC=3, XONXOFF=4
[COM2]
BAUD=9600
CHAR_LEN=8 ; 7,8
STOP_BIT=1 ; 1,2 at time not changeable
PARITY=2 ; EVEN=2, ODD=1, NONE=0
PROC=1 ; 3964R=1, SRVT=2, WTC=3, XONXOFF=4
[COM3]
BAUD=9600
CHAR_LEN=8 ; 7,8
STOP_BIT=1 ; 1,2 at time not changeable
PARITY=2 ; EVEN=2, ODD=1, NONE=0
PROC=1 ; 3964R=1, SRVT=2, WTC=3, XONXOFF=4
[3964R]
CHAR_TIMEOUT=500 ; msec
QUITT_TIMEOUT=500 ; msec
TRANS_TIMEOUT=2000 ; msec
MAX_TX_BUFFER=2 ; 1..5 number of send buffers
MAX_RX_BUFFER=10 ; 1..20 number of receive buffers
SIZE_RX_BUFFER=100 ; 1..2048 size of receive buffers
PROTOCOL_PRIOR=1 ; HIGH=1, LOW=0
[SRVT]
CHAR_TIMEOUT=200 ; msec
MAX_TX_BUFFER=2 ; 1..5
MAX_RX_BUFFER=2 ; 1..20
SIZE_RX_BUFFER=100 ; 1..2048
[WTC]
CHAR_TIMEOUT=200 ; msec
MAX_TX_BUFFER=2 ; 1..5
MAX_RX_BUFFER=2 ; 1..20
SIZE_RX_BUFFER=50 ; 1..2048
[XONXOFF]
CHAR_TIMEOUT=50 ; msec Timeout after last received character
; to recognize the end of telegram
MAX_TX_BUFFER=2 ; 1..5
MAX_RX_BUFFER=2 ; 1..20
SIZE_RX_BUFFER=100 ; 1..2048 longest expected telegram length + 15 characters
XON_VAL=17 ; 0..255 XON character (decimal)
XOFF_VAL=19 ; 0..255 XOFF character (decimal)
; if XON_VAL=0 and XOFF_VAL=0 then XON/XOFF protocol
; is disabled (pure serial communication)
DSR_LINE=0 ; 0 = DSR line not connected, 1 = DSR line must be high
[TEST]
;testprint (Rx/Tx-telegrams) on telnet if value > 0
TESTPRINT=0
[END SECTION]
Display More
The CWRITE manual contains some information on serial port config.
I configured serial.ini with xonxoff proc and comminucation is good .
But when i change proc to 3649R and send data to laptop i receive 02 02 02 02 15 assci .
Search web for 3964r (not 3649 !) protocol, and you will see why. The protocol needs specific answers for every sent data.
There are plenty of informations in the web.
But when i change proc to 3649R and send data to laptop i receive 02 02 02 02 15 assci .
This is actually STX STX STX STX NAK
The KRC is sending STX in order to start the communication.
Your other PC is not responding in the specified time and the KRC repeats STX.
After 3 retrys the KRC stops to send the request and sends NAK