User manual
Section 13: Instrument Control Library (ICL) Series 3700 System Switch/Multimeter Reference Manual
13-218 3700S-901-01 Rev. C / July 2008
makegetter functions
Use the functions in this group to set and retrieve a value for an attribute.
makegetter()
Function
Creates a function to get the value of an attribute.
Usage
getter = makegetter(table, attributename)
table: Read-only table were the attribute is located.
attributename: The string name of the attribute.
getter: Function that returns the value of the given attribute.
Remarks
This function creates a function that when called returns the value of the attribute.
This function is useful for aliasing attributes to improve execution speed. Calling
the getter function will execute faster than accessing the attribute directly.
Creating a getter function is only useful if it is going to be called several times.
Otherwise the overhead of creating the getter function outweighs the overhead of
accessing the attribute directly.
Also see
makesetter() (on page 13-218)
Example
To create a getter function called getrange:
getrange = makegetter(dmm, "range")
...
r = getrange()
NOTE When getrange is called, it returns the value of dmm.range.
makesetter()
Function
Creates a function to set the value of an attribute.
Usage
setter = makesetter(table, attributename)
table: Read-only table were the attribute is located.
attributename: The string name of the attribute.
setter: Function that sets the value of the given attribute.
Remarks
This function creates a function that when called sets the value of the attribute. 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.
Otherwise the overhead of creating the setter function outweighs the overhead of
accessing the attribute directly.
Also see
makegetter() (on page 13-218)
Example
Use setrange to set the value of dmm.range for the currently selected function:
setrange = makesetter(dmm, "range")
setrange(5)