Send Messages Between LabVIEW Real-Time Target and LabWindows/CVI Host UI

Updated Apr 7, 2023

Reported In

Software

  • LabVIEW Real-Time Module
  • LabWindows/CVI

Issue Details

I want to send lossless messages between my LabVIEW Real-Time Target and my computer (Human Machine Interface (HMI)) that is running a LabWindows/CVI built host application. How can I do this?

Solution

For Real-Time to HMI communication, you can utilize the approaches outlined in Section 6 of the Understanding Communication Options Between the Windows HMI, RT Process, and FPGA document. Specifically for lossless communication of messages, you can follow one of two approaches: 
  1. TCP/IP Packets This approach can be used for simple messages, however, you will need to implement some of the packet decoding. 
  2. Network Streams : You can open a network stream endpoint in the LabVIEW Real-Time Application, and create the other endpoint in your LabWindows/CVI application using the CNS library . This abstracts some of the packet decoding that is needing when using plain TCP/IP communication, and automatically buffers messages. See the LabVIEW example Simple Network Streams and the LabWindows/CVI example cnsSimple. 

Additional Information

If you are using the Simple Messaging (STM) Communication Library for LabVIEW to send messages from the LabVIEW Real-Time target, it is recommended to use Network Streams between LabVIEW Real-Time and LabWindows/CVI. However, if you would like to continue to use the STM library, you can build your LabWindows/CVI interface for the STM library from the NI Community Client Implementation example. For data types and messages being sent with the library that are not currently implemented in the example, you can add your own custom code and use the Flattened Data help  for more information on the data format.