
13-25
IM 760401-01E
Communication Commands 1 (System of Commands before the IEEE 488.2-1987 Standard)
13
13.6 Sample Program (Output of Harmonic
Measurement Data)
Sample2(GPIB) Get Harmonics Data
---------------------------------------------------------------------------------------------------
Private Function GpibHarmonics() As Integer
Dim msg As String
Dim qrytemp As String
Dim sts As Integer
Dim cnt As Integer
Dim spr As Integer
term = Chr$(10) 'terminator
msg = Space$(100)
List1.AddItem "Now Initializing. Wait a moment."
Dummy = DoEvents()
sts = InitGpib 'Initialize GPIB
If (sts <> 0) Then
GpibHarmonics = 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
msg = "SI2" + term 'Update rate = 500ms
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
'Setting related to harmonic measurement
'Object element = 1, PLL source = V1, Computation method of THD = IEC
msg = "HE1;PS1;DF0;HA1" + term
sts = ilwrt(Dev, msg, Len(msg)) 'Send Command
If (sts < 0) Then
GoTo GPIBError
End If
'Set the communication output items (A,Element1)
msg = "OH2,1" + term
sts = ilwrt(Dev, msg, Len(msg))
If (sts < 0) Then
GoTo GPIBError
End If
'Clear the RQS of status byte (Read and trash the response)
Sleep 1000
sts = ilrsp(Dev, spr) 'Serial Poll
List1.Clear
'Read and display the harmonics data (It is repeated 10 times in this program)
For cnt = 1 To 10
GoSub Readdata
Next cnt
List1.AddItem " All end"
List1.ListIndex = List1.Lis 1
Call ibonl(Dev, 0)
GpibHarmonics = 0
Exit Function
Содержание 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 ...