
7-16
IM 760151-17E
Call DisplayGPIBError(sts, msg)
GpibWaveAscii = 1
Exit Function
End If
Next wait
‘Set conditions for reading the waveform
‘ASCII format, Trace = U1
msg = “WAVEFORM:TRACE U1;FORMAT ASCII” + term
sts = ilwrt(Dev, msg, Len(msg)) ‘Send Command
If (sts < 0) Then
Call DisplayGPIBError(sts, msg)
GpibWaveAscii = 1
Exit Function
End If
‘Read and display the waveform data
pntl = 1002
num = 0
For i = 0 To pntl Step 10
‘Read in the waveform data 10 data points at a time
msg = “WAVEFORM:START” + Str(i) + “;END” + Str(i + 9) + “;SEND?” + term
sts = ilwrt(Dev, msg, Len(msg)) ‘Send Command
If (sts < 0) Then
Call DisplayGPIBError(sts, msg)
GpibWaveAscii = 1
Exit Function
End If
sts = ilrd(Dev, qry, Len(qry)) ‘Receive Query
If (sts < 0) Then
Call DisplayGPIBError(sts, msg)
GpibWaveAscii = 1
Exit Function
End If
k = 1
‘Extract items that are separated by commas(,) from the received data
For j = 0 To 9
comma = InStr(k, qry, “,”)
If (comma = 0) Then comma = InStr(k, qry, term)
num = num + 1
Query(num) = Mid(qry, k, (comma - k))
If (num < 10) Then
List1.AddItem “ “ + CStr(num) + “ “ + Query(num)
ElseIf (num < 100) Then
List1.AddItem “ “ + CStr(num) + “ “ + Query(num)
ElseIf (num < 1000) Then
List1.AddItem “ “ + CStr(num) + “ “ + Query(num)
Else
List1.AddItem CStr(num) + “ “ + Query(num)
End If
k = comma + 1
List1.ListIndex = List1.Lis 1
If (num >= pntl) Then Exit For
Next j
qry = Space$(200)
Dummy = DoEvents()
Next i
Call ibonl(Dev, 0)
GpibWaveAscii = 0
End Function
————————————————————————————————————————————
7.6 Output of Waveform Data (ASCII Format)