Keithley 2450 Reference Manual page 493

Interactive sourcemeter instrument
Table of Contents

Advertisement

Section 7: Introduction to TSP operation
Example 1
beeper.beep(0.5, 2400)
delay(0.250)
beeper.beep(0.5, 2400)
Example 2
You can use the results of a function-based command directly or assign variables to the results for
later access. The following code defines x and prints it.
x = math.abs(-100)
print(x)
Attributes
Attribute-based commands are commands that set the characteristics of an instrument feature or
operation. For example, some characteristics of TSP-enabled instruments are the model number
(localnode.model) and the brightness of the front-panel display (display.lightstate).
Attributes can be read-only, read-write, or write-only. They can be used as a parameter of a function
or assigned to another variable.
To set the characteristics, attribute-based commands define a value. For many attributes, the value is
in the form of a number, enumerated type, or a predefined constant.
Example 1: Set an attribute using a number
testData = buffer.make(500)
testData.capacity = 600
Example 2: Set an attribute using an enumerated type
display.lightstate = display.STATE_LCD_75
Example 3: Set an attribute using a constant
format.data = format.REAL64
7-2
Model 2450 Interactive SourceMeter® Instrument Reference Manual
Emit a double-beep at 2400 Hz. The sequence is
0.5 s on, 0.25 s off, 0.5 s on.
Output:
100
Use a function to create a buffer named testData with a
capacity of 500, then use the bufferVar.capacity
attribute to change the capacity to 1000.
This attribute controls the brightness of the
front-panel display and buttons. Setting this
attribute to display.STATE_LCD_75 sets the
brightness of the display and buttons to 75% of
full brightness.
Using the constant REAL64 sets the print format
to double precision floating point format.
2450-901-01 Rev. B/September 2013

Advertisement

Table of Contents
loading

Table of Contents