
3-18
Return to
2600AS-900-01 Rev. B / September 2008
Section 3: Test Script Processor Interaction
Series 2600A System SourceMeter
smua.source.levelv = 5
smua.source.limiti = 0.1
smua.measure.rangei = 0.1
smua.measure.nplc = 1
smua.source.output = smua.OUTPUT_ON
for l_i = 1, ntimes do
print(smua.measure.i())
end --for
smua.source.output = smua.OUTPUT_OFF
end --function
print("Function 'MeasCurr(ntimes)' created")
Figure 3-9
GUI after loading and running the function script (GPIB)
The primary code that calls the function and retrieves the measurement results is listed below.
TSP prompts are enabled prior to calling the function. This code is executed when you click the
Call Function (GPIB) command button. In this example, the function performs ten current
measurements and sends the readings to the PC because “
ntimes
” is set to 10 when the function
is called. The results are displayed in the data text box as shown in
. Note that it would
be just as easy to take one or 100 readings simply by calling the function with a different value for
“
ntimes
,” for example, MeasCurr(100). You can pass parameters to a function, but not to a script.
However, you must initially run a script to create a function. See the Series 2600A Reference
Manual for more information.