CH372中斷問(wèn)題

上電直接后進(jìn)行CH375GetConfigDescr和CH375GetDeviceDescr操作,提示TRUE,但顯示緩沖區(qū)讀出的數(shù)據(jù)都是0,是真確的嗎?


這兩個(gè)函數(shù)是要在打開(kāi)設(shè)備之后才能調(diào)用的,第三個(gè)參數(shù)要初始化為想要讀取的數(shù)據(jù)長(zhǎng)度


zyw,你好!我的QQ976611533,能否加一下請(qǐng)教您!謝謝


不好意思,由于公司的規(guī)定,我們不太好用qq或msn,有什么技術(shù)問(wèn)題您可以撥打技術(shù)支持電話(huà):025-52638376


上電進(jìn)行了設(shè)備開(kāi)啟并正常,后進(jìn)行CH375GetConfigDescr和CH375GetDeviceDescr操作,也提示TRUE,但顯示緩沖區(qū)讀出的數(shù)據(jù)都是0,是真確的嗎?我想知道正確的設(shè)備描述符和配置描述符的內(nèi)容。


在調(diào)用CH375GetConfigDescr之前要調(diào)用CH375OpenDevice函數(shù)


zyw,您好! 這一段程序如下,麻煩幫我看一下,就是運(yùn)行后顯示全0? Dim mBuffer As mBuf If (Not IsOpen) Then IsOpen = mOpenDevice() If (Not IsOpen) Then Text1.Text = Text1.Text & "設(shè)備打開(kāi)失敗,請(qǐng)檢查設(shè)備和鏈接庫(kù)。" & Chr(13) & Chr(10) Exit Sub End If Else Text1.Text = Text1.Text & "CH375OpenDevice:硬件開(kāi)啟成功……" & Chr(13) & Chr(10) End If Dim mReadBuf As mBuf If (CH375GetDeviceDescr(0, mReadBuf, mLength)) Then 'If (CH375GetConfigDescr(0, mReadBuf, mLength)) Then 'MsgBox "ok" Else Exit Sub 'MsgBox "error" End If

Dim i As Integer For i = 0 To 63 Step 1 Text1.Text = Text1.Text & mReadBuf.mBuff(i) Next i

…………………………

Private Function mOpenDevice() As Boolean

On Error Resume Next If (CH375OpenDevice(0) = -1) Then '打開(kāi)設(shè)備 LED1.Status = False LED1.Caption = "未連接" 'Command2.Enabled = False Connect_Ok = False 'Text1.Text = Text1.Text & "設(shè)備打開(kāi)失敗,請(qǐng)檢查設(shè)備和鏈接庫(kù)。" & Chr(13) & Chr(10) IsOpen = False mOpenDevice = False Else IsOpen = True LED1.Status = True LED1.Caption = "已連接" Command2.Enabled = True Command5.Enabled = True 'Text1.Text = Text1.Text & "CH375OpenDevice:硬件開(kāi)啟成功……" & Chr(13) & Chr(10) mOpenDevice = True End If End Function


"If (CH375GetDeviceDescr(0, mReadBuf, mLength)) Then"==>mLength有沒(méi)有初始化,不能初始化為零.


沒(méi)明白,mlength需要怎么初始化?


CH375GetDeviceDescr的第三個(gè)參數(shù)要設(shè)置為想要讀取的數(shù)據(jù)長(zhǎng)度 mLength要設(shè)置成你想要得到數(shù)據(jù)的長(zhǎng)度,如果不設(shè)置的話(huà),系統(tǒng)可能初始化為零,這樣你想要獲取的數(shù)據(jù)長(zhǎng)度就為零,返回的數(shù)據(jù)長(zhǎng)度也就是零了.


試了下,有數(shù)據(jù),謝了!


只有登錄才能回復(fù),可以選擇微信賬號(hào)登錄

国产91精品新入口,国产成人综合网在线播放,九热这里只有精品,本道在线观看,美女视频a美女视频,韩国美女激情视频,日本美女pvp视频