Programming Examples
40
Keysight InfiniiVision M9241/42/43A PXIe Oscilloscopes SCPI Programmer's Guide
1445
Console.WriteLine("Waveform points mode: {0}", _
myScope.DoQueryString(":WAVeform:POINts:MODE?"))
' Get the number of waveform points available.
myScope.DoCommand(":WAVeform:POINts 10240")
Console.WriteLine("Waveform points available: {0}", _
myScope.DoQueryString(":WAVeform:POINts?"))
' Set the waveform source.
myScope.DoCommand(":WAVeform:SOURce CHANnel1")
Console.WriteLine("Waveform source: {0}", _
myScope.DoQueryString(":WAVeform:SOURce?"))
' Choose the format of the data returned (WORD, BYTE, ASCII):
myScope.DoCommand(":WAVeform:FORMat BYTE")
Console.WriteLine("Waveform format: {0}", _
myScope.DoQueryString(":WAVeform:FORMat?"))
' Display the waveform settings:
Dim fResultsArray As Double()
fResultsArray = myScope.DoQueryNumbers(":WAVeform:PREamble?")
Dim fFormat As Double = fResultsArray(0)
If fFormat = 0 Then
Console.WriteLine("Waveform format: BYTE")
ElseIf fFormat = 1 Then
Console.WriteLine("Waveform format: WORD")
ElseIf fFormat = 2 Then
Console.WriteLine("Waveform format: ASCii")
End If
Dim fType As Double = fResultsArray(1)
If fType = 0 Then
Console.WriteLine("Acquire type: NORMal")
ElseIf fType = 1 Then
Console.WriteLine("Acquire type: PEAK")
ElseIf fType = 2 Then
Console.WriteLine("Acquire type: AVERage")
ElseIf fType = 3 Then
Console.WriteLine("Acquire type: HRESolution")
End If
Dim fPoints As Double = fResultsArray(2)
Console.WriteLine("Waveform points: {0:e}", fPoints)
Dim fCount As Double = fResultsArray(3)
Console.WriteLine("Waveform average count: {0:e}", fCount)
Dim fXincrement As Double = fResultsArray(4)
Console.WriteLine("Waveform X increment: {0:e}", fXincrement)
Dim fXorigin As Double = fResultsArray(5)
Console.WriteLine("Waveform X origin: {0:e}", fXorigin)
Dim fXreference As Double = fResultsArray(6)
Console.WriteLine("Waveform X reference: {0:e}", fXreference)