Model 2461 Interactive SourceMeter® Instrument Reference Manual Section 8: TSP command reference2461-901-01 A/November 2015 8-47ExampleMaxCount = dataqueue.CAPACITYwhile dataqueue.count < MaxCount dodataqueue.add(1)endprint("There are " .. dataqueue.count.. " items in the data queue")This example fills the data queue until it is fulland prints the number of items in the queue.Output:There are 128 items in the dataqueueAlso seedataqueue.add() (on page 8-45)dataqueue.clear() (on page 8-47)dataqueue.count (on page 8-48)dataqueue.next() (on page 8-48)Using the data queue for real-time communication (on page 3-158)dataqueue.clear()This function clears the data queue.Type TSP-Link accessible Affected by Where saved Default valueFunction YesUsagedataqueue.clear()DetailsThis function forces all dataqueue.add() commands that are in progress to time out and deletes alldata from the data queue.ExampleMaxCount = dataqueue.CAPACITYwhile dataqueue.count < MaxCount dodataqueue.add(1)endprint("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 thenumber of items in the queue. It then clears thequeue and prints the number of items again.Output:There are 128 items in the dataqueueThere are 0 items in the data queueAlso seedataqueue.add() (on page 8-45)dataqueue.CAPACITY (on page 8-46)dataqueue.count (on page 8-48)dataqueue.next() (on page 8-48)Using the data queue for real-time communication (on page 3-158)