
7-12
IM 760151-17E
‘Preset pattern1, Number of data = 3, Number of data of array function = 1
msg = “NUMERIC:IMPEDANCE:PRESET 1;NUMBER 3;ARRAY 1” + term
sts = ilwrt(Dev, msg, Len(msg)) ‘Send Command
If (sts < 0) Then
Call DisplayGPIBError(sts, msg)
GpibImpedance = 1
Exit Function
End If
‘Set the transition filter used to detect the completion of the data updating
msg = “STATUS:FILTER1 FALL” + term ‘Falling edge of bit0(UPD)
sts = ilwrt(Dev, msg, Len(msg)) ‘Send Command
If (sts < 0) Then
Call DisplayGPIBError(sts, msg)
GpibImpedance = 1
Exit Function
End If
‘Clear the extended event register (Read and trash the response)
msg = “STATUS:EESR?” + term
sts = ilwrt(Dev, msg, Len(msg)) ‘Send Command
If (sts < 0) Then
Call DisplayGPIBError(sts, msg)
GpibImpedance = 1
Exit Function
End If
sts = ilrd(Dev, qry, Len(qry)) ‘Receive Query
If (sts < 0) Then
Call DisplayGPIBError(sts, msg)
GpibImpedance = 1
Exit Function
End If
List1.Clear
‘Read and display the numeric data (It is repeated 5 times in this program)
For cnt = 1 To 5
msg = “*TRG” + term ‘Single trigger
sts = ilwrt(Dev, msg, Len(msg)) ‘Send Command
If (sts < 0) Then
Call DisplayGPIBError(sts, msg)
GpibImpedance = 1
Exit Function
End If
‘Wait for the completion of the data updating
msg = “COMMUNICATE:WAIT 1” + term
sts = ilwrt(Dev, msg, Len(msg)) ‘Send Command
If (sts < 0) Then
Call DisplayGPIBError(sts, msg)
GpibImpedance = 1
Exit Function
End If
‘Clear the extended event register (Read and trash the response)
msg = “STATUS:EESR?” + term
sts = ilwrt(Dev, msg, Len(msg)) ‘Send Command
If (sts < 0) Then
Call DisplayGPIBError(sts, msg)
GpibImpedance = 1
Exit Function
End If
sts = ilrd(Dev, qry, Len(qry)) ‘Receive Query
If (sts < 0) Then
Call DisplayGPIBError(sts, msg)
GpibImpedance = 1
Exit Function
End If
‘Read out numeric data
msg = “NUMERIC:IMPEDANCE:VALUE?” + term
sts = ilwrt(Dev, msg, Len(msg)) ‘Send Command
If (sts < 0) Then
Call DisplayGPIBError(sts, msg)
GpibImpedance = 1
Exit Function
End If
sts = ilrd(Dev, qry, Len(qry)) ‘Receive Query
If (sts < 0) Then
Call DisplayGPIBError(sts, msg)
GpibImpedance = 1
Exit Function
End If
‘Extract items that are separated by commas(,) from the received data
List1.AddItem “Measurement - “ + CStr(cnt)
List1.ListIndex = List1.Lis 1
For item = 1 To 3
length = Len(qry)
comma = InStr(qry, “,”)
If (comma = 0) Then comma = InStr(qry, term)
Query(item) = Left(qry, comma - 1)
If (item = 1) Then
List1.AddItem “Freq : “ + Query(item)
7.5 Output of Impedance Measurement Data