CI/CD for LabVIEW

Best Practices to Implement Key Pillars of DevOps

Published on: 06-11-2024

Author: Uthrakumar Arumuganainar


LabVIEW has been the go-to programming language for Test & Measurement and Control Applications. But with increasing complexity, LabVIEW can benefit from adopting DevOps principles proven to improve and shorten the software development life cycle. 

While DevOps has traditionally been associated with text-based programming languages, we have learned the merits of implementing DevOps in LabVIEW, even with its complexities, over the years. In this article, you’ll discover how DevOps principles can be applied to LabVIEW development, with a focus on key areas like Continuous Integration (CI), Continuous Deployment (CD), and automated testing. We’ll also briefly introduce some essential tools and best practices that can help tackle the unique challenges of implementing CI/CD in LabVIEW.


  • How to Navigate the Key Pillars of DevOps Implementation in LabVIEW Environment?
    • Continuous Integration (CI)
      • Best Practices for Better Code Maintenance to Implement CI
    • Continuous Testing
    • Continuous Deployment (CD)
    • Infrastructure as Code (IaC)
  • How DevOps in LabVIEW Pays Off – A Case in Example   

 

LabVIEW is a graphical programming language widely adopted to develop Test & Measurement and Control applications. The ready availability of instrument drivers, user interface components, signal processing libraries, and the ease of programming and running an application has made LabVIEW a go-to programming language in this domain. Over the past few decades, LabVIEW applications have grown significantly in size and complexity, and in some cases, development teams have also become more geographically distributed. This has brought significant challenges in keeping up with the pace of development. 

The software industry has solved this problem and the collection of best practices that it came up with is called DevOps. One key component of the DevOps principle is the practice of Continuous Integration and Continuous Deployment (CI/CD). While CI/CD workflows and tools are well-established in text-based programming environments, their adoption in LabVIEW projects has been limited because some of the tools and practices cannot be directly used with a graphical programming language.  

DevOps Tools for LabVIEW

DevOps Tools for LabVIEW

For years, we have been working on large LabVIEW applications with distributed development teams, which has led us to adopt DevOps in our projects. We have seen the difference in projects where we made the investments to enable CI/CD and the ones where we did not, for a variety of legacy reasons. The investment pays off many times over, especially in projects that need to be maintained for many years with new feature additions on a regular basis. In this article, we share the best practices we have learned over the years to implement DevOps in LabVIEW.   

 

DevOps is a collection of best practices and tools for rapid software development, improve collaboration among teams, and maintain quality and reliability. 

<Learn More>

Continuous Integration and Continuous Deployment (CI/CD) are one of the primary DevOps practices that aims to streamline, automate and accelerate the software development lifecycle.  
<Learn More> 

How to Navigate the Key Pillars of DevOps Implementation in LabVIEW Environment?  

Effective DevOps implementation requires the adoption of tools and practices that can streamline Continuous Integration (CI) and Continuous Deployment (CD) seamlessly in LabVIEW. 

 

Continuous Integration (CI) 

In LabVIEW, CI can be difficult due to the nature of binary files like VIs. Unlike implementing CI in text-based languages where the process of establishing a seamless workflow with the toolkits available is straightforward; CI in LabVIEW needs a fair amount of engineering. The toolkits and infrastructure available for CI in LabVIEW require expertise to engineer available tools to achieve a seamless, stable workflow. 

Here are a few practices and tools that can be adopted to perform CI efficiently:    

  • Automated Building and Packaging: Tools such as NI Package Builder, NI Package Manager, and VI Package Manager can automate the process of building and packaging binary outputs. These tools simplify dependency management and enable smooth integration across environments.    
  • Dependency Management: LabVIEW projects require an effective solution to manage and relink dependencies. One such tool is the LabVIEW Solution Builder. This tool minimizes broken builds and the risk of errors during integration.   
  • CI Toolkits: CI toolkits automate LabVIEW’s build and test process. NI has extended LabVIEW’s capability for CI with a toolkit released as a part of LabVIEW 2021. This toolkit integrates with existing CI tools like Jenkins, enabling teams to automate builds and tests directly in LabVIEW’s environment.     

Click here to learn more about how LabVIEW offers Continuous Integration (CI) with Jenkins.    

 

Best Practices for Better Code Maintenance to Implement CI 

  • Modular Code Structure: Create a modular and scalable architecture with dynamic VI calls using OOPs inheritance and by separating large VIs into smaller, reusable sub-VIs.  This helps avoid conflicts, enables parallel development, and provides efficient version control.      
  • Version Control for Binary Files: Use effective configuration management and version control tools, like SVN or Git, with proper binary file handling practices, such as separating compiled code, that can manage changes effectively.     

Despite best practices, challenges can still arise when different versions of VI need to be merged. Manually resolving these conflicts can often lead to cumbersome workflows and reviews. To address these challenges, the “LabVIEW Code Comparison Tool for Git” offers a streamlined solution.    

The LabVIEW Code Comparison Tool for Git is part of the SLL Toolkit for LabVIEW. Click here to access, download, and learn more about it and other reusables.    

Watch this video and learn more about how to implement LabVIEW’s Code Comparison Tool to streamline your development process

Continuous Testing   

