NI RFmx API Differences - ni/grpc-device GitHub Wiki

RFmx API Differences

The following is a list of general differences between the NI-RFmx C API and the gRPC API provided by grpc-device. These differences all affect all RFmx services.

  • nidevice_grpc.Session inputs called instrumentHandle in the C API are called instrument in the gRPC API. handleOut outputs from Initialize methods are also called instrument.
  • Unlike the C API, the RFmx gRPC API only supports generic functions for getting and setting attributes. You can see a sample of in this Python example that uses SetAttributeString().
  • All Split Fetch methods are not included in the grpc-device API.
  • See also: General API Differences

Error reporting

As with the C API the GetError method can be used to get the latest detailed error message for a given instrument session. However, this method does not work reliably when called without an instrument session because grpc-device does not handle all request on the same thread. For error from Initialize methods, there is no instrument session to pass to GetError. The error_message, if any, is included in the InitializeResponse.

Session management

In the RFmx C API, multiple calls to Initialize with the same resource_name will return the same niRFmxInstrHandle and increase the ref count. In the the gRPC API, each call will return a different nidevice_grpc.Session that maps to the same underlying niRFmxInstrHandle. Otherwise the behavior is the same, and each nidevice_grpc.Session must be closed with the corresponding Close method or ResetServer.

Cross-driver sessions

RFmx has several methods that access sessions from NI-RFSA.

These methods accept nidevice_grpc.Sessions from the gRPC RFSA service:

These methods return nidevice_grpc.Sessions that can be used with the gRPC RFSA service:

The sessions returned by GetNIRFSASession/Array methods will be closed when the initiating RFmx session is closed. They should not be closed before closing the RFmx session.

A name can be provided for the NI RFSA sessions returned by GetNIRFSASession/Array, using the session_name or session_names field in the Request.

⚠️ **GitHub.com Fallback** ⚠️