.9.2 DOS/V Sample Program
The following sample programs run under Windows, and assume that the
controller of the 3227 is using MS-DOS (IBM-compatible) and a GP-IB board
(National Instruments).
For detailed description of the programming languages or the GP-IB board,
refer to the respective user manuals.
GP-IB commands in these sample programs are all written in their
shortforms. The address of the 3227 on the GP-IB bus is assumed to be 1.
Summary This program measures resistance 10 times, and saves the results to a file.
(The Excel version pastes them into cells.)
(1) Visual Basic
Program List line
Sub MeasureSub ( ) 1
Dim buffer As String * 13
pad%=0
gpibad%=1
timeout%=T10s 5
Call ibfind("gpib0",0)
Call ibdev(pad%, gpibad%, 0, timeout%, 1, 0, dmm%)
Call SendIFC(pad%)
Open "data.txt"For Output As #1
For i=1 TO 10 10
Call Trigger(pad%, gpibad%)
Call Send(pad%, gpibad%, ":MEAS:RESI?",NLend%)
Call Receive(pad%, gpibad%, buffer$, STOPend%)
Print #1, Str(i) & ","& buffer$;
Next i 15
Close #1
Call ibonl(pad%, 0)
End Sub
Comments
line
1 Set the string length of the measurement buffer.
6 Initialize the GP-IB port
8 Initialize the interfacde
9 Open the data preservation file "data.txt"
11 Execute the measurement once
13 Get the resistance measurement value
14 Save the measurement value to the file
15 Loop until getting the designated number of measurement value
16 Close the file
17 Set the interface to the local state.