Models 707B and 708B Switching Matrix Reference Manual
Section 5: Remote commands
707B-901-01 Rev. A / August 2010
5-3
To read an attribute, you can use the attribute as the parameter of a function, or assign it to another
variable.
Example 1: Read an attribute using a function
print(format.data)
Reads the data format by passing the attribute
to the print function. If the data format is set to
3, the output is:
3.000
This shows that the data format is set to double
precision floating point.
Example 2: Read an attribute using a variable
fd = format.data
This reads the data format by assigning the
attribute to a variable named
fd
.
Queries
TSP-enabled instruments do not have inherent query commands. Like any other scripting
environment, the
print()
command and other related commands generate output in the form of
response messages. Each
print()
command creates one response message.
Example
Code Notes
and
output
x = 10
print(x)
Example of an output response message:
1.001
Note that your output might be different if you set your ASCII
precision setting to a different value.
Data retrieval commands
You can send data retrieval commands that return a comma-delimited string. For example,
print(memory.available())
returns the amount of memory that is available in the instrument.
The comma-delimited string that is returned starts with the lowest channel and goes to the highest
channel on Slot 1. It then lists each subsequent slot until the highest slot is reached.
Information on scripting and programming
If you need information on using scripts with Model 707B or 708B, see
If you need information on using the Lua programming language with Model 707B or 708B, see
Fundamentals of programming for TSP
(on page 6-15).