6146/6156 DC Voltage/Current Generators Operation Manual
5.9.4 Program Example 3-Sweep Operation and Voltage/Current Measurement
5-64
lngDMMSTB = lngDMMSTB And 16 ' AND operation on the Message Available bit
Loop Until lngDMMSTB = 16 ' Repeats until the measurement is complete.
Call gpibrd(intDMMDes, strMeasVData) ' Receives the DMM measured value.
Call gpibwrt(intDMMDes, "F5") ' DC current measurement function
Call gpibwrt(intDMMDes, "*TRG") ' Sends the trigger and starts measurement.
Do
Call gpibwrt(intDMMDes, "*STB?") ' STB query
Call gpibrd(intDMMDes, strRecvStr) ' Data reception
lngDMMSTB = CLng(strRecvStr) ' STB value storing
lngDMMSTB = lngDMMSTB And 16 ' AND operation on the Message Available bit
Loop Until lngDMMSTB = 16 ' Repeats until the measurement is complete.
Call gpibrd(intDMMDes, strMeasIData) ' Receives the DMM measured value.
Call gpibrd(intVIGDes, strSrcData) ' Receives the current VIG source value.
strSrcData = Replace(strSrcData, "SOV", "") ' Deletes the header character string.
' Stores data on the sheet.
With ActiveSheet
.Cells(lngRowNo, lngMeaNoCol).value = lngMeasCnt
.Cells(lngRowNo, lngSrcLimitCol).value = strSrcLimit
.Cells(lngRowNo, lngSrcDataCol).value = strSrcData
.Cells(lngRowNo, lngVDataCol).value = strMeasVData
.Cells(lngRowNo, lngIDataCol).value = strMeasIData
End With
strSrcLimit = ""
Call gpibwrt(intDMMDes, "F1") ' DC voltage measurement function
lngRowNo = lngRowNo + 1 ' Increments the row number.
End If
DoEvents ' Turns over the control to OS temporarily.
Loop Until blnSWEb = True ' Repeats until the Sweep End bit is set.
Call gpibwrt(intVIGDes, "SBY") ' Sets the VIG output to OFF.
Call ibonl(intVIGDes, 0) ' Sets VIG offline.
Call ibonl(intDMMDes, 0) ' Sets DMM offline.
End Sub