
14-54
IM 760401-01E
14.8 Sample Program (Output of Normal
Measurement Data)
Sample1(GPIB) Get Normal Data
---------------------------------------------------------------------------------------------------
Private Function GpibNormal() As Integer
Dim msg As String 'Command buffer
Dim qry As String 'Query buffer
Dim sts As Integer
Dim item As Integer
Dim comma As Integer
Dim length As Integer
Dim cnt As Integer
term = Chr$(10) 'terminator
msg = Space$(100)
qry = Space$(200)
List1.AddItem "Now Initializing. Wait a moment."
Dummy = DoEvents()
sts = InitGpib 'Initialize GPIB
If (sts <> 0) Then
GpibNormal = 1
Exit Function
End If
'Initialize the settings
msg = "*RST" + term 'Initialize the settings
sts = ilwrt(Dev, msg, Len(msg)) 'Send Command
If (sts < 0) Then
GoTo GPIBError
End If
'Set the measurement condition
msg = "SAMPLE:HOLD OFF" + term 'Hold off
sts = ilwrt(Dev, msg, Len(msg))
If (sts < 0) Then
GoTo GPIBError
End If
msg = "MODE RMS" + term 'Measurment Mode = RMS
sts = ilwrt(Dev, msg, Len(msg))
If (sts < 0) Then
GoTo GPIBError
End If
msg = "FILTER OFF" + term 'Frequency Filter off
sts = ilwrt(Dev, msg, Len(msg))
If (sts < 0) Then
GoTo GPIBError
End If
msg = "LFILTER OFF" + term 'Line Filter off
sts = ilwrt(Dev, msg, Len(msg))
If (sts < 0) Then
GoTo GPIBError
End If
msg = "SCALING OFF;AVERAGING OFF" + term 'Scaling & Averaging off
sts = ilwrt(Dev, msg, Len(msg))
If (sts < 0) Then
GoTo GPIBError
End If
'Set the measurement range
msg = "VOLTAGE:RANGE 150V" + term 'Voltage range = 150V
sts = ilwrt(Dev, msg, Len(msg))
If (sts < 0) Then
GoTo GPIBError
End If
msg = "CURRENT:RANGE 5A" + term 'Current range = 5A
sts = ilwrt(Dev, msg, Len(msg))
If (sts < 0) Then
GoTo GPIBError
End If
'For measure the voltage frequency of element1, set function and element of displayC.
msg = "DISPLAY3:FUNCTION VHZ;ELEMENT 1" + term
sts = ilwrt(Dev, msg, Len(msg))
If (sts < 0) Then
GoTo GPIBError
End If
Содержание 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 ...