技術文章
TECHNICAL ARTICLES
更新時間:2013-03-04
點擊次數:7869
Option Explicit Dim strss As String Private Sub Form_Load() MSComm1.CommPort = 1 '串口號, MSComm1.Settings = "9600,n,8,1 " '串口的屬性 MSComm1.InputLen = 0 MSComm1.InputMode = comInputModeText MSComm1.RThreshold = 1 MSComm1.PortOpen = True End Sub Private Sub MSComm1_OnComm() Select Case MSComm1.CommEvent Case comEvReceive strss = strss & MSComm1.Input If Right(strss, 2) = vbCrLf Then Label1.Caption = strss Open "D:\DATA.txt" For Append As #1 Print #1, Mid(strss, 1, Len(strss) - 2) '去除回車換行 Close strss = "" End If End Select End Sub
公司郵箱: honeyzeng2006@126.com
服務熱線: 021-57612704
公司地址: 上海市松江區洞涇鎮長浜路501弄6-316
Copyright © 2025 上海佳宜電子科技有限公司 All Rights Reserved
備案號:滬ICP備11001022號-5
技術支持:化工儀器網 管理登錄 sitemap.xml
