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
Chief Product Manager, Software Platform
_______________________________________________
Follow my Software Engineering for LabVIEW Blog
Comments
Elijah_K
Active Participant
Active Participant
on

Well, good and bad news: it built and ran without a problem for me.  I would be surprised if it was a OS langauge specific error, but you never know...

Actually, I could see why this error might occur if you were using from 3.0.3.4 - have you treid 3.0.3.5?

Elijah Kerry
Chief Product Manager, Software Platform
_______________________________________________
Follow my Software Engineering for LabVIEW Blog
LuI
Active Participant
Active Participant
on

That's what I have tried 😉

Elijah_K
Active Participant
Active Participant
on

can't seem to reproduce the issue on my end... any chance you have an English OS handy to try?  I can try to get my hands on a German OS, but it'll probably be a bit before I can get around to setting one up

Elijah Kerry
Chief Product Manager, Software Platform
_______________________________________________
Follow my Software Engineering for LabVIEW Blog
LuI
Active Participant
Active Participant
on

Unfortunately I have been assigned higher priorized tasks for now, so it may take _some_ time.

I might have done something wrong when setting it up and test it - I stayed mostly with LV711 until a few weeks, so my experience is quite low here.

I'll update whenever I have news, but for now I have to switch. Sorry!

LuI
Active Participant
Active Participant
on

I de- and re-installed everything and now it works. Maybe I did something wrong the first try. Or left something out...

Thanx for that example project!

David_Do
Member
Member
on

After deleting all measurement framework packages and all dependencies and rebooting the computer, I have installed the Measurement Utility 3.0.3.5 Beta.vipc again. And the Framework runs.

Manigreatus
Member
Member
on

Hi,

Elijah thanks for such a nice example! I have two questions;

1- I couldn't find any "copyright notices" within Installers. How should be the licensing handled if someone use it? since you are using openG.

2- Is it worth using this measurement utility (after some modifications) with Veristand?

Elijah_K
Active Participant
Active Participant
on

Very much meant to be an example that can be used in accordance with the standard licensing for any example published on ni.com.  It exists to illustrate technical concepts and [hopefully] provide guidance when wrestling with some of these more technically challenging problems, so feel free to put it to use in any way that helps you!

Elijah Kerry
Chief Product Manager, Software Platform
_______________________________________________
Follow my Software Engineering for LabVIEW Blog
Elijah_K
Active Participant
Active Participant
on

As for using it with Veristand, quite possibly - exploring that angle is something I've considered but haven't found the time for quite yet.  If you do, please share your findings. 

Elijah Kerry
Chief Product Manager, Software Platform
_______________________________________________
Follow my Software Engineering for LabVIEW Blog
Manigreatus
Member
Member
on

I will try to look into its possibilities with VeriStand.

Elijah_K
Active Participant
Active Participant
on

Uploaded 3.0.3.6, which includes the following fixes

  • includes the VIP file for creating a new measurement from a template from the create project dialog (somewhere along the way it went missing from the VIPC file - my mistake!)
  • error 5557 used to be generated if the order of the array of hardware that was identified to run a measurement with did not match the order in which the measurement definition specified the hardware.  In 3.0.3.6, this error is captured and it attempts to order to hardware to match what was requested by the measurement.  This error would've previously been seen when attempting to run a frequency measurement from the UI (fix shown below)

2014-06-20_08-38-33.png

Elijah Kerry
Chief Product Manager, Software Platform
_______________________________________________
Follow my Software Engineering for LabVIEW Blog
ajuw
Member
Member
on

Hi,

I am unable to launch the example... When I look in the Project window, I am unable to find the virtual folder "Server" or "Client".

I installed the *.vipm file and hoped that everything gets installed as required.

Am I missing something?

Thanks,

Ajay

Elijah_K
Active Participant
Active Participant
on

It should've installed new items in the 'Create Project' dialog under a 'Demonstration' category.  Can you confirm that you were able to open the Measurement System shown here?

2014-06-24_21-37-15.png

Elijah Kerry
Chief Product Manager, Software Platform
_______________________________________________
Follow my Software Engineering for LabVIEW Blog
dsavir
Active Participant
Active Participant
on

Hi,

