# 请问如何利用RS-232控制仪器

Posted by 郑秋男 on January 21, 1998 at 23:10:57:

请问我有一台检测仪器，想利用RS-232控制，不知如何利用vb6撰写程式。
可否教一下小弟，感激不尽。

下列为通信设定片段。

STX:start of text(02h)
cr :carriage return (0dh)
ch1,ch2:not used and urex side to be ignored
sp :space code (20h)
etx:end of text(03h)
, :character between two [,] to be ascii code
* :asterisk * show ank code and negative sign'-'code
nak:negative acknowledge

baud rate 9600bps
data length 8bit
parity non
stop bit 1
flow control used

requesting measuring gas concentration
requesst (cpu)
stx,ch1,ch2'RG',cr,etx
stx,sp,sp'AGC**.**h*****d***.*o***.*',cr,etx
nak
setting "meas" mode
request (cpu)
stx,ch1,ch2,'CMM',cr,etx
answer (urex)
stx,sp,sp,'AMM',cr,etx
nak

Follow Ups:

- 使用 Comm 控制项 (Binary Mode) 小吴 16:49:59 1/22/98 (0)