An optimal testing approach includes unit, integration, and system-level tests. Testing in LabVIEW involves hardware integration, making unit and integration tests more complex than those in purely software environments. Nonetheless, some best practices and tools can ensure that continuous testing in LabVIEW is efficient and reliable.    

  • Optimizing Unit Tests: Complex code needs to be broken into small, testable components, such as individual code modules or sub-VIs. This way, developers can ensure better test coverage and easier troubleshooting in the early stages of testing. Tools and toolkits like Caraya, JKI VI Tester Framework, and LabVIEW Unit Test Framework enable unit tests within the LabVIEW development environment.    
  • Improving Integration Tests: Integration tests verify that different system modules interact correctly. This is especially important in LabVIEW, where software must interface with external hardware and code modules in the repository. Here, TestStand, a test management software, provides an easy way to set up and manage integration tests. 
  • UI Testing Automation: User Interface (UI) testing is crucial for validating how an end user interacts with LabVIEW applications, mainly when applications involve complex hardware control. By automating these tests, teams can continuously verify both the frontend interaction and backend processes. Soliton’s SLL-Drona framework offers this capability to automate LabVIEW application UI tests.     

Learn more about Soliton’s open-source UI Testing framework and other contributions here.    

  • System-Level Testing: System-level tests aim to validate the entire application, ensuring that all integrated components operate as expected in a real-world scenario. This includes validating user interfaces and backend logic, replicating user interaction, and hardware communication. Here too, TestStand can save time and ensure consistency in testing across different hardware setups. 

Continuous Deployment (CD)    

Continuous Deployment in LabVIEW environments can have unique challenges due to the hardware dependencies, the handling of binary files, and the complexity of configuration management. But with the right tools and practices, CD can be streamlined, ensuring fast and reliable deployment of LabVIEW applications.    

  • Centralized Deployment Repositories: NI SystemLink is a centralized platform for deploying software packages across multiple environments. SystemLink can manage the distribution of updates, new features, and patches across all instruments and systems, significantly reducing the manual effort required in large, distributed test environments.     
  • Configuration Management and Binary File Handling: Binary files, such as executables and compiled VIs, must be carefully managed to avoid issues during deployment. Here too, SystemLink, with its configuration management capabilities, allows teams to track and version-control binaries and settings. This ensures that suitable configurations are deployed in each environment, helping to maintain consistency across development, testing, and production systems.    

For more information about how NI SystemLink can help configure systems and deploy software, click here.    

  • Managing Instrument Drivers & Dependencies: In LabVIEW, managing hardware-specific dependencies, such as instrument drivers, is essential for successful deployments. NI Package Manager (NIPM) simplifies this by enabling centralized management of drivers and dependencies. NIPM ensures that all necessary components for a LabVIEW application are packaged and deployed efficiently, automatically managing version control and compatibility.    

Infrastructure as Code (IaC)     

Building, testing, packaging, and deploying are continuous processes that must occur for every code commit, feature update, and release. Establishing this automation as Infrastructure as Code (IaC) allows teams to create dynamic, scalable, and reusable pipelines that adapt to project needs. With IaC, all the scripts, configurations, and setups are stored and versioned as part of the codebase, making the entire process of automation easily replicable and maintainable.    

Here are some key practices to adopt when implementing in LabVIEW:     

  • Infrastructure Tool Integration: One approach is to leverage a centralized automation tool such as Jenkins, an open-source automation server that seamlessly integrates and automates all the processes in DevOps pipelines. Groovy scripts and Jenkins files help orchestrate complex tasks efficiently while offering a modular and reusable approach to automation.      
  • Automated Script Management: To eliminate the manual tasks of organizing files, managing dependencies, and packaging binaries, Command-Line Interfaces (CLIs) and automated scripts can be integrated into your pipeline. Automating these operations reduces human error and inefficiency in critical tasks, ensuring consistency across environments.    

How DevOps in LabVIEW Pays Off – A Case in Example    

A customer used a complex measurement system with a standardized framework for testing their Devices Under Test (DUT). What began as a framework that could be built and tested manually developed over multiple years across geographies, consisting of multiple software components using LabVIEW and other programming languages. This necessitated an intervention to bring stability, reliability, and improved software delivery. To this end, adopting DevOps was by far the first choice to address the situation. 

The Quantum Leap 

  • Reduced build-test-deploy cycle time from a day (8 hours) to 1.5 hours. 

Previously, the build-test-deploy cycle was manually developed. This was possible when there were only five packages to test and deploy. However, when the framework had to scale to manage over 150 packages, manual building was not feasible. That’s where CI/CD pipelines could automate the entire build-test-deploy cycles, reducing the time taken. 

  • Improved product quality through continuous testing and validation that could identify more bugs early. 

With the CI/CD pipelines, testing was automated while the packages were built. Not only did this mean that bugs were caught and fixed before deployment, but it could also catch double the number of bugs before deployment. Even in the case of a failure after deployment, the framework allowed to create a test case with the exact scenario that the user faced and then to add it to the automated test and commit the code. This would prevent this bug or failure from occurring again in future builds. Over time, the framework has become more stable with fewer bugs. 

Talk to Us 

As a company with 25 years of Award-winning Excellence in LabVIEW, we are happy to invite anyone from the developer community working with LabVIEW to reach out to us with questions. Our team includes 3 LabVIEW Champions and 23 Certified Architects in LabVIEW and TestStand.  

If you are looking to implement or assess the potential of DevOps in your LabVIEW development, write to [email protected]. We will be happy to connect with you!