System SourceMeter® Instrument Reference Manual Section 7:
2600BS-901-01 Rev. B / May 2013 7-45
dataqueue.add()
This function adds an entry to the data queue.
Type TSP-Link accessible
Affected by Where saved Default value
Usage
result = dataqueue.add(value)
result = dataqueue.add(value, timeout)
The resulting value of
or
based on the success of the function
value
The maximum number of seconds to wait for space in the data queue
Details
You cannot use the timeout value when accessing the data queue from a remote node (you can only use the
timeout value while adding data to the local data queue).
The timeout value is ignored if the data queue is not full.
The dataqueue.add() function returns false:
• If the timeout expires before space is available in the data queue
• If the data queue is full and a timeout value is not specified
If the value is a table, a duplicate of the table and any subtables is made. The duplicate table does not contain
any references to the original table or to any subtables.
Example
dataqueue.add(10)
dataqueue.add(11, 2)
result = dataqueue.add(12, 3)
if result == false then
print("Failed to add 12 to the dataqueue")
end
print("The dataqueue contains:")
while dataqueue.count > 0 do
print(dataqueue.next())
Clear the data queue.
Each line adds one item to the data queue.
Output:
The dataqueue contains:
1.00000e+01
1.10000e+01
1.20000e+01
Also see
dataqueue.CAPACITY (on page 7-46)
dataqueue.clear() (on page 7-46)
dataqueue.count (on page 7-47)
dataqueue.next() (on page 7-48)