500
Keysight InfiniiVision M9241/42/43A PXIe Oscilloscopes SCPI Programmer's Guide
21
:MEASure Commands
ValueColumnArray(5) = "Std_Dev"
ValueColumnArray(6) = "Count"
Dim ValueColumn As Variant
For Each ResultType In ResultsTypeArray
myScope.WriteString ":MEASure:STATistics " + ResultType
' Get the statistics results.
Dim intCounter As Integer
intCounter = 0
myScope.WriteString ":MEASure:RESults?"
ResultsList() = myScope.ReadList
For Each Measurement In MeasurementArray
If ResultType = "ON" Then
' All statistics.
For Each ValueColumn In ValueColumnArray
If VarType(ResultsList(intCounter)) <> vbString Then
Debug.Print "Measure statistics result CH1, " + _
Measu ", "; Value ": " + _
FormatNumber(ResultsList(intCounter), 4)
Else
' Result is a string (e.g., measurement label).
Debug.Print "Measure statistics result CH1, " + _
Measu ", "; Value ": " + _
ResultsList(intCounter)
End If
intCounter = intC 1
Next
Else
' Specific statistic (e.g., Current, Max, Min, etc.).
Debug.Print "Measure statistics result CH1, " + _
Measu ", "; Resu ": " + _
FormatNumber(ResultsList(intCounter), 4)
intCounter = intC 1
End If
Next
Next
Exit Sub
VisaComError:
MsgBox "VISA COM Error:" + Err.Description
End Sub