技術(shù)文章
TECHNICAL ARTICLES
更新時(shí)間:2013-03-04
點(diǎn)擊次數(shù):7953
Option Explicit Dim strss As String Private Sub Form_Load() MSComm1.CommPort = 1 '串口號(hào), 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) '去除回車(chē)換行 Close strss = "" End If End Select End Sub
公司郵箱: honeyzeng2006@126.com
服務(wù)熱線(xiàn): 021-57612704
公司地址: 上海市松江區(qū)洞涇鎮(zhèn)長(zhǎng)浜路501弄6-316
Copyright © 2025 上海佳宜電子科技有限公司 All Rights Reserved
備案號(hào):滬ICP備11001022號(hào)-5
技術(shù)支持:化工儀器網(wǎng) 管理登錄 sitemap.xml
