6146/6156 DC Voltage/Current Generators Operation Manual
5.9.4 Program Example 3-Sweep Operation and Voltage/Current Measurement
5-66
Call aUSBWrt(lngVIGHdl, "*CLS") ' Status clear
' DMM setting
Call aUSBWrt(lngDMMHdl, "F1") ' DC voltage measurement function
Call aUSBWrt(lngDMMHdl, "PR2") ' Sets the sampling rate to Middle.
Call aUSBWrt(lngDMMHdl, "TRS3") ' Sets the trigger to BUS.
Call aUSBWrt(lngDMMHdl, "H0") ' Header OFF
Call aUSBWrt(lngDMMHdl, "*CLS") ' Status clear
' Waits until the VIG setting operation is complete.
Do
Call aUSBWrt(lngVIGHdl, "*OPC?") ' All the operation is complete?
Call aUSBRd(lngVIGHdl, strRecvStr) ' Data reception
' Checks for errors in USB transmission and reception.
If blnUSBComErr = True Then
GoTo ErrExit
End If
Loop Until strRecvStr = "1"
' Waits until the DMM setting operation is complete.
Do
Call aUSBWrt(lngDMMHdl, "*OPC?") ' All the operation is complete?
Call aUSBRd(lngDMMHdl, strRecvStr) ' Data reception
' Checks for errors in USB transmission and reception.
If blnUSBComErr = True Then
GoTo ErrExit
End If
Loop Until strRecvStr = "1"
Call aUSBWrt(lngVIGHdl, "OPR") ' Sets the VIG output to ON.
' Waits until the VIG operation is complete.
Do
Call aUSBWrt(lngVIGHdl, "DSR?") ' DSR query
Call aUSBRd(lngVIGHdl, strRecvStr) ' Data reception
lngVIGDSR = CLng(strRecvStr) ' DSR value storing
blnRDYb = lngVIGDSR And 1024 ' AND operation on the READY OUT bit
' Checks for errors in USB transmission and reception.
If blnUSBComErr = True Then
GoTo ErrExit
End If
Loop Until blnRDYb = True ' Waits until the READY OUT bit is set.
Call aUSBWrt(lngVIGHdl, "*TRG") ' Sweep start
Do
Call aUSBWrt(lngVIGHdl, "DSR?") ' DSR query
Call aUSBRd(lngVIGHdl, strRecvStr) ' Data reception
If blnUSBComErr = True Then ' Checks for errors in USB transmission and reception.
GoTo ErrExit
End If
lngVIGDSR = CLng(strRecvStr) ' DSR value storing
'AND operation on each function bit of DSR
blnRDYb = lngVIGDSR And 1024 ' READY Out bit
blnSWEb = lngVIGDSR And 8192 ' Sweep End bit
blnLMHb = lngVIGDSR And 128 ' Limiter High bit
blnLMLb = lngVIGDSR And 64 ' Limiter Low bit