Section 7: Command reference
Model 2651A High Power System SourceMeter® Instrument Reference Manual
7-40
2651A-901-01 Rev. A / March 2011
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-40)
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 cycle
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