EasyManua.ls Logo

Hioki 3541 - Page 160

Hioki 3541
194 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
8.8 Sample Programs
154
(2) Measure Resistance by PC Key
Measures and imports by key input on the PC, and saves measurements in a text file.
Private Sub MeasureReadSub()
Dim buffer As String 13 'Receiving butter
Dim recvstr As String 'Receiving char string
Dim pad As Integer 'Controller access
Dim gpibad As Integer 'Device Address
Dim timeout As Integer 'Timeout period
Dim ud As Integer 'State (unused)
Dim i As Integer
pad = 0 'Board Address 0
gpibad = 1 '3541 Address 1
timeout = T10s 'Timeout about 10s
Call ibfind("gpib0", 0) 'Initialize GP-IB
Call ibdev(pad, gpibad, 0, timeout, 1, 0, ud)
Call SendIFC(pad)
Open App.Path & "\data.csv" For Output As #1 'Open a text file for saving
Call Send(pad, gpibad, ":TRIG:SOUR IMM", NLend) 'Select internal triggering
Call Send(pad, gpibad, ":INIT:CONT OFF", NLend) 'Continuous measurement OFF
For i = 1 To 10
'Wait for PC key input
'Create a key input check routine to set InputKey() = True when a key is pressed
Do While 1
If InputKey() = True Then Exit Do
DoEvents
Loop
'After confirming key input, measure once, and read the measured value
Call Send(pad, gpibad, ":READ?", NLend) 'Send ":READ?" to measure and import the
measurement
Call Receive(pad, gpibad, buffer, STOPend) 'Receive
recvstr = Left(buffer, InStr(1, buffer, Chr(10)) - 1)
Print #1, Str(i) & "," & recvstr 'Write to the file
Next
Close #1
Call ibonl(pad, 0)
End Sub

Table of Contents

Related product manuals