Code Reuse in LabVIEW NXG

Publish Date: Jan 23, 2018 | 0 Ratings | 0.00 out of 5 | Print

Overview

With rapidly changing test requirements and shortening tester project development cycles, it is even more critical that you and your team gain the most reuse possible from existing test software and measurement libraries. So why aren’t more test engineers reusing software more often? Here are the responses we hear most from test groups:
  • There is legacy software developed by someone that is no longer in the group or in the company; and it is working, so there is significant risk and expense in changing the unknown.
  • There are tool and language personal preferences or group standardization across test and validation engineering teams; therefore, it is difficult to reuse code modules because the tools or software to use for a past project don’t translate to what we are using today.
  • There is a need to maximize software reuse and build abstraction layers or frameworks, but this is expensive and time-consuming. With short-term project demands, the focus on how to enable reuse standards and best practices is continuously being deferred.

The challenges of balancing longer term standardization benefits with existing code and software skills or preference is real. To help address this difficult balance, LabVIEW NXG as an open platform was designed to help you integrate all your test hardware and software systems together.

In LabVIEW NXG, you can combine multiple programming approaches alongside graphical data flow (G) in a single application. Use this flexibility to select your tool of choice for creating device under test (DUT) control, configuration, or measurement libraries. LabVIEW NXG integrates multiple languages, like C, into your application and interoperates with other software running locally or on the network to reduce your team’s time to success.

 



Table of Contents

  1. Calling Existing DLLs
  2. Integrate C Code
  3. Reuse Python Code and .NET Assemblies With LabVIEW
  4. Additional Resources

1. Calling Existing DLLs

In addition to importing source code onto a LabVIEW NXG block diagram, you can reuse existing applications and algorithms developed in other languages by calling them from a LabVIEW NXG application. For instance, if you have an existing C/C++ shared library and need to reuse it in LabVIEW NXG, you can call it using the Shared Library Interface (SLI). To make importing external libraries simple, LabVIEW NXG includes the Shared Library editor, which assists you in building a LabVIEW NXG SLI for incorporation onto the LabVIEW NXG block diagram.


Figure 1: Use the Shared Library editor to map existing libraries for use in LabVIEW NXG.




Figure 2: Use the Shared Library Interface to reuse existing C or C++ shared libraries in-line with G programming.




Back to Top

2. Integrate C Code

Use the C Node to import, write, and execute your existing C code with a familiar text-based development experience including function auto-complete and context help. You can call functions from the following libraries in the C Node:

  • ANSI C Library
  • Analysis Library

For more information, see the C Node Overview.

Figure 4: Use the C Node to integrate and edit C code in LabVIEW NXG.



Back to Top

3. Reuse Python Code and .NET Assemblies With LabVIEW

The Python programming language has grown in popularity across virtually all industries and is becoming increasingly used in test and measurement applications. What has helped make Python appropriate for the test and measurement space is its ability to integrate with NI hardware and software to leverage its scripting strengths with NI's rich measurement expertise.

Learn how to incorporate Python automation scripts into a larger LabVIEW application.

Back to Top

4. Additional Resources

 

Back to Top

Bookmark & Share


Ratings

Rate this document

Answered Your Question?
Yes No

Submit