8-49
IM 704420-01E
Communication Function
8
8.9.5 Executing Single Measurement
Sample2 Single Measure
—————————————————————————————————————————————————————— Private Function SingleMeasure() As Integer
Dim msg As String 'Command buffer
Dim qry As String 'Query buffer
Dim sts As Integer
msg = Space$(100)
qry = Space$(100)
sts = InitGpib 'Initialize GPIB
If (sts <> 0) Then
SingleMeasure = 1
Exit Function
End If
msg =
"
STATUS:FILTER1 RISE
"
+ term 'Filter1 Rise(Data Available)
sts = ilwrt(Dev, msg, Len(msg)) 'Send Command
If (sts < 0) Then
Call DisplayGPIBError(sts, msg)
SingleMeasure = 1
Exit Function
End If
msg =
"
STATUS:EESR?
"
+ term 'Clear Extended Event Register
sts = ilwrt(Dev, msg, Len(msg)) 'Send Command
If (sts < 0) Then
Call DisplayGPIBError(sts, msg)
SingleMeasure = 1
Exit Function
End If
sts = ilrd(Dev, qry, Len(qry)) 'Read EESR
If (sts < 0) Then
Call DisplayGPIBError(sts, msg)
SingleMeasure = 1
Exit Function
End If
msg =
"
SSTART
"
+ term 'Single Measure Start
sts = ilwrt(Dev, msg, Len(msg)) 'Send Command
If (sts < 0) Then
Call DisplayGPIBError(sts, msg)
SingleMeasure = 1
Exit Function
End If
Call ibonl(Dev, 0)
SingleMeasure = 0
End Function
——————————————————————————————————————————————————————————————————————————————————————————————————
8.9 Sample Program