Agilent Technologies 86082A User Manual page 244

Wavelength domain component analyzer
Table of Contents

Advertisement

End Function
Public Function ASCToArray(ByVal ASCTrace As String, ByVal numPoints As Integer, _
'-- This function will convert a comma-delimited ASCII trace to an array.
'--
Dim NxtComma As Long: NxtComma = 0
Dim PrvComma As Long: PrvComma = 0
Dim i As Integer
On Error GoTo ErrorHandler
'-- Size result array according to the number of points
ReDim dResult(0 To numPoints - 1) As Double
'-- Find the first comma
NxtComma = InStr(ASCTrace, ",")
If NxtComma <> 0 Then
For i = 0 To numPoints - 1
'-- Pull out the next value
dResult(i) = Val(Mid(ASCTrace, PrvComma + 1, NxtComma - PrvComma - 1))
'-- Increment string indexes
PrvComma = NxtComma
NxtComma = InStr(PrvComma + 1, ASCTrace, ",")
'-- The last value wont have a comma
If NxtComma = 0 Then NxtComma = Len(ASCTrace)
Next i
End If
ErrMsg = ""
ASCToArray = 0
Exit Function
ErrorHandler:
ErrMsg = Err.Description
ASCToArray = Err.Number
End Function
Public Function BinASCToArray(ByVal BinASCTrace As String, ByVal eDataSize As enumDataSize, _
'-- The REAL format is a definite-length block of 64-bit floating-point binary numbers. The
'-- definite-length block is defined by IEEE 488.2: a "#" character, followed by one digit
'-- (in ASCII) specifying the number of length bytes to follow, followed by the length
'-- (in ASCII), followed by length bytes of binary data. The binary data is a sequence of
'-- 4-byte (32-bit) or 8-byte (64-bit) floating point numbers.
'
Dim NumBytes As Integer: NumBytes = 4
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
ByRef dResult() As Double, Optional ErrMsg As String = "") As Long
ByRef dResult() As Double, Optional ErrMsg As String = "") As Long
Remote Operation
Example Programs
5-69

Advertisement

Table of Contents
loading

Table of Contents