Creating Dataplugin Using LabVIEW Dataplugin SDK

Updated Apr 9, 2024

Environment

Software

  • LabVIEW DataPlugin SDK 2020
  • LabVIEW 2020
  • LabVIEW Professional

A dataplugin is encapsulated code that understands how to read and to interpret the data contained in a specific data file format by mapping it to the TDM data model. The TDM data 
model arranges the data in root element, channel groups, and channels. The dataplugin can help read specific data into NI data management software such as DIAdem, DataFinder, SystemLink, etc.
Dataplugins can be created in DIAdem using VBScript or Python, or in LabVIEW using the LabVIEW DataPlugin SDK. This article explains how to use the LabVIEW DataPlugin SDK to create dataplugin in LabVIEW.

There are two types of LabVIEW DataPlugins, One-Shot and On-Demand. You need to choose between implementing a One-Shot or an On-Demand DataPlugin based on the structure of the data file and your level of LabVIEW programming experience, for more information on each type, check LabVIEW DataPlugin SDK API Reference manual or the LV_DataPlugin_SDK.pdf installed with LabVIEW DataPlugin SDK.

Development environment setup

Download and install LabVIEW 2020 and the LabVIEW DataPlugin SDK 2020. If you want to use the data plug-in with 64-bit software such as DIAdem or SystemLink, you need to develop the data plug-in with the 64-bit version of LabVIEW.

If you installed the LabVIEW DataPlugin SDK 2020 with the default settings, you can check it in the manual (LV_DataPlugin_SDK.pdf) in the following folder.
C:\Program Files\National Instruments\LabVIEW 2020\manuals

The sample programs shipped with LabVIEW DataPlugin SDk will be installed in the following folder.
C:\Program Files\National Instruments\LabVIEW 2020\examples\File IO\DataPlugins

This example uses the onshot dataplugin sample program.
C:\Program Files\National Instruments\LabVIEW 2020\examples\File IO\DataPlugins\spreadsheetoneshot
 

Creating a data plug-in in LabVIEW

1. Read data and check processing contents by dataplugin
Open Spreadsheet DataPlugin one shot.lvproj,  and check Your Code Here.vi, to see how data is processed using this dataplugin.
  • To create a onshot-type dataplugin, first create a copy of the entire Spreadsheet DataPlugin one shot project and rename it. 
  • Edit the files inside Adapt this to your file format project folder (this folder contains your actual file-format-specific source code to read the data from the particular data file that your 
    DataPlugin supports)  
001DataPluginSample.png

2. Dataplugin testing
The Create Test Data File.vi and Create DataPlugin Output File.vi included in For testing project folder can be used to check the processing contents specified in Your Code Here VI. 
 
02test.png

3. Build DLL and dataplugin installer
Build Specifications includes Build Plugin-DLL for NI-USI (dataplugin shared library, DLL) and Build Installer for Plugin-DLL (dataplugin installer), which are pre-configured.
  • Edit the Target filename of the DataPlugin DLL to better reflect the name of your particular DataPlugin. 
  • Build the DLL.
010DLL.png
  • Change the installer Product Information to reflect your dataplugin properties, especially the Product Name
011buildins.png
  • From the Version information tab of the installer properties, click on Generate button to generate a new Upgrade Code. This will prevent the new installer from replacing the preinstalled dataplugin with same name. for more infprmation on installer version information check Version Information in the build menu. The Upgrade Code is used by Windows to identify the installer version. If you want to upgrade the installer, do not generate a new upgrade code.

012upgradecode.png
  • Build the installer


4. Installing the dataplugin
Use the installer's setup.exe, to install the dataplugin. After installation has complete, Register LabVIEW DataPlugin.exe  automatically run and your dataplugin will be registered in DIAdem. Your installed dataplugin should appear in NI Package Manager's INSTALLED tab.
sdkinstall.PNG

Check this article  to learn how to register measurement data in the database using dataplugin with SystemLink.

Next Steps

How to create a dataplugin in VBScript How to update the dataplugin and change the meta information