I/O Plug-Ins Overview

All built I/O plug-ins consist of two components: an XML file and a plug-in (.ppl) file. Some built plug-ins may contain additional files.

You can adjust the appearance of a plug-in using the Configuration Editor by changing the icon associated with it. To update a plug-in icon, create a 40x40 pixel PNG file named PluginIcon.png and upload it to the same directory where the XML file for your plug-in is located. To reset the cached plug-in image, you must then temporarily move the plug-in to a different folder, start the Configuration Editor, close the Configuration Editor, move the plug-in back to the original folder, and then start the Configuration Editor again. If no PluginIcon.png file exists, the plug-in displays a default icon.

I/O plug-ins run inside of the Data Record AD data processing engine. By default, each plug-in has a single input terminal that can accept a single-wire connection, but you can adjust this in the Configuration Editor. The number of output terminals per plug-in is user defined. A configuration control (configuration.ctl) file is also included in the I/O plug-in template, and the contents of this file are exposed to the Configuration Editor through the plug-in descriptor XML file next to each built plug-in. Each plug-in goes through its own state machine, where each state is a VI that is built into the I/O plug-in template. You can customize the VIs in the States folder of the plug-in class to adjust the behavior of your plug-in. The parameters are read from the system configuration file and loaded during the read parameters state.

Plug-In States

Figure 1. I/O Plug-In States

1378

  • Initialize State—The Initialize VI is called only once per session, before the plug-in loads its configuration. You can set timing and synchronization options within this state if you do not intend to expose those options as a configuration parameter.
  • Read Parameters State—The Read Parameters VI loads the configuration parameters for the plug-in. In most cases, you do not need to edit this VI.
  • Configure Session State—The Configure Session VI configures sessions and references that are used by your plug-in. This VI is called only once per session, after the plug-in loads its configuration. Call the appropriate initialization VIs to open and store any configuration parameter references that are needed during the session. If the plug-in needs information from the configuration file to determine the timing parameters to use, set those parameters in this VI rather than in the Initialize VI.
  • Handle Message State—The Handle Message VI receives and processes out-of-band messages from the data processing engine. gRPC messages sent to the datalogger plug-in topic are forwarded to this VI. By default, this VI acknowledges message receipt and echoes the message.
  • Process State—The Process VI enables your plug-in to read incoming data, perform required actions, and send data to the data processing engine for other plug-ins to receive. This VI is called throughout the session as frequently as specified in the timing parameters. Ensure any data that needs to persist between calls to the Process VI is stored in the class private data of the plug-in. The plug-in exits the process loop when the application shuts down or when an error is thrown within the Process VI.
  • Cleanup Session State—The Cleanup Session VI closes any references opened during the Configure Session state and flushes any buffers that the plug-in used. If the plug-in is restarting, this state is followed by the Configure Session state. If the plug-in is shutting down, this state is followed by the Finalize state.
  • Finalize State—The Finalize VI is called as the plug-in shuts down. You can close any global resources or sessions during this state.
For more information about plug-in states, refer to the Data Record AD GitHub Repository at https://www.ni.com/r/datarecord-devguide.

Plug-In Timing Parameters

You can select from several different timing options:
  • Periodic—Specifies a period of time, in milliseconds, for the process loop to run.
  • Immediate—Runs the process loop as quickly as possible with no added delay between calls. This is useful for data source plug-ins when execution is blocked by a call to hardware.
  • On Data Ready—Runs one iteration of the process loop every time data arrives on the input terminal.
For more information about plug-in timing parameters, refer to the Data Record AD GitHub Repository at https://www.ni.com/r/datarecord-devguide.

I/O Plug-In Timing and Synchronization

The ADAS utilities library exposes rendezvous VIs and sync domain VIs that you can use to enable hardware synchronization and t0 time domain adjustments. Rendezvous VIs and sync domain VIs are located in the following file location: <LabVIEW 2020>\vi.lib\ADAS Record\Utilities\Sync Tools.

A rendezvous ensures that multiple plug-ins wait at a certain execution point before proceeding. Each plug-in that reaches the rendezvous waits until all plug-ins registered for that particular rendezvous are waiting, at which point all plug-ins proceed with execution.

You can use sync domain VIs to share a t0 value between multiple plug-ins. Each plug-in can belong to only one sync domain.