YOKOGAWA WT1600FC User Manual page 150

Impedance meter communication interface
Table of Contents

Advertisement

7.7 Output of Waveform Data (FLOAT Format)
7-20
GpibWaveFloat = 1
Exit Function
End If
sts = ilrd(Dev, qry, Len(qry))
If (sts < 0) Then
Call DisplayGPIBError(sts, msg)
GpibWaveFloat = 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)
GpibWaveFloat = 1
Exit Function
End If
Next wait
'Set conditions for reading the waveform
'FLOAT(MSB first) format, Trace = U1
msg = "WAVEFORM:TRACE U1;FORMAT FLOAT;BYTEORDER MSBFIRST" + term
sts = ilwrt(Dev, msg, Len(msg))
If (sts < 0) Then
Call DisplayGPIBError(sts, msg)
GpibWaveFloat = 1
Exit Function
End If
'Read and display the waveform data
eos = 0
sts = ileos(Dev, eos)
If (sts < 0) Then
Call DisplayGPIBError(sts, "ileos")
GpibWaveFloat = 1
Exit Function
End If
'Read in the waveform data
pntl = 1002
msg = "WAVEFORM:START 0;END 1001;SEND?" + term
sts = ilwrt(Dev, msg, Len(msg))
If (sts < 0) Then
Call DisplayGPIBError(sts, msg)
GpibWaveFloat = 1
Exit Function
End If
sts = ilrdi(Dev, bufv(), 6 + 1002 * 4 + 1)
If (sts < 0) Then
Call DisplayGPIBError(sts, msg)
GpibWaveFloat = 1
Exit Function
End If
eos = &HC0A
sts = ileos(Dev, eos)
If (sts < 0) Then
Call DisplayGPIBError(sts, "ileos")
GpibWaveFloat = 1
Exit Function
End If
For i = 1 To pntl
buf = ""
For j = 1 To 2
If Left(Right("00" + Hex$(bufv((i * 2) + j)), 4), 2) = "00" Then
buf = buf + Right("00" + Hex$(bufv((i * 2) + j)), 4)
ElseIf Left(Right("0" + Hex$(bufv((i * 2) + j)), 4), 1) = "0" Then
buf = buf + Right("0" + Hex$(bufv((i * 2) + j)), 4)
Else
buf = buf + Hex$(bufv(2 + ((i - 1) * 2) + j))
End If
Next j
all = Mid(buf, 3, 2) + Mid(buf, 1, 2) + Mid(buf, 7, 2) + Mid(buf, 5, 2)
For k = 1 To 8
a(k) = Mid$(all, k, 1)
If a(k) = "0" Then b(k) = "0000"
If a(k) = "1" Then b(k) = "0001"
If a(k) = "2" Then b(k) = "0010"
If a(k) = "3" Then b(k) = "0011"
If a(k) = "4" Then b(k) = "0100"
If a(k) = "5" Then b(k) = "0101"
If a(k) = "6" Then b(k) = "0110"
If a(k) = "7" Then b(k) = "0111"
If a(k) = "8" Then b(k) = "1000"
If a(k) = "9" Then b(k) = "1001"
If a(k) = "A" Then b(k) = "1010"
If a(k) = "B" Then b(k) = "1011"
If a(k) = "C" Then b(k) = "1100"
If a(k) = "D" Then b(k) = "1101"
'Receive Query
'Send Command
'Send Command
'Terminator = None(for Binary Data)
'Send Command
'Receive Query(Integer data)
'Terminator = LF
IM 760151-17E

Advertisement

Table of Contents
loading

Table of Contents