124
Chapter 9
Measurement Applications (Sample Programs)
Reading Measurement Results in Binary Format Using *TRG Command
'===================================
' Measurement
'===================================
ErrorCheck viVPrintf(Agte4981a, "*TRG" + vbLf, 0)
Call Scpi_read_binary_double_array(Agte4981a, Res, Nop)
Worksheets("Example7").Range("B5").Value = Val(Res(1))
Worksheets("Example7").Range("B6").Value = Val(Res(2))
'===================================
' Setup End
'===================================
Call viClose(defrm)
End
'===================================
' ErrorProc
'===================================
ErrorHandler:
' Display the error message
MsgBox "*** Error : " + Error$, MB_ICON_EXCLAMATION
End
End Sub
'===================================
' Binary Read
'===================================
Sub Scpi_read_binary_double_array(vi As Long, data() As Double, Nop
As Long)
Dim dblArray(10000) As Double