The MeasurementLink Support for LabVIEW packages enable measurement developers to quickly create LabVIEW measurements and run them as a service(gRPC). MeasurementLink allows users to interact with measurement services with a LabVIEW UI in InstrumentStudio.
- InstrumentStudio 2023 Q1 or later
- MeasurementLink 2023 Q1 or later
- LabVIEW 2020 SP1 or later
- JKI VI Package Manager 2020.1 or later
- Install a supported version of InstrumentStudio
- Install a supported version of MeasurementLink
- Install a supported version of LabVIEW
- Download and install the MeasurementLink Support for LabVIEW packages in the following order.
ni_lib_labview_grpc_library-x.x.x.x.vip- Requiredni_lib_labview_grpc_servicer-x.x.x.x.vip- Requiredni_measurementlink_service-x.x.x.x.vip- Requiredni_measurementlink_generator-x.x.x.x.vip- Required
-
Create a new LabVIEW project (say Measurement.lvproj) and open it.
-
From the project window, go to
Tools→MeasurementLink→Create Measurement Plug-in...which opens a new measurement creation dialog. -
Add the measurement details in the block diagram of the
Get Measurement Details.viincluding:- display name
- version
- Service Class
-
Add the required controls for the configuration parameters in the
Measurement Configuration.ctlfile. By default, this comes withArray inwhich is a double array. -
Add the required indicators for the output parameters in the
Measurement Results.ctlfile. By default, this comes with theArray outparameter which is a double array. -
Provide the measurement logic in the
Measurement Logic.viblock diagram. The diagram has an input cluster including the configuration parameters and an output cluster containing the output parameters fromMeasurement Configuration.ctlandMeasurement Results.ctl. By default, the logic takes theArray inand sends it directly toArray out. -
Create the user interface in
Measurement UI.viunder the<MeasurementName>.lvlib. The control and indicator names in the user interface should match theMeasurement ConfigurationandMeasurement Results. If the data type and name match, then the data from the controls will be sent to theMeasurement Logic.viand the results will be published to the indicators after the measurement is run. By default, the UI file consists of an 'Array In' control and 'Array Out' indicator.
If your user interface has dependencies that are not available in the LabVIEW runtime, you will have to build the UI into a packed library. For example, you will have to build a packed library if your UI contains VIs from vi.lib or if your UI depends on user created subVIs or controls. The packed library should be located in a directory at the same level asMeasurement Logic.vi. The Keysight 34401A DMM Measurement example demonstrates how to use a packed library user interface.
Note:
- Additional info can be found in the to-do sections in the code, which can be viewed using the
Bookmark Manager. You can open it from theView→Bookmark Managermenu. In this window, you can will find the bookmark term#MeasurementToDo. Double-clicking on the items will take you to the VI locations where changes need to be made for creating your unique measurement service. - Scalars (int, double, uint, sint, string, boolean) and double array are the supported datatypes for the
ConfigurationandOutputparameters of the measurement. - The
Measurement Service Helpers.lvlibincluded with the<MeasurementName>.lvlibcontains VIs to help with common tasks such as session management and interacting with MeasurementLink services.
To run the measurement service, follow the steps below
-
Open
<MeasurementName>.lvprojthat contains the Measurement Service library. -
Start the discovery service if the measurement is to be used in InstrumentStudio.
-
Run the
Run Service.vifrom<MeasurementName>.lvlibto start the measurement service. A new window will appear, which provides basic information about the running service. -
To manually stop the service, click on the
STOPbutton on the window that appeared when the service was started.
The Source\Example Measurements directory contains example measurement services. See the README.md file there for more information.
For using LabVIEW measurements, install a supported version of MeasurementLink
To interact with a measurement in InstrumentStudio, follow the steps below:
-
Once all the packages are installed, open InstrumentStudio and click on
Manual Layout. -
Choose the desired measurement and create a panel.
-
The layout will be populated with the UI created for the measurement, containing the provided parameters.
-
Provide the required configurations and click
RUNto run the measurement.
A Build Specification is included with the generated measurement service. To create an executable for the measurement service, right-click the <MeasurementName> build specification and select Build.









