VB编程 关于调用仪器测量数据,求大神帮忙啊。

我现在在毕业设计,我们这个实验室是做OLED的 ,我做的是OLED测试平台的设计。现在这有一台PR-650的光谱测试仪,老师想让我先用VB编程把仪器测试出来的数据调用出来。没学过VB完全不会啊!!
那个PR-650说明书上有一段关于数据调用的,但是不会用啊。PR-650 Operating Manual上是这样写的:
D Command- Output Data to the Host
Use this command to retrieve data from the PR-650.This enables the programmer to see several data reports from a single measurement. If the response code specifies measurement data,that datda is taken from the last measurement performed by the PR-650.
NOTE: The "D" command does not initiate measurements.
Format-D<Response Code><CR>
Allowable Response Code-All
See the Response Codes section of this Appendix for full details of formatted output of the PR-650 following the "D"command and optional Responds Code parameter.
就这些了 ,那位大神帮帮忙啊。 对了追加悬赏。
我邮箱tamzer@163.com

光谱的数据是用串口发送出来的吧追问

那我现在用VB怎么编啊?

追答

放个mscomm控件
Private Sub MSComm1_OnComm(Index As Integer)
Dim Str As String
Select Case MSComm1(Index).CommEvent
' 错误
Case comEventBreak ' 收到 Break。
Case comEventCDTO ' CD (RLSD) 超时。
Case comEventCTSTO ' CTS Timeout。
Case comEventDSRTO ' DSR Timeout。
Case comEventFrame ' Framing Error
Case comEventOverrun '数据丢失。
Case comEventRxOver '接收缓冲区溢出。
Case comEventRxParity ' Parity 错误。
Case comEventTxFull '传输缓冲区已满。
Case comEventDCB '获取 DCB] 时意外错误

' 事件
Case comEvCD ' CD 线状态变化。
Case comEvCTS ' CTS 线状态变化。
Case comEvDSR ' DSR 线状态变化。
Case comEvRing ' Ring Indicator 变化。
Case comEvReceive ' 收到 RThreshold # of
Str = MSComm1(Index).Input
Str = Replace(Str, Chr(32), "")
Do While (Len(Str) Mod 2) 0
Str = Str & MSComm1(Index).Input
Str = Replace(Str, Chr(32), "")
Loop
'For i = 0 To UBound(By)
'txt_indata(Index).Text = txt_indata(Index).Text & str
'str = Replace(str, Chr(32), vbNullString)
Str = Replace(Str, Chr(13) + Chr(10), "")
Str = Replace(Str, Chr(9), "")
Str = Replace(Str, Chr(10), "")
Str = Replace(Str, Chr(13), "")
'txt_indata(Index).Text = i & " " & j & vbCrLf
For i = 1 To Len(Str) Step 2
txt_indata(Index).Text = txt_indata(Index).Text & Chr(Val("&H" & Mid(Str, i, 2))) '& Mid(str, i, 2) & " " & HexToDec(Mid(str, i, 2)) & " " & Chr(Val("&H" & Mid(str, i, 2))) & vbCrLf
Next
Case comEvSend ' 传输缓冲区有 Sthreshold 个字符 '
'
Case comEvEOF ' 输入数据流中发现 EOF 字符
'
End Select

End Sub

追问

兄弟 加个qq吧 我QQ 568523185

追答

83408531

温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答