I installed the VIPC and the sample measurements and hardware.

I create project->Measurement system ->Next->configure the new project->crash LV13. (using LV13 SP1, windows 7 SP1 64 bit)

crash2.PNG

I also tried:

create project->Measurement system -> New HW Device template ->configure project->error "Labview can't find the source files for this project".

What did I miss?

Thanks in advance,

Danielle

"Wisdom comes from experience. Experience is often a result of lack of wisdom.”
― Terry Pratchett
Elijah_K
Active Participant
Active Participant
on

Hey Dsavir - sadly, there is no hardware template at this point.  That's a placeholder for something I'd like to eventually create.  If you want to see an example of a template for a plugin, select 'New Measurement Template'

Elijah Kerry
Chief Product Manager, Software Platform
_______________________________________________
Follow my Software Engineering for LabVIEW Blog
dsavir
Active Participant
Active Participant
on

Hi,

When I choose new measurement template, LV13 crashes. Is there seomthing I forgot to install?

Thanks,

Danielle

"Wisdom comes from experience. Experience is often a result of lack of wisdom.”
― Terry Pratchett
dsavir
Active Participant
Active Participant
on

Hi,

I downloaded version 66 instead of the latest version, and it loads well with no crashes.

Thanks,

Danielle

"Wisdom comes from experience. Experience is often a result of lack of wisdom.”
― Terry Pratchett
Elijah_K
Active Participant
Active Participant
on

It looks like you may have found a bug in the scripting code that rears its head based upon settings selecting in the 'New Measurement' dialog - I actually think you'll see it in v66 if you select the same settings.  I'm looking into it...

Elijah Kerry
Chief Product Manager, Software Platform
_______________________________________________
Follow my Software Engineering for LabVIEW Blog
StevenHowell_XOM
Member
Member
on

This is a great example! This could help solve a huge piece of the puzzle for the standardization project I am working on here at XOM.

-Steven

TailOfGon
Active Participant
Active Participant
on

How can I create the nice looking sequence diagram of network connection?  I would like to use the for designing my AF based embedded application. Thank you

TailOfGon
Certified LabVIEW Architect 2013
AristosQueue
Proven Zealot
Proven Zealot
on

TailOfGon: That was created by hand in PowerPoint. You can use LV 2015 and the Desktop Execution Trace Toolkit to harvest the information that goes into such a chart, but at this time there is no automated way to generate the chart.

KALee
Member
Member
on

You might look at this thread: https://decibel.ni.com/content/thread/26864?tstart=60

It has some good resources for diagramming.

TailOfGon
Active Participant
Active Participant
on

AristosQ: Thanks for clarifying this. So it was PowerPoint. My intention was to create a timing diagram as a project planning.

KALee: Thanks for the link. Indeed it is very useful to know that there are many alternatives in creating the diagram. I'm currently looking at http://SequenceDiagrram.org and http://www.websequencediagrams.com

TailOfGon
Certified LabVIEW Architect 2013
edisler
Member
Member
on

All,

I am doing my best to get into the groove with this framework but I am a bit concerned with the complexity of implementing it, particularly in the context of a larger application. I would be interested to hear from folks who have used this framework to successfully implement a larger application requiring multiple developers to contribute to the project.

reteP
Member
Member
on

Hi Elijah_K,

This app is awesome, it is very helpful to understand power of OOP. Thank you for your work 😉

I have one question:

If I want to SAVE measurement data to disk I use RESULT actor for this action or I must make any new actor ?

Elijah_K
Active Participant
Active Participant
on

In case anyone is curious, here's a screenshot of the 'Start Measurement.vi' method implemented using the newer actor framework API.

It's a minor change, but does improve the readability of the code IMHO.  However, I don't plan to upload this, as I would prefer to maintain backwards compatibility for older LabVIEW versions.2015-11-21_14-13-02.png

Elijah Kerry
Chief Product Manager, Software Platform
_______________________________________________
Follow my Software Engineering for LabVIEW Blog
GautierB
Member
Member
on

Good morning Elijah,

First of all, thank you very much example, which will be very useful to mewhich will helps me a lot with understanding the AF and OOP programming. I look forward to get deeper into it, but I have some issues while running the "Server Controller main.vi" which says"Application is broken and cannot be run" as David_Do in his msg from 26 févr. 2014 03:59, except that I am running LV2015.

