YOKOGAWA WT1600FC User Manual page 137

Impedance meter communication interface
Table of Contents

Advertisement

Sample1(GPIB) Get Power Data
————————————————————————————————————————————
Private Function GpibPower() As Integer
Dim msg As String
Dim qry As String
Dim sts As Integer
Dim item As Integer
Dim comma As Integer
Dim length As Integer
Dim cnt As Integer
term = Chr$(10)
msg = Space$(100)
qry = Space$(900)
List1.AddItem "Now Initializing. Wait a moment."
Dummy = DoEvents()
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 measurement condition
msg = "VOLTAGE:RANGE 100V" + term
sts = ilwrt(Dev, msg, Len(msg))
If (sts < 0) Then
End If
msg = "CURRENT:RANGE 1A" + term
sts = ilwrt(Dev, msg, Len(msg))
If (sts < 0) Then
End If
msg = "RATE 500MS" + term
sts = ilwrt(Dev, msg, Len(msg))
If (sts < 0) Then
End If
'Set the numeric data output items
'ASCII format, Preset pattern1, Number of data = 60
msg = "NUMERIC:FORMAT ASCII;NORMAL:PRESET 1;NUMBER 60" + 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
'Clear the extended event register (Read and trash the response)
msg = "STATUS:EESR?" + term
sts = ilwrt(Dev, msg, Len(msg))
If (sts < 0) Then
End If
sts = ilrd(Dev, qry, Len(qry))
If (sts < 0) Then
IM 760151-17E
GpibPower = 1
Exit Function
Call DisplayGPIBError(sts, msg)
GpibPower = 1
Exit Function
Call DisplayGPIBError(sts, msg)
GpibPower = 1
Exit Function
Call DisplayGPIBError(sts, msg)
GpibPower = 1
Exit Function
Call DisplayGPIBError(sts, msg)
GpibPower = 1
Exit Function
Call DisplayGPIBError(sts, msg)
GpibPower = 1
Exit Function
Call DisplayGPIBError(sts, msg)
GpibPower = 1
Exit Function
Call DisplayGPIBError(sts, msg)
GpibPower = 1
Exit Function
7.4 Output of Power Measurement Data
'Command buffer
'Query buffer
'terminator
'Initialize GPIB
'Initialize the settings
'Send Command
'Voltage range = 100V
'Send Command
'Current range = 1A
'Send Command
'Update Rate = 500ms
'Send Command
'Send Command
'Falling edge of bit0(UPD)
'Send Command
'Send Command
'Receive Query
7
7-7

Advertisement

Table of Contents
loading

Table of Contents