Models 707B and 708B Switching Matrix Reference Manual
Section 7: Command reference
707B-901-01 Rev. A / August 2010
7-53
Example
MaxCount = dataqueue.CAPACITY
while dataqueue.count < MaxCount do
dataqueue.add(1)
end
print("There are " .. dataqueue.count
.. " items in the data queue")
dataqueue.clear()
print("There are " .. dataqueue.count
.. " items in the data queue")
This example fills the data queue and prints the
number of items in the queue. It then clears the
queue and prints the number of items again.
Output:
There are 128 items in the data
queue
There are 0 items in the data queue
Also see
(on page 7-53)
dataqueue.count
This attribute contains the number of items in the data queue.
Type
TSP-Link accessible
Affected by
Where saved
Default value
Attribute (R)
Yes
Power off
dataqueue.add()
dataqueue.clear()
dataqueue.next()
Not saved
Not applicable
Usage
count = dataqueue.count
count
The number of items in the data queue
Details
The count gets updated as entries are added and read from the data queue. It is also updated when the
dataqueue is cleared.
The number of items in the data queue are controlled through
dataqueue.add()
,
dataqueue.next()
, and
dataqueue.clear()
, with a maximum of
dataqueue.CAPACITY
items.
Example
MaxCount = dataqueue.CAPACITY
while dataqueue.count < MaxCount do
dataqueue.add(1)
end
print("There are " .. dataqueue.count
.. " items in the data queue")
dataqueue.clear()
print("There are " .. dataqueue.count
.. " items in the data queue")
Add items to the data queue until it is at capacity.
Output:
There are 128 items in the data queue
There are 0 items in the data queue