qy4a的片子
如果我想读某个flash地址里的数据,是不是可以这样写:
Private Sub Receive_Click()
Dim i As Integer
Dim d1 As Long
Dim ten As Long
Dim shiliu As String
'发送读指令
Dim readCommand(1) As Byte
readCommand(0) = &H4A
MSComm1.Output = readCommand
'txtReceive.Text = readCommand(0)
'延时等待
d1 = Timer()
Do
DoEvents
Loop Until Timer() - d1 > 1.15
'发送高位地址
ReDim SendData(1)
ten = CLng("&H" & txtReceiveHigh.Text)
shiliu = Hex$(ten)
SendData() = shiliu
MSComm1.Output = SendData
'txtReceive.Text = SendData
'延时等待
d1 = Timer()
Do
DoEvents
Loop Until Timer() - d1 > 1.15
'发送低位地址
ten = CLng("&H" & txtReceiveLow.Text)
shiliu = Hex$(ten)
SendData() = shiliu
MSComm1.Output = SendData
'txtReceive.Text = SendData
'延时等待
d1 = Timer()
Do
DoEvents
Loop Until Timer() - d1 > 1.15
'接收读取数据
ReDim ReceiveData(1)
ReceiveData = MSComm1.Input
txtReceive.Text = ReceiveData
'If txtReceive = "" Then MsgBox "没有收到有效数据"
这样行嘛??
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |