Python’s popularity as a programming language continues to rise, and the test and measurement community has begun to debate when to use LabVIEW and when to use Python.
To answer this question, we spoke with Collin Draughon, one of our software product managers. He believes you shouldn’t have to choose between these two powerful engineering software tools.
NI: As a Certified LabVIEW Architect and a Python developer, do you recommend LabVIEW for certain tasks and Python for others?
Collin: The major difference between LabVIEW and Python is that Python was built to be a generic programming language while LabVIEW was built specifically for engineering applications that require test, measurement, or control. What this means is that LabVIEW excels at engineering-specific software needs, such as simplified hardware integration, the creation of engineering-focused user interfaces, access to built-in analysis libraries and domain-specific IP from the LabVIEW ecosystem, and complex timing representations.
On the other hand, Python is used across a plethora of domains because of its industry-agnostic offering. This has led to a vast array of libraries and modules for every kind of task. Users looking to build an engineering system that requires custom functionality from their domains or industries can often benefit from using both LabVIEW and Python together: LabVIEW to build out the engineering components and user interface, and Python to execute tasks in parallel like web dashboard building, machine learning, natural language processing, and so on. This gives users the ability to quickly build out engineering applications with LabVIEW while maintaining access to the vast ecosystem of Python libraries.
NI: Why should LabVIEW users learn more about Python and vice versa?
Collin: I often see code written in other programming languages be pulled into LabVIEW applications for a specific task or function. Over the past 10 years, Python has grown in popularity and expanded to offer hundreds of thousands of domain-specific packages for applications ranging from generating StarCraft II replays to modeling complex geophysical systems. LabVIEW users can take advantage of this Python code by integrating Python scripts into their LabVIEW applications.
Python users looking to build engineering applications can benefit from learning more about LabVIEW because of the tools LabVIEW offers to simplify common engineering tasks. Python is a generic programming language while LabVIEW is specific to building out engineering applications.
LabVIEW can greatly reduce a developer’s development time by optimizing the engineering-specific workflows they need to complete.
NI: How should LabVIEW developers integrate Python into their applications?
Collin: On Windows systems, my go-to method is the Python Integration Toolkit for LabVIEW by Enthought. We partnered with Enthought to develop a simple LabVIEW API that allows developers to call Python code in parallel with running an application. Using the toolkit, I can easily specify the Python script that I want to load into memory, pass it all the parameters for a specific function I want to call, call the function, and instantly get a response in LabVIEW from the Python interpreter.