Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Communication Methods within Device Code

NI InsightCM™ SDK Help

Edition Date: July 2017

Part Number: 375191C-01

»View Product Info
Download Help (Windows Only)

Parent Topic: Device Software Fundamentals

The NI InsightCM SDK provides APIs and examples for implementing several methods of data communication in the device software. The communication method to use depends on the senders and recipients of the data, as well as the type of data:

Communication with NI InsightCM Server

All communication between the device software and NI InsightCM Server consists of AMQP messages sent and received by the NI-developed Server Comm process. The following list provides examples of communication that takes place between the device and server:

  • File Manager process transfers data to be stored on the server.
  • Server sends new configuration files to the device, and the Controller process reboots.
  • End users force trigger the Data Event Creator process to transfer new data.

When the device software initiates communication, the following process takes place:

  1. When any process needs to send data to a service running in NI InsightCM Server, the device sends the data to the Server Comm process via Qbus message.
  2. The Server Comm process is designed to handle these Qbus messages by converting them to a particular type of AMQP message
  3. The Server Comm process transfers messages via the TCP connection between device and server.

A similar process occurs when NI InsightCM Server initiates communication:

  1. When a service needs to communicate with a process, it send an AMQP message to the Server Comm process
  2. The Server Comm process converts AMQP messages to Qbus messages
  3. The Server Comm process routes the messages to the appropriate process.

Communication between Processes

The SDK provides several features for communicating data to other processes.

Use Case Example Communication Method Advantage
Sending a message from one process to another specific process when it is important to avoid overwriting or losing any value.
  • The FPGA BitfileManager process sends a message to the FPGA Acquisition process to indicate the device finished downloading the bitfile.
  • Each process sends a message to the Controller process to indicate it is configured and ready to operate.
Routed Qbus messages
Sending a message to any process in the device software that subscribes to that type of message. It is important to avoid overwriting or losing any value. When a device downloads an FPGA bitfile, it notifies any subscribed processes so they can begin reading and writing values in the bitfile. Broadcast Qbus messages This is useful when multiple processes consume the same message or when you want to maintain the ability for newly developed processes to receive a specific notification in the future.
Writing the value of a property that any other process can read on demand. One process writes the chassis temperature, while a second process periodically reads the latest value and publishes it as a tag. Point Value Maps This is useful when you must store a value in memory that readers and writers can access with minimal or no flow control.
Handing off data to the next process in an ordered list of processes via a standard interface. The Vibration Analysis process calculates features and spectral bands from acquired waveforms, and then passes those values to the next process. Trigger process to be evaluated for operating state changes and data collection triggers. Dataflow Script API This is useful for maintaining the ability to change the order in which processes operate on a data set.

Communication within a Process

The process architecture is designed to transfer information from one iteration of the process to the next while it executes, including between its message-handling subdiagrams.

Use Case Example Communication Method
Transferring data and state information between iterations of the process While Loop, including between message-handling subdiagrams.
  • A subdiagram handles the ServerComm.ConnectionStatus Qbus message by storing the status for access by other subdiagrams that require an online connection to carry out operations.
  • A data acquisition process builds a collection of acquisition data across iterations until the data reaches a desired size.
Configuration cluster
Directing the process to execute a specific subdiagram during its next iteration instead of reading a message from its message queue. After a subdiagram in the Scan Engine process handles a message receives a reference to the FPGA bitfile running on the device, it sets a priority action that ensures it initializes the NI Scan Engine software during the next iteration. Priority-action shift register
Executing a specific subdiagram one or more times after a time interval elapses, similar to a callback. You can optionally transfer data along with timer event that is returned with the timer-event message. The Scan Engine process registers a timer event to perform its Acquire action once per second. Registering a timer event

 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit