NI Remote-Ability: Accessing NI Instrumentation with gRPC

Overview

NI Remote-Ability allows remote interaction with NI’s instrumentation, using gRPC Remote Procedure Calls (gRPC) technology. NI has invested in ensuring that our products work with gRPC, so our customers can remotely interact with NI products to take high-quality, low-latency measurements. Using NI Remote-Ability, engineers can leverage existing test workflows with flexibility.

Contents

What Is NI Remote-Ability?

NI Software Remote-Ability is the ability to remotely interact with NI hardware and services to take high-quality, low-latency measurements. NI Software Remote-Ability uses predefined stand-alone applications and/or APIs and/or commands in a holistic and OS-agnostic way and leverages a client/server architecture. 

NI Remote-Ability uses gRPC under the hood. Using a gRPC-based server provides you with the possibility to access and control test and measurement equipment from many different programming environments, platforms, and operating systems. 

gRPC uses Protocol buffers (Proto3) as its message interchange format. The following figure shows how proto requests and responses are sent between the gRPC server and the stubs. 

Figure 1: Requests and Responses from the gRPC Server

NI Remote-Ability is supported on Windows, Linux, and Mac, for a range of programming languages. For a complete list of supported languages and their operating systems, refer to our gRPC Support Resources.

What Is gRPC?

gRPC is an open-source remote procedure call (RPC) framework that can run anywhere. It enables client and server applications to communicate transparently and makes it easier to build connected systems remotely.

In gRPC, a client application can directly call a method on a server application on a different machine as if it were a local object, making it easier for you to create distributed applications and services. On the server side, the server implements this interface and runs a gRPC server to handle client calls. On the client side, the client has a stub—referred to as just a client in some languages—that provides the same methods as the server.

A main aspect of using gRPC is that it is OS- and language-agnostic on the client side, provides you with flexibility, and can be adapted to the current OS or programming languages already being used on your project.

NI Remote-Ability Joins Other Prominent Companies Using gRPC

By using gRPC for NI Remote-Ability, NI is joining other large companies such as Google, Netflix, and Square. gRPC has strong capabilities that other options like RPyC, SCPI, and HiSLIP lack:

  • Very strong active development and community, including backing from Google 
  • Good default performance and features
  • Well-defined interface definition language: Protobuf
  • Support for many languages and OSs, especially if you include unofficial/third-party client support
  • Works well in a setup where language- and OS-agnostic remote connection is required

 

Authentication / Authorization in gRPC

NI Remote-Ability uses gRPC’s default authorization mechanisms. The connection can be secured by Server-Side TLS or mutual TLS (Zero Trust), which ensures communication is encrypted and the client/server can be trusted. You can update the server to include custom authorization by integrating with an authorization server.

Expected NI Remote-Ability Performance

Using NI Remote-Ability is a way to help ensure you keep latency low when making high-quality measurements. The following example shows performance benchmarks while reading an analog input voltage from a simulated cDAQ-9179 chassis with an NI-9207 C Series module.

gRPC Performance with Streaming

Server streaming data to client:

  • 200,000 doubles per message streamed from server
  • Default configuration with Protobuf
  • Insecure credentials
  • One client connection
  • 1 Gb Ethernet through switch

Linux localhost

  • 4 GB/s single stream
  • 8 GB/s with multiple streams
  • Baseline: Linux localhost raw sockets: approximately 10 GB/s 

Windows 10 localhost: 4 GB/s1

Linux to Linux: 11 MB/s

  • 93% of theoretical max 

Thunderbolt 3 Link Local Network

  • Windows client, Linux Server: 1.2 GB/s
  • Linux client, Linux server: 1.6 GB/s
  • Linux over SSH: 850 MB/s

1 Be aware of CISO AMP

gRPC Performance with NI-DAQmx

NI-DAQmx with a simulated cDAQ-9179 chassis and NI-9207 modules:

  • C++ app direct NI-DAQmx calls: 121.6 ms
  • gRPC windows client, localhost server: 121.9 ms
  • gRPC Linux client over network (1 Gb) not direct connect: 123.9 ms

As seen in these benchmarks, the gRPC calls are comparable to native driver calls and have minimum latency. With gRPC, NI customers can remotely interact with NI products to take high-quality, low-latency measurements and can leverage existing test workflows.