# 请问rs232

Posted by lucky on November 04, 1998 at 12:50:47:

请问一下vb可以作rs232的通讯阜传输吗??...

以下是我用qbasic写的成功的传输程式(用在两台电脑或一台电脑一台8751适用)

-------------------------------------------------
OUT &H3FB, &H80
OUT &H3F8, &H30
OUT &H3F9, &H0
OUT &H3FB, &H3
10 CLS : CLEAR
PRINT "1.forward"
PRINT "2.back"
PRINT "3.left"
PRINT "4.right"
70 b$ = INKEY$
IF b$ <> "" THEN 150
b = INP(&H3FD)
b = b AND 1
IF b = 0 THEN 70
a = INP(&H3F8)
PRINT HEX$(a)
GOTO 70
150 b = INP(&H3FD)
b = b AND &H20
IF b = 0 THEN 150
IF b$ = "1" THEN b = 1
IF b$ = "2" THEN b = 2
IF b$ = "3" THEN b = 3
IF b$ = "4" THEN b = 4
IF b$ = "5" THEN b = 0
IF b$ = "0" THEN END
PRINT b
OUT &H3F8, b
GOTO 70
END
-----------------------------------------------------------
在vb中他说OUT没定义.....如果要把这程式改成vb中的程式要如何改呢??.....
也就是说从另一台电脑同时执行这程式的话,它键盘按一个数字我这台营幕也显示同数字
而且把这个数字值都到一个定义参数中...
OUT在qbasic中开启port1的东西.....谢谢...

Follow Ups:

- Re: 请问rs232 callback 16:21:14 11/04/98 (0)