Model 2461 Interactive SourceMeter® Instrument Reference Manual
Section 8: TSP command reference
2461-901-01 A/November 2015
8-49
Details
If the data queue is empty, the function waits up to the
timeout
value.
If data is not available in the data queue before the
timeout
expires, the return value is
nil
.
The entries in the data queue are removed in first-in, first-out (FIFO) order.
If the value is a table, a duplicate of the original table and any subtables is made. The duplicate table
does not contain any references to the original table or to any subtables.
Example
dataqueue.clear()
for i = 1, 10 do
dataqueue.add(i)
end
print("There are " .. dataqueue.count
.. " items in the data queue")
while dataqueue.count > 0 do
x = dataqueue.next()
print(x)
end
print("There are " .. dataqueue.count
.. " items in the data queue")
Clears the data queue, adds ten entries, then
reads the entries from the data queue. Note that
your output may differ depending on the setting
of
format.asciiprecision
.
Output:
There are 10 items in the data queue
1.000
2.000
3.000
4.000
5.000
6.000
7.000
8.000
9.000
1.001
There are 0 items in the data queue
Also see
(on page 8-45)
(on page 8-46)
(on page 8-47)
(on page 8-48)
(on page 8-77)
Using the data queue for real-time communication
(on page 3-158)
delay()
This function delays the execution of the commands that follow it.
Type
TSP-Link accessible
Affected by
Where saved
Default value
Function
No
Usage
delay(
seconds
)
seconds
The number of seconds to delay (0 to 100 ks)
Details
The instrument delays execution of the commands for at least the specified number of seconds and
fractional seconds. However, the processing time may cause the instrument to delay 5 μs to 10 μs
(typical) more than the requested delay.