Keithley 708B Reference Manual page 202

Switching matrix
Hide thumbs Also See for 708B:
Table of Contents

Advertisement

Models 707B and 708B Switching Matrix Reference Manual
Retrieve a script as a single string
To retrieve the entire user script source code as a single string, use the scriptVar.source
attribute. The loadscript or loadandrunscript and endscript keywords are not included.
To retrieve the source code as a single string, send the command:
print(scriptVar.source)
where scriptVar is the name of the script.
Example
Code
print(test1.source)
If you are using TSB Embedded to retrieve a script:
1. In TSB Embedded, from the User Scripts list, select the script you want to edit. The contents of
the script are displayed.
2. If you want to save the script to a new name, change the name in the TSP Script box and click
Save Script.
3. Edit the content of the script as needed.
4. Click Save Script.
5. For the overwrite message, click OK.
Script example: Retrieve the content of scripts
This set of examples:
Creates a script that generates an error.
Retrieves the source of the script using scriptVar.source (on page 7-167).
Retrieves the source of the script using scriptVar.list() (on page 7-164).
Example: Create a script named scriptVarTest
Code
errorqueue.clear()
closedChannels = channel.getclose("1F10")
if closedChannels == nil then
channel.setforbidden("1F10")
else
channel.open("1F10")
channel.setforbidden("1F10")
end
channel.close("1F10")
print(errorqueue.next())
707B-901-01 Rev. A / August 2010
Section 6: Instrument programming
Notes
Retrieve the source of a script named "test7".
Description
Clears existing errors.
Determine if crosspoint 1F10 is closed.
If 1F10 is currently open, configure it as a forbidden
channel.
If 1F10 is currently closed, open the crosspoint and
set it as a forbidden channel.
Attempt to close 1F10, which should generate an
error.
Check the error queue and print the next error.
6-11

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

707b

Table of Contents