Run-Time Environment; Queries - Keithley 3700 series Reference Manual

System switch/multimeter
Hide thumbs Also See for 3700 series:
Table of Contents

Advertisement

Section 2: TSP Programming Fundamentals
In this manual we will refer to Lua as the "test script language" or "TSL." The TSP runs portions
of TSL code called "chunks." Most messages sent to the instrument are directly executed by the
TSP as TSL chunks. The simplest messages sent to the instrument are individual instrument
control commands. Even though these messages are executed as TSL chunks, using them is
no different than using a conventional instrument. The user sends a command message and the
instrument executes that command. When sending individual command messages, it is
irrelevant that the TSP is executing the message as a chunk.
The command set for each TSP enabled instrument is referred to as the "instrument control
library" or "ICL" (each instrument has a different ICL). Each TSP enabled instrument will have its
own set of ICL commands. Although each TSP enabled instrument inherits the same TSL (test
script language), different instruments extend the language in their own way.
ICL commands are very similar to the commands sent to a conventional instrument, but ICL
commands appear like function calls or assignment statements. For example, the command to
set ASCII precision to 10 for ASCII readings is:
format.asciiprecision = 10
Similarly, the command to format readings as ASCII is:
format.data = format.ASCII
These commands do not need to be sent as separate messages; they can be combined into
one message by concatenating the two commands together with a space separating them. The
resulting chunk would be as follows:
format.asciiprecision = 10 format.data = format.ASCII

Run-time environment

A feature of all scripting environments is the run-time environment. In the TSP, the runtime
environment is simply a collection of global variables. A global variable can be used to
remember a value as long as the unit is powered on and the variable is not assigned a new
value. To instruct the instrument to read the ASCII precision setting and store the result in a
global variable named x, send:
x = format.asciiprecision
A global variable can be removed from the environment by assigning it the nil value. For
example, the command x = nil will remove the global variable x from the run-time
environment. When the unit is turned off, the entire run-time environment will be lost.

Queries

TSP enabled instruments do not have inherent query commands. Like any other scripting
environment, the print command and other related print commands are used to generate
output. The print command creates one response message.
2-2
Series 3700 System Switch/Multimeter Reference Manual
Document Number: 3700S-901-01 Rev. A / August 2007

Advertisement

Table of Contents
loading

Table of Contents