VB6.0封装MSComm控件以采集Alicat流量计数据( 三 )


Private Sub Command1_Click() '打开设备'MSCommV21.initDevID ("A") '默认为A,其他需要初始化,用于打开设备前'MSCommV21.initDevice 3, 200, "N", 8, 1 '除端口号外,其他都为默认值,alicat不用设置, 用于打开设备前MSCommV21.openDevice (3)'MSCommV21.changeDevID "C", "A" '用于打开设备后,更改设备号,以方便多个ALICAT流量计使用End SubPrivate Sub Command2_Click()Dim s As String'MSCommV21.revMassFlowData '质量流量MSCommV21.revVolFlowDataDoDoEventsLoop While MSCommV21.readyRead = FalseText1.Text = MSCommV21.dataStrEnd SubPrivate Sub Command3_Click()MSCommV21.closeDeviceEnd Sub
3.源代码访问
源码及控件:
链接:
【VB6.0封装MSComm控件以采集Alicat流量计数据】提取码:e9yn