User manual
Series 3700 System Switch/Multimeter Reference Manual Section 3: TSP Advanced Features
3700S-901-01 Rev. C / July 2008 3-9
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 TSL code remotely can return stale values from the reading buffer to
the cached data. If the values in the reading buffer change while the TSL 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 = dmm.makebuffer(20) " ..
"dmm.measure.count = 20 " ..
"dmm.measure(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("dmm.measure(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])