16-54
IM 765501-01E
‘—————————————————————————————————
‘
‘ Read the measured result
‘
‘ Free run using internal trigger
‘
‘—————————————————————————————————
Function ReadAsString(dev As Integer) As String
‘ String output
ReadAsString = CommQuery(dev, “:READ?”)
End Function
Function ReadAsDouble(dev As Integer) As Double
‘ Real number output
ReadAsDouble = Val(ReadAsString(dev))
End Function
‘—————————————————————————————————
‘
‘ Sample Sequence 1
‘
‘ Set the GS610 to Setup 1, read 10 result values in an array, and turn the output
‘ OFF
‘
‘—————————————————————————————————
Function SampleSequence1()
Dim dev As Integer
Dim result(10) As Double
Dim i As Integer
dev = CommOpen()
‘ Open the device
Call Setup1(dev)
‘ Set to Setup 1
For i = 0 To 9
‘ Loop 10 times
result(i) = ReadAsDouble(dev)
‘ Read the result and substitute
into an array
Next i
Call CommSend(dev, “:OUTP:STAT OFF”)
‘ Turn the output OFF
Call CommClose(dev)
‘ Close the device
End Function
16.4 Sample Programs