
10-44
IM 704610-01E
10.4 Sample Program
10.4.4
Setting Measurement Parameters and Querying the Current Setting
Private Function SetParameter() As Integer
Dim msg As String 'Command buffer
Dim qry As String 'Query buffer
Dim sts As Integer
Dim length As Long 'Receive query length
msg = Space$(100)
qry = Space$(100)
msg = "*RST" + term 'Initialize Setting Parameter
sts = TmSend(Dev, msg) 'Send Command
If (sts <> 0) Then
Call DisplayError(sts, msg)
SetParameter = 1
Exit Function
End If
msg = ":COMMUNICATE:HEADER ON" + term 'Header = ON
sts = TmSend(Dev, msg) 'Send Command
If (sts <> 0) Then
Call DisplayError(sts, msg)
SetParameter = 1
Exit Function
End If
msg = ":COMMUNICATE:VERBOSE ON" + term 'Verbose = ON
sts = TmSend(Dev, msg) 'Send Command
If (sts <> 0) Then
Call DisplayError(sts, msg)
SetParameter = 1
Exit Function
End If
msg = ":MEASURE:FUNCTION DTOC" + term 'Mode = DTOC
sts = TmSend(Dev, msg) 'Send Command
If (sts <> 0) Then
Call DisplayError(sts, msg)
SetParameter = 1
Exit Function
End If
msg = ":MEASURE:FUNCTION?" + term 'Get Function
sts = TmSend(Dev, msg) 'Send Command
If (sts <> 0) Then
Call DisplayError(sts, msg)
SetParameter = 1
Exit Function
End If
sts = TmReceive(Dev, qry, 100, length) 'Receive Query
If (sts <> 0) Then
Call DisplayError(sts, msg)
SetParameter = 1
Exit Function
End If
Query(0) = Left$(qry, length - 1)
Query(1) = ""
Call TmFinish(Dev)
Dev = -1
SetParameter = 0
End Function
'---------------------------------------------------------------------