Section 7: Command reference
Also see
dataqueue.add()
dataqueue.CAPACITY
dataqueue.clear()
dataqueue.next()
dataqueue.next()
This function removes the next entry from the data queue.
Type
TSP-Link accessible
Function
Yes
Usage
value = dataqueue.next()
value = dataqueue.next(timeout)
value
timeout
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")
Also see
dataqueue.add()
7-54
(on page 7-51)
(on page 7-52)
(on page 7-52)
(on page 7-54)
Affected by
The next entry in the data queue
The number of seconds to wait for data in the queue
(on page 7-51)
Models 707B and 708B Switching Matrix Reference Manual
Where saved
Default value
Clears the data queue, adds ten entries, then
reads the entries from the data queue.
Output:
There are 10 items in the data
queue
1.000000000e+00
2.000000000e+00
3.000000000e+00
4.000000000e+00
5.000000000e+00
6.000000000e+00
7.000000000e+00
8.000000000e+00
9.000000000e+00
1.000000000e+01
There are 0 items in the data queue
707B-901-01 Rev. A / August 2010