I tried to desinstall the package and reinstall it as he did but it didn't work. So I take a look deeper into the main.vi and saw that the "Launch actor.vi" called into "Server Controller main.vi">>"Attempt to Start Controller.vi">>"Load App.vi" is crossed because it's no longer supported by LV2015. LV help told me to replace it by "Launch the root acotr" or 'Launch a nested actor" but neither of them belong an entry for the "Read enqueur.vi" exit.

Thank you very much in advance for you help, and I wish you the best for the new year coming.

Elijah_K
Active Participant
Active Participant
on

Gautier,    Are you sure you have the OpenG libraries installed? You can ignore the big X over the 'launch actor.vi,' as it's deprecated, but still works.

Elijah Kerry
Chief Product Manager, Software Platform
_______________________________________________
Follow my Software Engineering for LabVIEW Blog
GautierB
Member
Member
on

Thank you for your answer Elijah,

All the libraries are installed and VIPM says "nothing to do. All the packages are already installed." when I tried to install them again.

Could this error caused by the use of the base version of LV instead of the pro version ? Because I see that a lot of libraries which seems to come frome the pro version.

More over, after somme digging, I found that the issue come from the dynamic vi "Do.vi" which can't be executed because of the two VIs "LNA Connection Status Msg.lvclass:Do.vi" and "LNA Return Message Msg.lvclass:Do.vi" which I can't found in the project. Those missing VIs make the dynamic VI "Do.vi" not executable, and so "Actor core.vi" can't be executed either. Any ideas why those VIs are non functional ?

LV.pngLV2.png

Thanks in advance for your answer

Not applicable
on
Elijah_K
Active Participant
Active Participant
on

Hey everyone.  Just posted a new version, which should be much easier to install and use.  Instead of trying to distribute pre-built plugins, just follow the instructions above to create your own from the project.

Please let me know if you continue to have any problems.

I've also uploaded a newer version of the slide content that I prepared for the most recent CLA Summit in Bangalore, India.

Elijah Kerry
Chief Product Manager, Software Platform
_______________________________________________
Follow my Software Engineering for LabVIEW Blog
Elijah_K
Active Participant
Active Participant
on

One more update: v3.2 installs the top-level application as an example instead of a project template

Elijah Kerry
Chief Product Manager, Software Platform
_______________________________________________
Follow my Software Engineering for LabVIEW Blog
DMurrayIRL
Member
Member
on

Hi Elijah, does the latest version still install something/anything as a Project Template? From your (admittedly dated) blog post, I'm interested in seeing how you have done a few things in your template, but when I installed the vipc I don't see anything new in the Project templates folder.

perj
Member
Member
on

Hello Elijah. Very interesting utlity. In the release notes it is noted that this utility "currently only works on 32-bit LabVIEW due to a dependency that has a 32-bit DLL". What kind of dependecy is it, and are there any plans of updating this for 64 bit LabVIEW? I am currently evaluating this utility for future projects where HAL/MAL is a vital issue, but this dependecy makes me wonder if this utlility is a good choice.

Elijah_K
Active Participant
Active Participant
on

It's easily addressed. I beleive the DLL is for GUID generation for the network connectivity and it's only one API call.  Could very easily be replaced/updated.

Elijah Kerry
Chief Product Manager, Software Platform
_______________________________________________
Follow my Software Engineering for LabVIEW Blog
Elijah_K
Active Participant
Active Participant
on

I'm going to go try to open it in 64-bit now...

Elijah Kerry
Chief Product Manager, Software Platform
_______________________________________________
Follow my Software Engineering for LabVIEW Blog
Elijah_K
Active Participant
Active Participant
on

Good news. The lack of 64-bit support should be easy to fix. It currently uses a 32-bit library to zip a class to be sent over a network.  I'm going to replace this with JSON serialization, which should fix the issue.

Elijah Kerry
Chief Product Manager, Software Platform
_______________________________________________
Follow my Software Engineering for LabVIEW Blog
perj
Member
Member
on

Great, thank you very much. Good to see that the utility is updated. Seems like we will use this utility in some of our projects that are based on Actors Framework. Very interesting and usefull tool for HAL/MAL.

