您好, 歡迎來到化工儀器網(wǎng),! 登錄| 免費注冊| 產(chǎn)品展廳| 收藏商鋪|
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
請輸入賬號
請輸入密碼
請輸驗證碼
以上信息由企業(yè)自行提供,信息內(nèi)容的真實性,、準確性和合法性由相關(guān)企業(yè)負責,,化工儀器網(wǎng)對此不承擔任何保證責任。
溫馨提示:為規(guī)避購買風險,,建議您在購買產(chǎn)品前務必確認供應商資質(zhì)及產(chǎn)品質(zhì)量,。