
13-22
IM 760401-01E
13.5 Sample Program (Output of Normal
Measurement Data)
Sample1(GPIB) Get Normal Data
---------------------------------------------------------------------------------------------------
Private Function GpibNormal() As Integer
Dim msg As String
Dim qry As String
Dim qrytemp As String
Dim sts As Integer
Dim item As Integer
Dim comma As Integer
Dim cnt As Integer
Dim spr As Integer
term = Chr$(10) 'terminator
msg = Space$(100)
qry = Space$(500)
qrytemp = 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 = "RC" + term 'Initialize the settings
sts = ilwrt(Dev, msg, Len(msg)) 'Send Command
If (sts < 0) Then
GoTo GPIBError
End If
'Set the measurement condition
'Hold off, Frequency Filter off, Line Filter off,
'Scaling off, Averaging off
msg = "HD0;FL0;LF0;SC0;AG0" + term
sts = ilwrt(Dev, msg, Len(msg)) 'Send Command
If (sts < 0) Then
GoTo GPIBError
End If
'Set function and element of display
'DisplayA : V,Element1, DisplayB : A,Element1, DisplayC : W,Element1
msg = "DA1;EA1;DB2;EB1;DC3;EC1" + term
sts = ilwrt(Dev, msg, Len(msg))
If (sts < 0) Then
GoTo GPIBError
End If
'Set the measurement range
msg = "RV7" + term 'Voltage range = 150V
sts = ilwrt(Dev, msg, Len(msg))
If (sts < 0) Then
GoTo GPIBError
End If
msg = "RA7" + term 'Current range = 5A
sts = ilwrt(Dev, msg, Len(msg))
If (sts < 0) Then
GoTo GPIBError
End If
'Set the measurement mode
msg = "MN0" + term 'Measurement mode = RMS
sts = ilwrt(Dev, msg, Len(msg))
If (sts < 0) Then
GoTo GPIBError
End If
'Set the communication output items (Default for normal measurement)
'Set the communication output delimiter (CR+LF+EOI)
msg = "OFD0;DL0" + term
sts = ilwrt(Dev, msg, Len(msg))
If (sts < 0) Then
GoTo GPIBError
End If
Summary of Contents for WT210
Page 1: ...Digital Power Meter IM 760401 01E 3rd Edition ...
Page 208: ...13 18 IM 760401 01E 13 3 Sample Program Image ...
Page 214: ...13 24 IM 760401 01E 13 5 Sample Program Output of Normal Measurement Data ...
Page 266: ...14 50 IM 760401 01E 14 6 Sample Program Image ...
Page 272: ...14 56 IM 760401 01E 14 8 Sample Program Output of Normal Measurement Data ...