6146/6156 DC Voltage/Current Generators Operation Manual
5.9.2 Program Example 1-DC Voltage Source and Voltage/Current Measurement
5-48
' USB driver data reception sub procedure
Sub aUSBRd(lngHdl As Long, strData As String)
Dim lngRet As Long
Dim lngSize As Long ' Receivable number of characters
Dim strRawStr As String
lngRet = ausb_read(lngHdl, strRawStr, 50, lngSize)
' Receives data.
If lngRet = OK Then ' If OK
strData = Left$(strRawStr, lngSize - 1) ' Extracts receivable number of characters.
strData = Replace(strData, vbCr, "") ' Deletes the CR character.
strData = Replace(strData, vbLf, "") ' Deletes the LF character.
blnUSBComErr = False
Else ' If not OK
lngRet = ausb_clear(lngHdl) ' Device clear
blnUSBComErr = True
MsgBox "receiving error", vbCritical
End If
End Sub
5.9.2 Program Example 1-DC Voltage Source and Voltage/Current Measurement
Generate DC voltage by the 6146/6156 and measure voltage on or current through the load resistance of
1 kΩ by DMM.
The measured value is stored on the Excel sheet.
Connection diagram
Function: DC voltage source
Source voltage: +5 V
Sensing status: Internal (2W)
DMM: 7351A/E
Measurement function: DC voltage, DC current
Measurement range: Auto
Sampling rate: SLOW1 (integration time: 100 ms)
Header: ON