Qbus Messages

NI InsightCM™ SDK Help

Edition Date: July 2017

Part Number: 375191C-01

»View Product Info
Download Help (Windows Only)

Parent Topic: Communication Methods within Device Code

Each Qbus message consists of two parts: its name/type and its value. The Qbus API stores message values as variant data. Because message values can be of many data types, such as strings, scalar numerics, and arrays of various data types, Qbus must handle data of many different types in a generic way. The variant data type, a generic container for all other types of data in LabVIEW, is one solution for these situations.

Message Types

The Qbus API provides subVIs that allow processes to send two types of messages:

  • Broadcast messages—Available to any process. The sender does not specify a recipient for a broadcast message. To receive a specific type of broadcast message, each process registers for the messages it desires by name.
  • Routed messages—Sent only to a specific, named process. You might send a routed message when multiple processes register for a particular message name, but in a specific situation, you want only one specific process to receive and handle the message.

Message Format

The format of a Qbus message consists of a name of type string and a body of type variant. For broadcast messages, you can use SendBroadcastMessage.vi with any service. For routed messages, use SendRoutedMessage.vi and the name of a specific service to route the message to. Wiring the body of any data type coerces it to the variant data type. For code that consumes the message, write a specific parsing VI to cast the body back to its original type for that message name.

For example, in the NI-developed Data Event Creator process, the DataEventCreator.RegisterTrend case calls RegisterTrendPointsRoutedMessage_Parse.vi, which uses Variant to Data to cast the variant in the message to the expected cluster type for that message. Routed messages follow the same pattern. An example of this pattern is available in the Initialize case of the NI-developed VibrationAnalysis process.

Related Information

Sending a Message to Another Process

Handling a Qbus Message


Not Helpful