
Table of Contents Model 2657A High Power System SourceMeter® Instrument Reference Manual
iv 2657A-901-01 Rev. B/December 2012
Information on scripting and programming................................................................................ 5-3
About TSP commands ......................................................................................................... 5-3
Beeper control........................................................................................................................... 5-3
Bit manipulation and logic operations........................................................................................ 5-3
Data queue................................................................................................................................ 5-4
Digital I/O .................................................................................................................................. 5-5
Display ...................................................................................................................................... 5-5
Error queue ............................................................................................................................... 5-6
Event log ................................................................................................................................... 5-6
File I/O ...................................................................................................................................... 5-6
GPIB ......................................................................................................................................... 5-7
Instrument identification ............................................................................................................ 5-7
LAN and LXI.............................................................................................................................. 5-8
Miscellaneous ........................................................................................................................... 5-9
Parallel script execution ............................................................................................................ 5-9
Queries and response messages.............................................................................................. 5-9
Reading buffer......................................................................................................................... 5-10
Reset....................................................................................................................................... 5-10
RS-232.................................................................................................................................... 5-10
Saved setups .......................................................................................................................... 5-11
Scripting .................................................................................................................................. 5-11
SMU ........................................................................................................................................ 5-12
SMU calibration....................................................................................................................... 5-13
Status model ........................................................................................................................... 5-14
Time ........................................................................................................................................ 5-15
Triggering................................................................................................................................ 5-15
TSP-Link ................................................................................................................................. 5-17
TSP-Net .................................................................................................................................. 5-17
Userstrings.............................................................................................................................. 5-17
Factory scripts.................................................................................................................... 5-18
Introduction ............................................................................................................................. 5-18
Running a factory script .......................................................................................................... 5-18
Retrieving and modifying a factory script listing ...................................................................... 5-19
KISweep factory script ............................................................................................................ 5-19
KIPulse factory script .............................................................................................................. 5-20
KIHighC factory script ............................................................................................................. 5-21
KIParlib factory script .............................................................................................................. 5-21
KISavebuffer factory script ...................................................................................................... 5-21
Instrument programming...........................................................................................6-1
Fundamentals of scripting for TSP....................................................................................... 6-1
What is a script?........................................................................................................................ 6-2
Run-time and nonvolatile memory storage of scripts ................................................................ 6-2
What can be included in scripts?............................................................................................... 6-2
Commands that cannot be used in scripts ................................................................................ 6-3
Manage scripts.......................................................................................................................... 6-3
Working with scripts in nonvolatile memory............................................................................... 6-7
Programming example .............................................................................................................. 6-9
Fundamentals of programming for TSP............................................................................. 6-10
Introduction ............................................................................................................................. 6-10
What is Lua? ........................................................................................................................... 6-11
Lua basics............................................................................................................................... 6-11
Standard libraries .................................................................................................................... 6-25
Programming example: Script with a for loop.......................................................................... 6-29
Test Script Builder (TSB) ................................................................................................... 6-29
Installing the TSB software...................................................................................................... 6-29
Installing the TSB add-in ......................................................................................................... 6-30