How To Use STM To Set UP The Real-Time Target to Run Application To Communicate With Different Host Applications?

Updated Mar 24, 2025

Environment

Other

I have a customer who wants to set up a system that includes a host PC and a real-time target. The host PC can run different applications to communicate and transfer data with the target at the same time. How can we realize it by using the STM library?

The use of STM

You can install the latest version of the STM library directly from VI Package Manager. Older versions of the STM library for use in existing applications are available in the Reference Design Portal.

Please post your questions, comments and feedback about the STM library in the STM discussion forum.

The theory of operations for STM

  • Easily packages and parses data
  • Hides the transport layer (TCP, UDP, etc.) implementation details
  • Minimizes network traffic by sending data only when it is needed
  • Minimizes impact in the overall overhead and throughput
  • Lends itself to communication with environments other than LabVIEW - C, C++, etc.

First, You will need to download and install the STM in the VI package manager that suits your Labview versions.

Second, you will need to set up the target as a server or listener that listens to the ports you want to establish the connection with from the host. In this case, we are using 55555 for example and if you want to establish connections with different applications in the host, you will need to create multiple ports for connections.

Third, you will need to set up the host application VI to open the TCP port connections and read the data you need from the target application. The methodology is the same for different applications and read/write.

 

Here is how the example code applications run to read data from the target simultaneously.