Example Code

FIFO Color Coded Message Queue Using LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

This VI implements a color-coded FIFO (First In First Out) Message Queue using array functions.

 

Description

The queue is actually an array of clusters. Each cluster contains a color box indicator and a string containing user-defined information.The queue is populated until it reaches a user-specified maximum queue size, and then acts as a FIFO after that (an element is added at the beginning of the array, and deleted from the end).This example could be used to return specific messages to the user over the course of a test based on specific input conditions.Integration of an event structure to add a message to the queue only upon specific event occurrences would also increase the usefulness of this code in certain situations.

 

Requirements

Software:

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

1. Run the VI.

2. Adjust "message" and follow the "Message Queue" indicator.

3. Adjust the "milliseconds to wait" control to control execution speed.

 

Additional Information or Resources

 

2012snip.png

 

 

 

**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.

Comments
Todd S.
NI Employee (retired)
on

Please rename your attachment to include the LabVIEW version ("_lvXX.vi" would be fine).

Todd S.
LabVIEW Community Manager
National Instruments