8-45
IM 704420-01E
Communication Function
8
8.9.4 Setting Measurement Parameters or Querying the Setting
Sample1 Set/Get Parameter
——————————————————————————————————————————————————————— Private Function SetParameter() 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
SetParameter = 1
Exit Function
End If
msg =
"
:COMM:HEADER ON
"
+ term 'Header = ON
sts = ilwrt(Dev, msg, Len(msg)) 'Send Command
If (sts < 0) Then
Call DisplayGPIBError(sts, msg)
SetParameter = 1
Exit Function
End If
msg =
"
:COMM:VERBOSE ON
"
+ term 'Verbose = ON
sts = ilwrt(Dev, msg, Len(msg)) 'Send Command
If (sts < 0) Then
Call DisplayGPIBError(sts, msg)
SetParameter = 1
Exit Function
End If
msg =
"
STOP
"
+ term 'Measure Stop
sts = ilwrt(Dev, msg, Len(msg)) 'Send Command
If (sts < 0) Then
Call DisplayGPIBError(sts, msg)
SetParameter = 1
Exit Function
End If
msg =
"
:MEASURE:FUNCTION DTOC
"
+ term 'Function = Data to Clock
sts = ilwrt(Dev, msg, Len(msg)) 'Send Command
If (sts < 0) Then
Call DisplayGPIBError(sts, msg)
SetParameter = 1
Exit Function
End If
msg =
"
:MEASURE:FUNCTION?
"
+ term 'Get Function
sts = ilwrt(Dev, msg, Len(msg)) 'Send Command
If (sts < 0) Then
Call DisplayGPIBError(sts, msg)
SetParameter = 1
Exit Function
End If
sts = ilrd(Dev, qry, Len(qry))
If (sts < 0) Then
Call DisplayGPIBError(sts, msg)
SetParameter = 1
Exit Function
End If
Query(0) = Left$(qry, ibcntl - 1)
8.9 Sample Program