
If you’ve ever managed or work with a team of programmers, you realize that each person has their own programming style. If programming team members always use their own code and style, they cannot develop code effectively.
A critical practice for getting programming teams to work efficiently is code re-use. In LabVIEW there are many ways to implement code re-use. In this blog I decided to revisit one of these code re-use strategies, the VI Snippet.
What is a VI Snippet?
“VI Snippets are a way to store, share and reuse small portions of LabVIEW code. VI Snippets combine the portability of a screenshot with the functionality of a VI file by embedding LabVIEW code in a standard PNG image. When you drag a VI Snippet PNG image onto the block diagram it will drop the snippet as graphical code that can be edited and used in your application.” More on that here (Using VI Snippets to Store and Share Reusable Code Sections – National Instruments)

Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.
Introducing Snippets in my workflow
At the surface, the Snippet is a cool way to share and reuse frequently used code. Similar to my userlib folder where I store my vi libraries, I have a folder on my computer where I catalog my snippets in subfolders (e.g. general, frameworks, arrays, tdms, SQLite, DAQmx, etc.) so that they can be located with minimal effort. Actually, I have two locations on my computer that I store snippets: A private folder that I use as my personnel sandbox and a public folder that I share with my team. As with any collaboration or shared repository, you must be discipline or you will experience chaos. Our LabVIEW development team meets weekly for code reviews, discusses new projects, and to share best practices. At the end of every meeting, we invite team members to share any new vis and/or snippets they would like to add to the team’s repository.
My first Snippet
25 years ago, when I first started wiring G code, it was not such a big deal connecting all of those wires on the Block Diagram. However, as time passes and my eyes require a bigger monitor, I look for any hack that I can muster to limit the time spent wiring clusters and arrays. To that end I offer up the prewired Bundle By Name/Array.

What’s next?
How I use VI Snippets to make quick user dialogs.
Standardizing on reusable code? Talk to ITM’s LabVIEW development team.
Related solutions
Software Engineering
Custom LabVIEW and application development built on reusable, disciplined code practices. Explore →
Testing Services
Test systems and automated test sequences built on the same proven LabVIEW code libraries. Explore →
Data Acquisition
DAQ hardware and software integration, programmed with the same LabVIEW re-use practices. Explore →
Recent insights
-
Aerospace Engineering, Aerospace Testing, Blue Origin, Engineering, ESCAPADE Mission, Launch Vehicle Engineering, New Glenn, Rocket Reliability, Strain Measurement, structural health monitoring, Structural TestingHow Pre-Launch Structural Testing Ensures Mission Success
When Blue Origin’s New Glenn rocket successfully launched NASA’s ESCAPADE mission to Mars, it marked a historic step forward for commercial launch technology — and a testament to the unseen engineering that happens long before a vehicle ever reaches…
-
6D Testing & Analysis, Accelerometers, data acquisition systems, design validation, Engineering, engineering measurement, experimental modal analysis, impact hammer testing, mechanical engineering, modal testing, structural dynamics, Structural Testing, vibration testingFree Engineering Guide: How to Perform Experimental Modal Analysis for Better Structural Insight
Understanding how structures vibrate—and why—is essential across nearly every engineering discipline. Whether you’re working on rotating machinery, industrial equipment, robotics, medical devices, heavy vehicles, consumer products, or building-scale…
-
AWS IoT Analytics, cDAQ-9189, Channel Synchronization, CompactDAQ, Condition-Based Maintenance, Edge-to-Cloud High-Channel Datalogging, Engineering, Instrumentation, iTestSystem, iTestSystem Automated Analytics, iTestSystem Notification Service, NI-9236, NI-9469, Strain, Stress, structural health monitoringHigh Channel Count Synchronous Datalogging
When a manufacturer needed to validate the structural performance of a 38-ton on-highway vehicle, ITM deployed a 200+ channel synchronous datalogging system capable of capturing accelerometer, strain, GPS, and speed data at nearly 2 kS/s per channel…
