User manual

Section 2: TSP Programming Fundamentals Series 3700 System Switch/Multimeter Reference Manual
2-18 3700S-901-01 Rev. C / July 2008
Script using a function
TSL facilitates grouping commands and statements using the function
keyword. Therefore, a script can also consist of one or more functions. Once a
script has been run, the host computer can then call a function in the script
directly.
The following script contains an ICL command to reset the DMM and a function
(named MyDcv), which takes one parameter to represent the speed of the
measurement. When this script is run, the DMM will be reset and the function
MyDcv will be available for calling.
Example scripts using a function:
Test script builder example
dmm.reset('all')
function MyDcv(speed)
dmm.func = 'dcvolts'
dmm.nplc = speed
dmm.range = 10
reading = dmm.measure()
print(reading)
end
User’s program script example
loadscript
dmm.reset('all')
function MyDcv(speed)
dmm.func = 'dcvolts'
dmm.nplc = speed
dmm.range = 10
reading = dmm.measure()
print(reading)
end
endscript
When calling the function, you must specify the measurement speed in the
argument for the function. For example, to set the measurement speed to 0.5,
call the function as follows:
MyDcv(0.5)
This will set the DMM function to DCV, NPLC to 0.5, and range to 10V. The
voltage reading is sent to the host computer and displayed.