Load a script from the instrument front panel
You can also load scripts from a USB flash drive to the run-time environment of the instrument.
Depending on the content of the TSP file on the drive, the script can be loaded either as an
anonymous script without a designated name, or as a named script with a user-defined name. Only
named scripts can be saved to internal nonvolatile memory. Only one anonymous script can exist in
the run-time environment.
To load a script into the instrument with a specific name, the TSP file must include the shell keywords
loadscript and endscript, along with the specified script name, as shown in the example file
MyScript1.tsp, which contains the script:
loadscript Beeper
reset()
beeper.enable = beeper.ON
beeper.beep(2,2400)
endscript
When you load the file MyScript1.tsp from the flash drive, a script named Beeper is created in
the run-time environment. Note that the script is named using the name that follows the loadscript
keyword, not the name of the TSP file on the flash drive. After the script is loaded, you can choose to
save it to nonvolatile memory.
If the loaded file does not contain loadscript and endscript keywords, or if no name is included
after the loadscript keyword, the code is loaded as the anonymous script. Loading an unnamed script
overwrites the existing anonymous script. For example, if a file named MyScript2.tsp contains
only the following code, the script is loaded as the anonymous script:
reset()
beeper.enable = beeper.ON
beeper.beep(2,2400)
The file must be a valid script file. If not, an error message is posted and no further action is taken.
You can view the errors on the front panel of the instrument.