Programming Examples

9

'GET_PREAMBLE - The preamble block contains all of the current

'WAVEFORM settings. It is returned in the form <preamble_block><NL>

'where <preamble_block> is:

'

FORMAT

:

int16 - 0 = BYTE, 1 = WORD, 2 = ASCII.

'

TYPE

:

int16 - 0 = NORMAL, 1 = PEAK DETECT, 2 = AVERAGE.

'

POINTS

:

int32 - number of data points transferred.

'

COUNT

:

int32 - 1 and is always 1.

'

XINCREMENT

:

float64 - time difference between data points.

'

XORIGIN

:

float64 - always the first data point in memory.

'

XREFERENCE

:

int32 - specifies the data point associated with

'

 

 

x-origin.

'

YINCREMENT

:

float32 - voltage difference between data points.

'

YORIGIN

:

float32 - value is the voltage at center screen.

'

YREFERENCE

:

int32 - specifies the data point where y-origin

'

 

 

occurs.

Dim intFormat As Integer

Dim intType As Integer

Dim lngPoints As Long

 

Dim lngCount As Long

 

Dim dblXIncrement As

Double

Dim dblXOrigin As Double

Dim lngXReference As

Long

Dim sngYIncrement As

Single

Dim sngYOrigin As Single

Dim lngYReference As

Long

Dim strOutput As String

' Query for the preamble.

err = viVPrintf(vi, ":WAVEFORM:PREAMBLE?" + vbLf, 0) paramsArray(1) = VarPtr(dblArray(0))

retCount = DblArraySize

' Read preamble information.

err = viVScanf(vi, "%,#lf" + vbLf, paramsArray(0)) intFormat = dblArray(0)

intType = dblArray(1) lngPoints = dblArray(2) lngCount = dblArray(3) dblXIncrement = dblArray(4) dblXOrigin = dblArray(5) lngXReference = dblArray(6) sngYIncrement = dblArray(7) sngYOrigin = dblArray(8) lngYReference = dblArray(9) strOutput = ""

'strOutput = strOutput + "Format = " + CStr(intFormat) + vbCrLf 'strOutput = strOutput + "Type = " + CStr(intType) + vbCrLf 'strOutput = strOutput + "Points = " + CStr(lngPoints) + vbCrLf 'strOutput = strOutput + "Count = " + CStr(lngCount) + vbCrLf 'strOutput = strOutput + "X increment = " + _

'FormatNumber(dblXIncrement * 1000000) + _

'" us" + vbCrLf

'strOutput = strOutput + "X origin = " + _

'FormatNumber(dblXOrigin * 1000000) + _

'" us" + vbCrLf

'strOutput = strOutput + "X reference = " + _

Agilent InfiniiVision 5000 Series Oscilloscopes Programmer's Reference

575

Page 575
Image 575
Agilent Technologies 5000 Series manual Int32 specifies the data point associated with