ruspi
Mechanical
- Dec 14, 2015
- 2
Hi All,
I'm having problems with sending data to Fanuc M-10iA robot with R-30iA controller. I'm trying to use RS232 interface. I don't have COM port in my notebook and I'm trying to use USB RS232 adapter (cheap one, Prolific chipset).
I made a following cable:
ROBOT
2 >--------------------------------------------------------------------------------------------------------------< 2
3 >--------------------------------------------------------------------------------------------------------------< 3
7 >--------------------------------------------------------------------------------------------------------------< 5
6 >--
|
8 >--
|
20 >--
4 >--
|
5 >--
I wrote following program in Karel, compiled using Roboguide and put it through FTP on Robot:
PROGRAM read_rs
VAR
RS232 :FILE
file_status :INTEGER
xs :STRING[1]
x :INTEGER
stat :INTEGER
BEGIN
--set transmission parameters
stat = SET_PORT_ATR(PORT_2, ATR_BAUD, BAUD_4800)
stat = SET_PORT_ATR(PORT_2, ATR_PARITY, PARITY_NONE)
stat = SET_PORT_ATR(PORT_2, ATR_SBITS, SBITS_1)
stat = SET_PORT_ATR(PORT_2, ATR_DBITS, DBITS_8)
-- set transmission without handshaking
stat = SET_PORT_ATR(PORT_2, ATR_MODEM, MD_NOUSE_DSR) --turn off DSR
stat = SET_PORT_ATR(PORT_2, ATR_MODEM, MD_NOUSE_DTR) --turn off DTR
stat = SET_PORT_ATR(PORT_2, ATR_MODEM, MD_NOUSE_RTS) --turn off RTS
CLOSE FILE RS232
OPEN FILE RS232 ('RW', 'P2:')
file_status = IO_STATUS(RS232)
IF (file_status<>0) THEN
WRITE TPDISPLAY('Failed to open the file = ',file_status, CR)
ENDIF
READ RS232(xs)
CNV_STR_INT(xs, x)
WRITE TPDISPLAY('x=',x,CR)
CLOSE FILE RS232
END read_rs
Finally I am using HyperTerminal for sending data from notebook. When I run my read_rs program from teach pendant it stops executing on line with command READ RS232(xs). I mean it not stops it is still runing but I can wait for ages and no data is coming onto TPDISPLAY. Occasionally I am getting error "DSR off when transmission..."
I can't figure out what can be wrong. Any help appreciated. Thanks in advance!
I'm having problems with sending data to Fanuc M-10iA robot with R-30iA controller. I'm trying to use RS232 interface. I don't have COM port in my notebook and I'm trying to use USB RS232 adapter (cheap one, Prolific chipset).
I made a following cable:
ROBOT
PC
25 pin male connector 9 pin female connector
2 >--------------------------------------------------------------------------------------------------------------< 2
3 >--------------------------------------------------------------------------------------------------------------< 3
7 >--------------------------------------------------------------------------------------------------------------< 5
6 >--
|
8 >--
|
20 >--
4 >--
|
5 >--
I wrote following program in Karel, compiled using Roboguide and put it through FTP on Robot:
PROGRAM read_rs
VAR
RS232 :FILE
file_status :INTEGER
xs :STRING[1]
x :INTEGER
stat :INTEGER
BEGIN
--set transmission parameters
stat = SET_PORT_ATR(PORT_2, ATR_BAUD, BAUD_4800)
stat = SET_PORT_ATR(PORT_2, ATR_PARITY, PARITY_NONE)
stat = SET_PORT_ATR(PORT_2, ATR_SBITS, SBITS_1)
stat = SET_PORT_ATR(PORT_2, ATR_DBITS, DBITS_8)
-- set transmission without handshaking
stat = SET_PORT_ATR(PORT_2, ATR_MODEM, MD_NOUSE_DSR) --turn off DSR
stat = SET_PORT_ATR(PORT_2, ATR_MODEM, MD_NOUSE_DTR) --turn off DTR
stat = SET_PORT_ATR(PORT_2, ATR_MODEM, MD_NOUSE_RTS) --turn off RTS
CLOSE FILE RS232
OPEN FILE RS232 ('RW', 'P2:')
file_status = IO_STATUS(RS232)
IF (file_status<>0) THEN
WRITE TPDISPLAY('Failed to open the file = ',file_status, CR)
ENDIF
READ RS232(xs)
CNV_STR_INT(xs, x)
WRITE TPDISPLAY('x=',x,CR)
CLOSE FILE RS232
END read_rs
Finally I am using HyperTerminal for sending data from notebook. When I run my read_rs program from teach pendant it stops executing on line with command READ RS232(xs). I mean it not stops it is still runing but I can wait for ages and no data is coming onto TPDISPLAY. Occasionally I am getting error "DSR off when transmission..."
I can't figure out what can be wrong. Any help appreciated. Thanks in advance!