1268
Agilent InfiniiVision 4000 X-Series Oscilloscopes Programmer's Guide
41
Programming Examples
If (err <> VI_SUCCESS) Then HandleVISAError vi
err = viVScanf(vi, "%lf" + vbLf, VarPtr(dblResult))
If (err <> VI_SUCCESS) Then HandleVISAError vi
DoQueryNumber = dblResult
CheckInstrumentErrors
End Function
Private Function DoQueryNumbers(query As String) As Long
Dim dblResult As Double
' Send query.
err = viVPrintf(vi, query + vbLf, 0)
If (err <> VI_SUCCESS) Then HandleVISAError vi
' Set up paramsArray for multiple parameter query returning array.
paramsArray(0) = VarPtr(retCount)
paramsArray(1) = VarPtr(dblArray(0))
' Set retCount to max number of elements array can hold.
retCount = DblArraySize
' Read numbers.
err = viVScanf(vi, "%,#lf" + vbLf, paramsArray(0))
If (err <> VI_SUCCESS) Then HandleVISAError vi
' retCount is now actual number of values returned by query.
DoQueryNumbers = retCount
CheckInstrumentErrors
End Function
Private Function DoQueryIEEEBlock_Bytes(query As String) As Long
' Send query.
err = viVPrintf(vi, query + vbLf, 0)
If (err <> VI_SUCCESS) Then HandleVISAError vi
' Set up paramsArray for multiple parameter query returning array.
paramsArray(0) = VarPtr(retCount)
paramsArray(1) = VarPtr(byteArray(0))
' Set retCount to max number of elements array can hold.
retCount = ByteArraySize
' Get unsigned integer bytes.
err = viVScanf(vi, "%#b" + vbLf, paramsArray(0))
If (err <> VI_SUCCESS) Then HandleVISAError vi
err = viFlush(vi, VI_READ_BUF)
If (err <> VI_SUCCESS) Then HandleVISAError vi
Summary of Contents for InfiniiVision 4000 X-Series
Page 1: ...s1 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide ...
Page 32: ...32 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide ...
Page 52: ...52 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 2 Setting Up ...
Page 66: ...66 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 3 Getting Started ...
Page 242: ...242 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 7 ACQuire Commands ...
Page 252: ...252 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 8 BUS n Commands ...
Page 300: ...300 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 12 DEMO Commands ...
Page 330: ...330 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 15 DVM Commands ...
Page 386: ...386 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 18 HARDcopy Commands ...
Page 484: ...484 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 21 MEASure Commands ...
Page 1098: ...1098 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 34 WGEN w Commands ...
Page 1174: ...1174 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 37 Error Messages ...
Page 1352: ...1352 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide Index ...