12-42 Return to Section Topics 2600S-901-01 Rev. C / January 2008
Section 12: Instrument Control Library Series 2600 System SourceMeter® Instruments Reference Manual
makegetter functions
These functions are used to set and retrieve a value for an attribute.
localnode.setglobal
Function Sets the value of a global variable.
Usage node[N].setglobal (name, value)
name The name of the variable.
value The value assigned to the variable.
Remarks • Use this function to create a global variable and to assign values to the global variable from a
remote master node.
• Do not use this command to set the value of a global variable on the local node.
Example node[N].setglobal ("x", 5)
localnode.showerrors
Attribute Automatic display of errors.
Usage errormode = localnode.showerrors-- Reads show errors state.
localnode.showerrors = errormode-- Writes show errors state.
errormode - Set to 0 or 1.
Remarks • If this attribute is set to 1, the unit will automatically display any generated errors stored in the
error queue, and then clear the queue. Errors will be processed at the end of executing a
command message (just prior to issuing a prompt, if prompts are enabled).
• If this attribute is set to 0, errors will be left in the error queue and must be explicitly read or
cleared.
• When used in an expanded system (TSP-Link), localnode.showerrors is sent to the
remote master node only. Use node[N].showerrors (where N is the node number) to
send the command to any node in the system. See
Section 9 for details about TSP-Link.
Details See errorqueue functions and attribute
Also see localnode.setglobal
makegetter
Function Creates a function to set the value of an attribute.
Usage getter = makegetter(table, attribute name)
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.
Example Creates a getter function called getlevel:
getlevel = makegetter(smua.source, "levelv")
...
v = getlevel()
When getlevel is called, it returns the value of smua.source.levelv.