Section 6: Instrument programming
Model 2651A High Power System SourceMeter® Instrument Reference Manual
6-60
2651A-901-01 Rev. A / March 2011
Removing stale values from the reading buffer
The node that acquires the data stores the data for the reading buffer. To optimize data access, all
nodes can cache data from the node that stores the reading buffer data.
Running Lua code remotely can cause reading buffer data held in the cache to become stale. If the
values in the reading buffer change while the Lua code runs remotely, another node can hold stale
values. Use the
clearcache()
command to clear the cache.
The following code demonstrates how stale values occur and how to use the
clearcache()
command to clear the cache.
Note the following:
•
Replace
N
with the node number
•
Replace
G
with the group number
-- Creates a reading buffer on a node in a remote group.
node[
N
].tsplink.group =
G
node[
N
].execute("rbremote = smua.makebuffer(20)" ..
"smua.measure.count = 20 " ..
"smua.measure.v(rbremote)")
-- Creates a variable on the local node to
-- access the reading buffer.
rblocal = node[
N
].getglobal("rbremote")
-- Access data from the reading buffer.
print(rblocal[1])
-- Runs code on the remote node that updates the reading buffer.
node[
N
].execute("smua.measure.v(rbremote)")
-- Use the clearcache command if the reading buffer contains cached data.
rblocal.clearcache()
-- If you do not use the clearcache command, the data buffer
-- values will never update. Every time the print command is
-- issued after the first print command, the same data buffer
-- values will print.
print(rblocal[1])
TSP-Net
Overview
The TSP-Net
®
library allows the Model 2651A to control LAN-enabled devices directly through its LAN
port. This enables the Model 2651A to communicate directly with a non-TSP
®
enabled device without
the use of a controlling computer.