Exploring Remote Communication Methods (Real-Time Module)

LabVIEW 2017 Real-Time Module Help

Edition Date: March 2017

Part Number: 370622R-01

»View Product Info
Download Help (Windows Only)

You can use high-level software protocols to communicate between VIs running on the RT target and VIs running on other targets, such as the host computer. Each protocol has its advantages and disadvantages. The following list classifies the different communication methods:

  • Network Communication—Used for communication over Ethernet networks.
    • Network Streams
    • Network-Published Shared Variables
    • Time-Triggered Shared Variables
    • TCP
    • UDP
    • VI Server
    • Logos
    • SMTP (send only)
  • Bus Communication—Used for communication over different bus communication ports.
    • Serial
    • CAN
Note  You can use a Modbus I/O server to communicate between devices connected on different types of buses or networks.

Network Communication

This section describes the most common network communication protocols used with the LabVIEW Real-Time Module. Use this information to help you select the right networking protocol(s) for your application.

Network Streams

You can use network streams to stream data or send commands between an RT target and a host computer. A network stream is a lossless, unidirectional, one-to-one communication channel that consists of a writer and a reader endpoint.

Network-Published Shared Variables

You can use network-published shared variables to share data between VIs running on different targets across a network. By enabling the real-time FIFO of a shared variable, you can share data across a network without affecting the determinism of the VIs. However, the transfer of the data across the network is not deterministic. Due to network latency, the most recently written data may not be available to a VI running on a machine across the network. In this case, the VI attempting to read from the network-published shared variable returns the previous value. For data logging applications, you can use timestamps to programmatically ensure that each value is logged once and only once.

Note   You cannot access a time-triggered shared variable using a target-relative Shared Variable node.

Time-Triggered Shared Variables

Control, automation, and simulation applications often require that the most current data be available to VIs across a network. To meet this requirement, time-triggered shared variables transfer data across a closed private network. To use time-triggered shared variables, you must configure RT targets with two Ethernet devices.

TCP

TCP is an industry-standard protocol for communicating over networks. VIs running on the host computer can communicate with RT target VIs using the TCP VIs and functions. However, TCP is non-deterministic, and using TCP communication inside a deterministic VI can affect the determinism of the VI.

The Real-Time Module extends the capabilities of the existing TCP functions to enable communication with networked RT Series devices.

UDP

UDP is a network transmission protocol for transferring data between two locations on a network. UDP is not a connection-based protocol, so the transmitting and receiving computers do not establish a network connection. Because there is no network connection, there is little overhead when transmitting data. However, UDP is non-deterministic, and using UDP communication inside a deterministic VI can affect the determinism of the VI.

When using the UDP VI and functions to send data, the receiving computer must have a read port open before the transmitting computer sends the data. Use the UDP Open function to open a write port and specify the IP address and port of the receiving computer. The data transfer occurs in byte streams of varying lengths called datagrams. Datagrams arrive at the listening port, and the receiving computer buffers and then reads the data.

You can transfer data bidirectionally with UDP. With bidirectional data transfers, both computers specify a read and write port and transmit data back and forth using the specified ports. You can use bidirectional UDP data transfers to send and receive data from a VI on the RT target.

UDP has the ability to perform fast data transmissions. However, UDP cannot guarantee that all datagrams arrive at the receiving computer. Because UDP is not connection-based, you cannot verify the arrival of datagrams. You must ensure that network congestion does not affect the transmission of datagrams. Also, you must read data stored in the data buffer of the receiving computer fast enough to prevent overflow and loss of data.

VI Server

Use VI Server to monitor and control VIs on an RT target. Using VI Server, a LabVIEW VI can invoke RT target VIs remotely. The LabVIEW VI can pass parameter values to and from the RT target VIs, creating a distributed application.

A host VI can invoke only VIs that are already stored on the RT target. The host VI cannot dynamically download LabVIEW VIs to the RT target for use with the VI Server.

One advantage to communicating using the VI Server is that the VI Server allows you to access the functionality of TCP while working within the framework of LabVIEW. However, the VI Server is non-deterministic and using VI Server communication can affect the determinism of the VI.

SMTP Email

Use the SMTP Email VIs to send data from a VI running on the RT target to VIs running on another computer. The SMTP VIs can send email, including attached data and files, using the Simple Mail Transfer Protocol (SMTP). You cannot use the SMTP VIs to receive information.

SMTP is non-deterministic and using SMTP communication inside a deterministic VI can affect the determinism of the VI.

Logos (FieldPoint Only)

You can use Logos to transfer host interface data to and from traditional FieldPoint and Compact FieldPoint Ethernet modules. Ethernet-enabled FieldPoint modules have an embedded Logos Server, which enables reads and writes to the physical I/O modules on the FieldPoint bank from a remote system.

Bus Communication

Serial

Serial communication is the transmission of data between two locations through the serial ports. The Serial VIs and functions provide serial communication support in LabVIEW for communication between RT targets with serial devices and serial instruments or computers that have a serial connection. Serial communication is ideal when transfer data rates are low or for transmitting data over long distances. You must add the NI-Serial RT software on the RT target from NI Measurement & Automation Explorer (MAX). Refer to the Measurement & Automation Explorer Help for information about adding software on an RT target.

Serial communication is non-deterministic and using serial communication inside a deterministic VI can affect the determinism of the VI.

CAN

Controller Area Network (CAN) is a deterministic, multi-drop communication bus standardized as ISO 11898. Using CAN, you can transfer up to 8 data bytes per frame at a rate of up to 1 Mbit per second. You can network multiple RT systems using NI-CAN interface cards and NI-CAN driver software. You must add the NI-CAN RT software on the RT target from MAX. Refer to the Measurement & Automation Explorer Help for information about adding software on an RT target.

Visit ni.com/info and enter the Info Code CANManual to view the NI-CAN Hardware and Software Manual, which contains information about using NI-CAN hardware and software with LabVIEW.

Data Communication Methods Home

WAS THIS ARTICLE HELPFUL?

Not Helpful