90 likes | 211 Views
Mind Your P’s and Queues. James Hannah Test Architect, CLA. What is a Queue?. A mechanism to communicate data between sections of code without using wires. Unlike Notifier Operations, Queue Operations buffer data.
E N D
Mind Your P’s and Queues James Hannah Test Architect, CLA
What is a Queue? • A mechanism to communicate data between sections of code without using wires • Unlike Notifier Operations, Queue Operations buffer data • Queues are lossless because they buffer data. Default behavior is like a FIFO. • Can contain any LabVIEW data type
Queue Operations • Adds an element to the back of a queue • Adds an element to the front of a queue • Obtain Queue returns a reference to a queue • Determines type of data in the queue • Removes an element in the front of a queue and returns the element. Has a timeout feature. • Returns information about a queue, such as the number of elements currently in the queue • Removes all elements from a queue and returns the elements as an array. • Releases a reference to a queue
Design Patterns that employ Queues • Producer/Consumer (Data) • Producer/Consumer (Events)
Combining Polymorphism and Queues • All Obtain Queue VIs made into a polymorphic VI that adapts to type of queue.
Adding User Events • Dynamically registers events handled by structure • Sends event and event data to event structure • Returns a reference (refnum) to a user event • Determines type of data associated with the event • Unregisters all events associated with an event registration refnum. • Releases a user event refnum. Any event structures registered for this user event no longer receive the event.
Putting it all Together Using Dedicated Loops
For Further Information, contact us at… www.ssprog.com | solution-sources-programming-ssp- Twitter: @SolutionSources |
SSP is Hiring • LabVIEW and TestStand • Software Developer • Certification Required • Working knowledge of test equipment • Proven debug and problem solving skills • Help quote new test station projects • Functional Test Hardware Group Leader • Select and integrate test hardware • Design test fixtures and custom PCBs • Debug, verify, and install test stations • Help quote new test station projects