User manual

Series 3700 System Switch/Multimeter Reference Manual Section 2: TSP Programming Fundamentals
3700S-901-01 Rev. C / July 2008 2-17
Script examples
Script using commands and statements only
The following script closes Channels 1-10 on Slot 3 and measures voltage on
each channel. The ten voltage readings are returned to the host computer, as
well as being stored in a voltage table on the instrument, using the channel
numbers as keys to index the table.
Example exclusive close and measure scripts follow:
User script created in Test Script Builder
voltage = { }
reset()
for j = 3001,3010 do
channel.exclusiveclose('3911,' .. j)
voltage[j] = dmm.measure()
print(voltage[j])
end
User script created in user's own program
loadscript
voltage = { }
reset()
for j = 3001,3010 do
channel.exclusiveclose('3911,' .. j)
voltage[j] = dmm.measure()
print(voltage[j])
end
endscript
NOTE When creating a script using the Test Script Builder, only the chunk is
typed in as shown in the Test script builder example. See Using Test
Script Builder (TSB) (on page 2-13) for details on creating, loading,
and running the script. When creating a script using a programming
language (the User's program script example), shell commands must
be included to manage interactions between the host computer and
TSP
TM
. The loadscript command starts loading the script into the
Series 3700 and endscript signifies the end of the script.