Retrieving and modifying a factory script listing ......................................................................6-21
KISweep factory script ............................................................................................................6-22
KIHighC factory script .............................................................................................................6-22
KIParlib factory script ..............................................................................................................6-22
KISavebuffer factory script......................................................................................................6-22
Instrument programming......................................................................................... 7-1
Fundamentals of scripting for TSP....................................................................................... 7-1
What is a script?........................................................................................................................7-2
Runtime and nonvolatile memory storage of scripts..................................................................7-2
What can be included in scripts?...............................................................................................7-2
Commands that cannot be used in scripts................................................................................7-3
Manage scripts.......................................................................................................................... 7-3
Working with scripts in nonvolatile memory.............................................................................7-11
Programming example: Interactive script................................................................................7-13
Fundamentals of programming for TSP............................................................................. 7-14
What is Lua?........................................................................................................................... 7-15
Lua basics............................................................................................................................... 7-15
Standard libraries....................................................................................................................7-29
Programming example: User script.........................................................................................7-33
Password management ..................................................................................................... 7-33
Setting the password from a command or web interface ........................................................ 7-34
Unlocking the remote interface................................................................................................7-35
Resetting the password...........................................................................................................7-35
Key-press codes ................................................................................................................ 7-35
Sending key codes..................................................................................................................7-35
Capturing key-press codes......................................................................................................7-36
Test Script Builder.............................................................................................................. 7-37
Installing the TSB software......................................................................................................7-37
Using Test Script Builder (TSB) ..............................................................................................7-38
Project navigator.....................................................................................................................7-39
Script editor.............................................................................................................................7-40
Outline view.............................................................................................................................7-40
Programming interaction.........................................................................................................7-41
Working with TSB Embedded............................................................................................ 7-41
Simplify the display .................................................................................................................7-42
Create a script using TSB Embedded.....................................................................................7-42
Copy an existing script............................................................................................................7-42
Run a script.............................................................................................................................7-43
Delete a script.........................................................................................................................7-43
Modify a script.........................................................................................................................7-43
Import a script from a computer ..............................................................................................7-43
Export a script to a computer ..................................................................................................7-44
Export a script to the instrument USB .....................................................................................7-44
Reset the instrument using TSB Embedded...........................................................................7-44
Send individual instrument commands with TSB Embedded..................................................7-45
Advanced scripting for TSP ............................................................................................... 7-45
Global variables and the script.user.scripts table.................................................................... 7-45
Create a script using the script.new() command.....................................................................7-47
Rename a script......................................................................................................................7-49
Retrieve a user script ..............................................................................................................7-51
Delete user scripts from the instrument...................................................................................7-52
Restore a script to the runtime environment ...........................................................................7-53
Memory considerations for the runtime environment ..............................................................7-53
TSP-Link system expansion interface................................................................................ 7-55