LabVIEW Development Best Practices Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

Measurement Abstraction Plugin Framework with Optional TestStand Interface

Author: Elijah Kerry, CLA

Last update: May 19th, 2018 (NIWeek 2018)

 

Picture1.pngOverview of the Measurement Abstraction Framework

The attached code serves as a reference architecture for the core architecture of large-scale test and measurement systems, especially long-running tests that are commonly associated with the characterization and validation of a physical system. 

 

The Measurement Abstraction Framework demonstrates solutions that address the following common requirements:

  1. Hardware Abstraction Layer(s): The de-coupling of hardware and instrumentation through a class interface that allows tests to be easily reconfigured to utilize different devices or vendors without modifying test code
  2. Measurement Abstraction Layer(s): The ability to change and override the default behavior and display of a measurement based on a class interface without modifying test code
  3. Channel and DUT Abstraction: The ability to map IO for a specific device to sensors or a DUT in a way that can be stored and referenced without specific knowledge of the device in use
  4. Factory patterns for plugins: Dynamic loading of new capabilities and functionality without modifying or even restarting the main framework
  5. Simplified test definition: How to enable the creation of tests by users who are not experts on the framework or advanced programming concepts like OOP
  6. Logging heterogenous data: How to stream data from multiple devices at multiple rates in a way that can easily be correlated and analyzed offline
  7. Storing/aggregating data in a central location: How to upload the data from tests to NI SystemLink for visualization and offline analysis
  8. Asynchronous actors: Usage of Actor Framework for a highly asynchronous system that allows multiple sub-systems to communicate while acting independently 
  9. Configuration storage: how to store device and measurement configuration to disk for later reference, as well as how to pass this information to TestStand
  10. Simplification of TestStand: simplify test definition in TestStand through configuration-based workflows that employ custom step types
  11. Reusable across validation or production: the framework is designed to execute the same measurements and devices purely from LabVIEW or they can be sequenced and the channel names can be referenced from TestStand tests
  12. Remote execution of tests on RT targets: How to sequence the execution of tests running on a Linux Real-Time target from a Window Host running TestStand. Note: this functionality was available in previous versions but is not in the 5.3 release yet. It will be re-added after NIWeek 

Example Overview

Version 5.0 has been used to build an EV Powertrain Validation test demonstration, which will appear on the Expo floor of NIWeek, as well as various locations around then world. The attached code includes the device plugins that were used for this particular application. Once installed, it can be run, but will almost certainly generate an error unless you happen to have the same hardware at your disposal. The primary reason these were included is to serve as helpful examples for how driver plugins should be written.

 

To run the example without hardware, we recommend simulating one or more DAQ devices for use with the Standard Measurement.

 

Setup and Installation

  1. Written and designed for LabVIEW 2017 SP1. Will be tested against LabVIEW 2018 after NIWeek
  2. The attached VIPC contains all of the necessary libraries required to run the framework, as well as one sample measurement plugin and device plugin examples for: DAQ, CAN, RMX Power Supply, Anderson Load, and a Thermotron thermal chamber. 
  3. One installed, navigate in VIPM to the TestStand Interface for MAF package and click "Show Examples"
  4. Open the project in that directory and launch and run "TestStand Interface Test Harness.vi." Clicking the buttons in order will allow you to configure the controller, the measurement, apply system properties to the file and ultimately launch a and long a measurement
  5. Once this is working, launch the sample TestStand sequence file to call then framework from TestStand using custom step types

 

Extending or Customizing Measurements

The example measurement is installed by default to C:\ProgramData\Measurements

 

The included example only features one measurement, "Standard Measurement," which his a very basic implementation. However, it is possible to instantiate N instances of this type of measurement, which should cover most basic use-cases.

Reasons to override this measurement include:

  1. A custom measurement display is required when it is running
  2. A different interface is required for specific devices (all acquisition in this example uses "read N samples from N channels" for acquisition and "write N samples for N channels" for generation
  3. A specific measurement or enrichment operation is desired to be added to the data as it is acquired and included within the log
  4. A safety-critical measurement needs to be performed on the data (perhaps on an RT system) that is responsible for closed-loop control (ie: safe shut down)
  5. Measurement requires that a specific type of device be specified, which can be defined by overriding the method to request hardware

Extending or Customizing Hardware

The example measurement is installed by default to C:\ProgramData\Hardware

 

Unlike previous versions, all devices inherit directly from the base Hardware.lvclass object. The measurement device implements the acquisition and generation interfaces. Device plugins wrap specific drivers and are called used a basic "Configure --> Acquire --> Generate --> Measure --> Repeat until Close" sequence. A device can specify specific interfaces that they implement if requested by the framework, but the default is for a device to support "all" interfaces.

 

All devices have both common and unique configuration options. The common capabilities are stored in the base "HW Configuration.lvclass," but extended by their own implementation for unique properties

 

Future Updates / Known Issues

  1. Remote execution of measurements on RT target (available in previous 3.0 version)
  2. The ability to launch one central logger instead of a logger per measurement
  3. The ability to launch the results from the measurement window
  4. Distribution of plugins with SystemLink as NIPM packages
  5. Devices have to be selected in error or then framework returns an error
  6. The path to store logs has to be valid, or framework return an error
  7. Various performance improvements when acquiring

Additional Information

The following articles describe core design decisions of the original framework:

 

This framework is not officially supported by NI, but will continue to be improved and developed based on input and feedback. The original version of this framework was published in 2012.

Elijah Kerry
NI Director, Software Community
Comments
Clio75
Member
Member
on

Hi @Elijah_K

 

I'm trying to look on your MAL framework, but get an error on som s\logger lib. 

Can you point me in a direction to correct his error. 

 

Clio75_0-1649405560913.png

 

we don't use teststand or SYSTEMLINK, can you provide a example how to use MAL/HAL in plain LabVIEW 😉 

Elijah_K
Active Participant
Active Participant
on

ATTENTION: I know that several of you have commented about missing some VIs when you open the example.

 

The fix is simple: You need to install the SystemLink Client VIs for LabVIEW from the NI Package Manager!

 

I can make this simpler in the future through the use of JKI Dragon, but for now: please be sure to install these so you have the RabbitMQ API that the system uses for communication.

Elijah Kerry
NI Director, Software Community
Foni
Member
Member
on

Hi.

 

I am trying figure out how the TestStand use the framework, read back values from the measurement. But when I launch the sample TestStand sequence, It seem to be missing the read Average Voltage.vi. And I guess that is where I can see how data is "transferred" to TestStand

Contributors