YOKOGAWA wt1600 User Manual page 144

Digital power meter
Hide thumbs Also See for wt1600:
Table of Contents

Advertisement

Sample3(GPIB) Get Wave Data (ASCII)
----------------------------------------------------------------------------------------
Private Function GpibWaveAscii() As Integer
Dim msg As String
Dim qry As String
Dim sts As Integer
Dim wait As Integer
Dim pntl As Integer
Dim num As Integer
Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim comma As Integer
term = Chr$(10)
msg = Space$(100)
qry = Space$(200)
sts = InitGpib
If (sts <> 0) Then
End If
'Initialize the settings
msg = "*RST" + term
sts = ilwrt(Dev, msg, Len(msg))
If (sts < 0) Then
End If
'Set the measurment condition
msg = "VOLTAGE:RANGE:ELEMENT1 100V" + term
sts = ilwrt(Dev, msg, Len(msg))
If (sts < 0) Then
End If
msg = "WSETUP:TDIV 10MS" + term
sts = ilwrt(Dev, msg, Len(msg))
If (sts < 0) Then
End If
msg = "WSETUP:SAMPLING ON" + term
sts = ilwrt(Dev, msg, Len(msg))
If (sts < 0) Then
End If
'Set the transition filter used to detect the completion of the data updating
msg = "STATUS:FILTER1 FALL" + term
sts = ilwrt(Dev, msg, Len(msg))
If (sts < 0) Then
End If
'Wait until waveform measure is stable (2 samples in this program)
For wait = 1 To 2
Next wait
IM 760101-11E
GpibWaveAscii = 1
Exit Function
Call DisplayGPIBError(sts, msg)
GpibWaveAscii = 1
Exit Function
Call DisplayGPIBError(sts, msg)
GpibWaveAscii = 1
Exit Function
Call DisplayGPIBError(sts, msg)
GpibWaveAscii = 1
Exit Function
Call DisplayGPIBError(sts, msg)
GpibWaveAscii = 1
Exit Function
Call DisplayGPIBError(sts, msg)
GpibWaveAscii = 1
Exit Function
'Clear the extended event register (Read and trash the response)
msg = "STATUS:EESR?" + term
sts = ilwrt(Dev, msg, Len(msg))
If (sts < 0) Then
Call DisplayGPIBError(sts, msg)
GpibWaveAscii = 1
Exit Function
End If
sts = ilrd(Dev, qry, Len(qry))
If (sts < 0) Then
Call DisplayGPIBError(sts, msg)
GpibWaveAscii = 1
Exit Function
End If
'Wait for the completion of the data updating
msg = "COMMUNICATE:WAIT 1" + term
sts = ilwrt(Dev, msg, Len(msg))
If (sts < 0) Then
Call DisplayGPIBError(sts, msg)
GpibWaveAscii = 1
Exit Function
End If
7.6 Output of Waveform Data (ASCII Format)
'Command buffer
'Query buffer
'terminator
'Initialize GPIB
'Initialize the settings
'Send Command
'Voltage range = 100V
'Send Command
'Time/div = 10ms
'Send Command
'Wave sampling start
'Send Command
'Falling edge of bit0(UPD)
'Send Command
'Send Command
'Receive Query
'Send Command
7
7-15

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents