Home
Quickstart Guide
Introduction RIO Academic RIO Application examples Your first RT app Your first FPGA app
Real-Time
Basic procedures System admin File system I/O monitor System controller architecture Timed loops Inter-process communication RT/Host communication RT/FPGA communication FPGA personalities Interrupts Datalogger (file I/O)
FPGA
Design flow Simulation Inter-process communication RT/host communication Derived clock domain IP blocks FPGA personality
Networking
Get connected Email Web services UDP TCP IP addresses
Site Map
Guides Code examples Procedures Tags LabVIEW block diagram elements Targets Communications All pages
Glossary How to use About
RIO Developer Essentials Guide for Academia
RT code example

Queued message handler with multiple process loops

The queued message handler contains multiple process loops operating independently and in parallel that communicate with each other by sending messages through queues. Each process is a well-defined task implemented by the "Queued State Machine" design pattern. Breaking up the system into self-contained tasks greatly simplifies the design of complex systems.

LabVIEW RT block diagram snippet: System Manager and Code Validator message-handling loops

Use cases

Features

See the complete Home Security System project based on the “Queued Message Handler” pattern.

Keep in mind

Example code

LabVIEW block diagram elements

Locate these elements with "Quick Drop" (press Ctrl+Space and start typing the name); click on an icon to see more sample code that uses that element:

Obtain Queue
Enqueue Element
Dequeue Element
Release Queue
Feedback Node
Error Ring

Expected results

https://youtu.be/Ni95t8DPrSk (2:45)

Developer walk-through

https://youtu.be/Ycu2UDj7MEQ (7:03)

Outline

  1. Effective LabVIEW Programming (http://www.ntspress.com/publications/effective-labview-programming/)
    An excellent textbook by Dr. Thomas J. Bress covering all aspects of system design; Chapter 20 describes the "Queued State Machine with Arguments" in detail. Download all of the code examples from this textbook: follow the link above, select "User Resources", and then "All VIs".
  2. The LabVIEW Style Book (https://www.pearson.com/us/higher-education/program/Blume-Lab-VIEW-Style-Book-The/PGM219404.html)
    This comprehensive textbook by Peter A. Blume lays out everything you need to know about best practices for LabVIEW system design. Chapter 8 describes the "Queued Message Handler" in detail.