To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This example shows how to send different data types using a single queue by using a variant data type.
Description
This application allows the user to send multiple different data types using a single queue. It works through converting the data to a variant data type in the producer loop and combining this with an enum to specify the data type being stored in the queue. In the consumer loop the enum specifies the case in the case structure where a Variant to Data function is used to convert the data back to its relevant data type. The following screenshot is the front panel of this application showing that you can enqueue a number, string or boolean into the queue.
Requirements
Steps to Implement or Execute Code
Additional Information or References
VI Block Diagram
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.