NIquist
Active Participant
Active Participant
on

Just stumbled across this after watching the OOP webcasts.  Surprised to find that now it's for LabVIEW 2016 or above only.  Is there no way to open it in 2015???

LabVIEW Pro & Measurement Studio Pro (VS Pro) 2019
LV_Pro
Trusted Enthusiast Trusted Enthusiast
Trusted Enthusiast
on

Your link, on the initial page, to the larger image of the detail sequence ... https://forums.ni.com/servlet/JiveServlet/download/21441-78-70585/Detailed%20Diagram.png is broken.

 

Thanks for this work, making my head heart, but in a good way.

 

 

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



niNickC
Member
Member
on

Little typo:

 

3. One installed, navigate in NIPM to the TestStand Interface for MAF package and click "Show Examples"

 

Navigate in the VIPM right...?

Nick
Elijah_K
Active Participant
Active Participant
on

Good catch Nick - I'll fix that now

Elijah Kerry
Chief Product Manager, Software Platform
_______________________________________________
Follow my Software Engineering for LabVIEW Blog
Riv
Member
Member
on

I downloaded the .vipc file (zip) and tried to run it. My VI package manager opens but do not indicate anything to be installed, neither can I find the utility in VIPM (I typed different names in search bar, including Measurement Utility). I wonder if I do something wrong? I checked for updates, too.

Would be grateful for some tips,

Anna

 

rwunderl
Member
Member
on

Anna,

 

I had the same issues. This seems like a poor way to distribute code to the community (forcing people to install lots of unpublished packages). But on the other hand, I understand it's a complicated project with lots of dependencies. That said, I unzipped the .vipc file (it's just a zip file, by the way) and tried to install one of the included packages. That's when I got an error in VIPM that the package had been built with a newer version of VIPM. Apparently this error does not surface when trying to open the .vipc file itself. I only had VIPM 2014 installed even though I had installed LabVIEW 2017 later on (and failed to check VIPM for installation). So I updated to VIPM 2017 and the .vipc file opened and installed as you would expect.

 

Now with the .vipc file installed, I am still missing packages and am working to fix that now. I'm missing stuff that's supposed to be in the "<vi.lib>\Skyline" folder but isn't. I do not have NXG or SystemLink Client installed, so maybe this is the reason? Why is Skyline a dependency?

 

Also it's strange that the Measurement Actor stuff got installed to "<user.lib>\Build Output\Measurement Actor" instead of "<user.lib>\Measurement Abstraction Framework\Measurement Actor" or some such. Most of the menu items for "TestStand Interface for MAF" are broken too. Any suggestions on this? I feel like it shouldn't be this hard...

 

Hope it helps,

Richard

_______________________________________________________________
"Computers are useless. They can only give you answers." - Pablo Picasso
WOLF_S
Member
Member
on

Thank you for sharing this with us. That is a really interesting framework and concept behind it. I'm sad, that it does not work on my computer. I got the same problem as Richard. A fix would be highly appreciated. Could you make a short tutorial on how to use it for individualized measurements and hardware?

Aliaksei.Luferau
Member
Member
on

Elijah, Thank you for great work! But I also got the same problem as Richard and WOLF_S.

Labview Version 17.0 f2(32-bit)

VIPM 2018.0.0 f2

Can problems arise because the Labview program is installed on 😧 disk (not system disk)?

im0.pngim1.pngim2.png

champion2019
Member
Member
on

Hi Elijah,

 

Do you have the version of LV2016? 

matrixbug
Member
Member
on

Excuse me, there is no download link on Ni forum. Where can I download this framework? Thank you very much.

matrixbug
Member
Member
on
I want to learn about it, but I can't find the download link. Excuse me, where can I download this framework? Thank you very much.
Elijah_K
Active Participant
Active Participant
on

Hey @Matrixbug,

 

I verified that the link still works... have you downloaded and installed the VIPM link, which is re-posted here: EV Battery Test Software 0600318 (NIWeek 18).vipc.zip ‏11831 KB

 

Elijah Kerry
Chief Product Manager, Software Platform
_______________________________________________
Follow my Software Engineering for LabVIEW Blog
Contributors