Skip to content

LabVIEW client, template, and examples for MeasurementLink

License

Notifications You must be signed in to change notification settings

ghas-results/measurementlink-labview

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MeasurementLink™ Support for LabVIEW


Introduction

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.


Software support

  • InstrumentStudio 2023 Q1 or later
  • MeasurementLink 2023 Q1 or later
  • LabVIEW 2020 SP1 or later
    • JKI VI Package Manager 2020.1 or later

Installation

  1. Install a supported version of InstrumentStudio
  2. Install a supported version of MeasurementLink
  3. Install a supported version of LabVIEW
  4. Download and install the MeasurementLink Support for LabVIEW packages in the following order.
    1. ni_lib_labview_grpc_library-x.x.x.x.vip - Required
    2. ni_lib_labview_grpc_servicer-x.x.x.x.vip - Required
    3. ni_measurementlink_service-x.x.x.x.vip - Required
    4. ni_measurementlink_generator-x.x.x.x.vip - Required

Developing a LabVIEW measurement

  1. Create a new LabVIEW project (say Measurement.lvproj) and open it.

  2. From the project window, go to ToolsMeasurementLinkCreate Measurement Plug-in... which opens a new measurement creation dialog.

    • In the new dialog, enter the Measurement Plug-in Name that you would like to give to the measurement and click Create Measurement Plug-in.

      New measurement dialog

    • This will create a new measurement service library and a helper library that can be used to develop a measurement service.

      Measurement library files

  3. Add the measurement details in the block diagram of the Get Measurement Details.vi including:

    • display name
    • version
    • Service Class

    Get Measurement Details VI

  4. Add the required controls for the configuration parameters in the Measurement Configuration.ctl file. By default, this comes with Array in which is a double array.

    Measurement Configurations ctl

  5. Add the required indicators for the output parameters in the Measurement Results.ctl file. By default, this comes with the Array out parameter which is a double array.

    Measurement Results ctl

  6. Provide the measurement logic in the Measurement Logic.vi block diagram. The diagram has an input cluster including the configuration parameters and an output cluster containing the output parameters from Measurement Configuration.ctl and Measurement Results.ctl. By default, the logic takes the Array in and sends it directly to Array out.

    Measurement Logic VI

  7. Create the user interface in Measurement UI.vi under the <MeasurementName>.lvlib. The control and indicator names in the user interface should match the Measurement Configuration and Measurement Results. If the data type and name match, then the data from the controls will be sent to the Measurement Logic.vi and 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 as Measurement Logic.vi. The Keysight 34401A DMM Measurement example demonstrates how to use a packed library user interface.

    Measurement UI

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 the ViewBookmark Manager menu. 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 Configuration and Output parameters of the measurement.
  • The Measurement Service Helpers.lvlib included with the <MeasurementName>.lvlib contains VIs to help with common tasks such as session management and interacting with MeasurementLink services.

Running a LabVIEW measurement

To run the measurement service, follow the steps below

  1. Open <MeasurementName>.lvproj that contains the Measurement Service library.

  2. Start the discovery service if the measurement is to be used in InstrumentStudio.

  3. Run the Run Service.vi from <MeasurementName>.lvlib to start the measurement service. A new window will appear, which provides basic information about the running service.

    Run Service VI

  4. To manually stop the service, click on the STOP button on the window that appeared when the service was started.


Examples

The Source\Example Measurements directory contains example measurement services. See the README.md file there for more information.


Using a measurement in InstrumentStudio

For using LabVIEW measurements, install a supported version of MeasurementLink

To interact with a measurement in InstrumentStudio, follow the steps below:

  1. Once all the packages are installed, open InstrumentStudio and click on Manual Layout.

  2. Choose the desired measurement and create a panel.

    Selecting a LabVIEW measurement

  3. The layout will be populated with the UI created for the measurement, containing the provided parameters.

  4. Provide the required configurations and click RUN to run the measurement.

    Running the measurement


Creating a LabVIEW executable for static registration

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.

About

LabVIEW client, template, and examples for MeasurementLink

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • LabVIEW 99.9%
  • Other 0.1%