Programming Examples
40
Keysight InfiniiVision M9241/42/43A PXIe Oscilloscopes SCPI Programmer's Guide
1495
myScope.SCPI.WAVeform.POINts.MODE.Query(strResults)
Console.WriteLine("Waveform points mode: {0}", strResults)
' Get the number of waveform points available.
myScope.SCPI.WAVeform.POINts.CommandPoints(10240)
Dim nPointsAvail As Integer
myScope.SCPI.WAVeform.POINts.Query1(nPointsAvail)
Console.WriteLine("Waveform points available: {0}", nPointsAvail)
' Set the waveform source.
myScope.SCPI.WAVeform.SOURce.Command("CHANnel1")
myScope.SCPI.WAVeform.SOURce.Query(strResults)
Console.WriteLine("Waveform source: {0}", strResults)
' Choose the format of the data returned (WORD, BYTE, ASCII):
myScope.SCPI.WAVeform.FORMat.Command("BYTE")
myScope.SCPI.WAVeform.FORMat.Query(strResults)
Console.WriteLine("Waveform format: {0}", strResults)
' Display the waveform settings:
Dim nFormat As Integer, nType As Integer, nPoints As Integer, _
nCount As Integer, nXreference As Integer, _
nYreference As Integer
Dim dblXincrement As Double, dblXorigin As Double, _
dblYincrement As Double, dblYorigin As Double
myScope.SCPI.WAVeform.PREamble.Query(nFormat, nType, nPoints, _
nCount, dblXincrement, dblXorigin, nXreference, _
dblYincrement, dblYorigin, nYreference)
If nFormat = 0 Then
Console.WriteLine("Waveform format: BYTE")
ElseIf nFormat = 1 Then
Console.WriteLine("Waveform format: WORD")
ElseIf nFormat = 2 Then
Console.WriteLine("Waveform format: ASCii")
End If
If nType = 0 Then
Console.WriteLine("Acquire type: NORMal")
ElseIf nType = 1 Then
Console.WriteLine("Acquire type: PEAK")
ElseIf nType = 2 Then
Console.WriteLine("Acquire type: AVERage")
ElseIf nType = 3 Then
Console.WriteLine("Acquire type: HRESolution")
End If
Console.WriteLine("Waveform points: {0:e}", nPoints)
Console.WriteLine("Waveform average count: {0:e}", nCount)
Console.WriteLine("Waveform X increment: {0:e}", dblXincrement)
Console.WriteLine("Waveform X origin: {0:e}", dblXorigin)
Console.WriteLine("Waveform X reference: {0:e}", nXreference)
Console.WriteLine("Waveform Y increment: {0:e}", dblYincrement)
Console.WriteLine("Waveform Y origin: {0:e}", dblYorigin)
Console.WriteLine("Waveform Y reference: {0:e}", nYreference)
' Read waveform data.