
Section 2
:
TSP Programming Fundamentals
Series 3700 System Switch/Multimeter Reference Manual
2-14
Document Number: 3700S-901-01 Rev. A / August 2007
User’s program script example
loadscript
voltage = { }
reset()
for j = 3001,3010 do
channel.exclusiveclose(„3911‟ ..j)
voltage[j] = dmm.measure()
print(voltage[j])
end
end
NOTE
When creating a script using the Test Script Builder, only the chunk is typed in as
shown above. See ―Using Test Script Builder‖ earlier in Section 2 for details on
creating, loading and running the script. When creating a script using a programming
language, shell commands must be included to manage interactions between the host
computer and TSP. The loadscript command loads the script into the Series 3700 and
endscript signifies the end of the script.
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).
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