![background image](http://html2.mh-extra.com/html/keithley/2657a/2657a_reference-manual_4007750360.webp)
Model 2657A High Power System SourceMeter® Instrument Reference Manual
Section 7: TSP command reference
2657A-901-01 Rev. B/December 2012
7-47
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
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 with
dataqueue.add()
and read from the data queue with
dataqueue.next()
. It is also updated when the dataqueue is cleared with
dataqueue.clear()
.
A maximum of
dataqueue.CAPACITY
items can be stored at any one time in the data queue.
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
dataqueue.next()
This function removes the next entry from the data queue.
Type
TSP-Link accessible
Affected by
Where saved
Default value
Function Yes
Usage
value
= dataqueue.next()
value
= dataqueue.next(
timeout
)
value
The next entry in the data queue
timeout
The number of seconds to wait for data in the queue
Содержание 2657A
Страница 3: ......