
13-23
IM 760401-01E
Communication Commands 1 (System of Commands before the IEEE 488.2-1987 Standard)
13
'Clear the RQS of status byte (Read and trash the response)
Sleep 1000
sts = ilrsp(Dev, spr) 'Serial Poll
List1.Clear
'Read and display the numerical data (It is repeated 10 times in this program)
For cnt = 1 To 10
GoSub Readdata
Next cnt
List1.AddItem " All end"
List1.ListIndex = List1.Lis 1
Call ibonl(Dev, 0)
GpibNormal = 0
Exit Function
GPIBError:
Call DisplayGPIBError(sts, msg)
GpibNormal = 1
Exit Function
Readdata:
sts = ilrsp(Dev, spr) 'Serial Poll
If (sts < 0) Then
GoTo GPIBError
End If
If ((spr And &H41) <> &H41) Then
cnt = cnt - 1
Return
End If
'Read out the measurement data till END
qry = ""
msg = "OD" + term
sts = ilwrt(Dev, msg, Len(msg))
If (sts < 0) Then
GoTo GPIBError
End If
Do While qrytemp <> "END"
qrytemp = Space$(200)
sts = ilrd(Dev, qrytemp, Len(qrytemp))
If (sts < 0) Then
GoTo GPIBError
End If
qrytemp = Left(qrytemp, InStr(qrytemp, term) - 2)
qry = qry + qrytemp
If (qrytemp <> "END") Then
qry = qry + ","
End If
Loop
'Extract items that are separated by commas(,) from the received data
List1.AddItem "Measurement - " + CStr(cnt)
List1.ListIndex = List1.Lis 1
item = 1
Do While qry <> "END"
comma = InStr(qry, ",")
If (comma = 0) Then Exit Do
Query(item) = Left(qry, comma - 1)
If item < 10 Then
List1.AddItem " " + CStr(item) + " " + Query(item)
Else
List1.AddItem CStr(item) + " " + Query(item)
End If
qry = Mid(qry, comma + 1)
List1.ListIndex = List1.Lis 1
item = item + 1
Loop
List1.AddItem ""
List1.ListIndex = List1.Lis 1
qrytemp = Space$(200)
qry = Space$(500)
Dummy = DoEvents()
Return
End Function
---------------------------------------------------------------------------------------------------
13.5 Sample Program (Output of Normal Measurement Data)
Содержание WT210
Страница 1: ...Digital Power Meter IM 760401 01E 3rd Edition ...
Страница 208: ...13 18 IM 760401 01E 13 3 Sample Program Image ...
Страница 214: ...13 24 IM 760401 01E 13 5 Sample Program Output of Normal Measurement Data ...
Страница 266: ...14 50 IM 760401 01E 14 6 Sample Program Image ...
Страница 272: ...14 56 IM 760401 01E 14 8 Sample Program Output of Normal Measurement Data ...