2606B System SourceMeter® Instrument Reference Manual
Section 7: TSP command reference
2606B-901-01 Rev. B / May 2018
7-147
makesetter()
This function creates a function that, when called, sets the value of an attribute.
Type
TSP-Link accessible
Affected by
Where saved
Default value
Function
No
Usage
setter
= makesetter(
table
,
attributeName
)
setter
Function that sets the value of the attribute
table
Read-only table where the attribute is located
attributeName
The string name of the attribute
Details
This function is useful for aliasing attributes to improve execution speed. Calling the
setter
function
will execute faster than accessing the attribute directly.
Creating a
setter
function is only useful if it is going to be called several times. If you are not calling
the
setter
function several times, it is more efficient to access the attribute directly.
Example
setlevel = makesetter(smua.source, "levelv")for v = 1, 10 do
setlevel(v)
end
Creates a setter function called
setlevel
.
Using
setlevel()
in the loop sets the value of
smua.source.levelv
, performing a source sweep.
Also see
(on page 7-146)
meminfo()
This function returns the present amount of available memory and the total amount of memory in the instrument.
Type
TSP-Link accessible
Affected by
Where saved
Default value
Function
No
Usage
freeMem, totalMem
= meminfo()
freeMem
The amount of free dynamically allocated memory available
totalMem
The total amount of dynamically allocated memory in the instrument
Details
This function returns two values:
•
The amount of free dynamically allocated memory available in kilobytes
•
The total amount of dynamically allocated memory on the instrument in kilobytes
The difference between the two values is the amount presently used.