Table Of Contents

Sending Messages Between Systems

Last Modified: November 15, 2017

Communicate between systems with strings by publishing messages to topics. Messages support both synchronous and asynchronous reads.

You can find the Messages API on the Data Communication palette in LabVIEW. Some example use cases for Messages include the following:
  • Sending a warning message to all managed systems
  • Sending status updates from one system to another
  • Sending a keyword to trigger an event among one or more managed systems
The following procedure describes a generic workflow between two systems using Messages in LabVIEW. You can send a message from one system to any number of systems.
  1. On both the sender and the receiver, use the Open VI to open a synchronous or asynchronous messaging connection.
  2. On the receiver, subscribe to a topic by specifying a string with the Subscribe VI. The message session will receive a copy of any message published to this topic.
  3. On the sender, send a message using the Publish VI.
    1. Enter a string in the message input.

      To send other data types and structures as a message, flatten them to JSON.

    2. Enter the topic string in the topic input.
    All subscribers to the topic will receive a copy of the published message.
  4. If you want to stop receiving messages published to a certain topic, use the Unsubscribe VI on the receiver.
  5. On both systems, use the Close VI to close the messaging connection.

Recently Viewed Topics