幫忙看看為什么單片機(jī)接不到VB的數(shù)據(jù)

我在VB 6.0上模仿CH372DBG\DOWNFILE\WINDOWS下的Transfile函數(shù),一直都接不到數(shù)據(jù),頭痛??! 請(qǐng)指點(diǎn)一二?。? Private Function TransFile(ByVal hWnd As Long) As Boolean

Dim ReadLen As Long Dim mLen As Long mLen = 0 Dim by As Byte Dim bylen As Long by = 0 bylen = 0 Trb = 0 Dim Writebuff As mBuff mTotal = 1 Writebuff.mBuff(0) = 0

Dim sb As OVERLAPPED With sb .Internal = 0 .InternalHigh = 0 .offset = 0 .OffsetHigh = 0 .hEvent = 0 End With 'Dim addr As Long Call CH375Writedata(0, mBuffer, mTotal) Do While (1) ReadLen = 1024 Call ReadFile(hWnd, mBuffer, 1024, ReadLen, sb)

If (ReadLen < 1024) Then mLen = ReadLen On Error Resume Next If (CH375Writedata(0, mBuffer, mLen)) Then If (mLen <> 0) Then Trb = Trb + 1 End If MsgBox "寫結(jié)束 " & Trb & "K" Exit Do Else MsgBox "寫數(shù)據(jù)失敗" Exit Do End If Else mLen = ReadLen On Error Resume Next If (CH375Writedata(0, mBuffer, mLen)) Then If (mLen <> 0) Then Trb = Trb + 1 End If MsgBox "寫結(jié)束 " & Trb & "K" Else MsgBox "寫數(shù)據(jù)失敗" ' Exit Do End If End If TransFile = False

'Else Loop 'Loop

End Function

用CH372DBG\DOWNFILE\WINDOWS程序是可以成功接收到文件的


你的基本數(shù)據(jù)通訊測(cè)試成功嘛?先要能做基本的傳輸數(shù)據(jù),然后再去傳輸文件數(shù)據(jù)!還有你的文件讀取正確嘛?一點(diǎn)一點(diǎn)的排除,肯定能找到原因!


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

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