Top Six Mistakes Made by Beginning LabVIEW Programmers

Share Article

Sixclear, a National Instruments Alliance Partner and LabVIEW training company, shares a list of common mistakes by new LabVIEW developers and how to fix them.

Stacked Sequence Structure

Stacked Sequence Structures are in the palettes, yes. But only to maintain backwards compatibility with someone who already made the mistake of using them.

Sixclear, a National Instruments Alliance Partner and LabVIEW training company, shares a list of common mistakes by new LabVIEW developers and how to fix them.

As both a LabVIEW training and consulting company, the developers at Sixclear see a lot of code made by new LabVIEW programmers. Some novice errors can have a huge negative impact.

“We built our Lucid LabVIEW Fundamentals course with lectures, exercises, and solution videos to address these and countless other concerns,” says Brian Spears, head of Sixclear LabVIEW course development. “We also update our VI High video blog with short snippets for the same sort of questions. So we’ll point to more information from these resources for each item in our list.”

“Problem 1: Race Conditions Caused by Local and Global Variables. Locals and Globals are blissfully simply to set up and use. But overuse leads to code that gives inconsistent data, hangs, or crashes.
Solution: Use data flow and wires for sequential operations. For parallel operations, bring in data transfer mechanisms like queues, notifiers, and functional globals.
More information: Unit 3 of Lucid LabVIEW Fundamentals One - Functional globals and parallel operations
Unit 1 of Lucid LabVIEW Fundamentals Two - Queues and notifiers
VI High 9 & 10 - Data flow
VI High 42 & 43 - Functional globals

“Problem 2: No Error Handling. If an error occurs, the code comes to a screeching halt and gives a cryptic error, leaving the operator scratching a confused head.
Solution: LabVIEW can fly a plane or lead a rover across Mars. But not if you’re using Automatic Error Handling. The error cluster is easy to use! We can gracefully exit, fix, or prevent erroring applications from being a problem.
More information: Unit 2 of Lucid LabVIEW Fundamentals One - Error handling
VI High 46-48 - Error handling

“Problem 3: Stacked Sequence Structures. They unnecessarily hide code, require sequence locals which break left to right data flow, and more frames generate more locals which creates more clutter.
Solution: They’re in the palettes, yes. But only to maintain backwards compatibility with someone who already made the mistake of using them. Use data flow and error clusters instead.
More information: Unit 1 of Lucid LabVIEW Fundamentals One - Data flow
VI High 48 - Data Flow with the error cluster

“Problem 4: Overuse of Express VIs and Dynamic Data. The true data type and operation is hidden, so you may think you’re coding correctly when you’re actually getting erroneous data.
Solution: There’s nothing wrong with using Express VIs to prototype code and tweak parameters in operations like digital filtering and performing power spectrums. But see what native LabVIEW VIs and functions the Express VI uses under the hood and use those in your completed application instead.
More information: Unit 1 of Lucid LabVIEW Fundamentals Two - Express VIs

“Problem 5: Non-intuitive User Interface Eyesores. The User Interface is the face of your code, it should smile welcomingly to your user. Too many times we see it sprawling, overlapping, and garish without clear design.
Solution: LabVIEW gifts us tab controls, decorations, and alignment/position tools to make a real looker of a UI. Use them. Your users will like you.
More information: Unit 2 of Lucid LabVIEW Fundamentals One - User interfaces
VI High 1 and 2 - Front panel color and conditionally disabling front panel objects

“Problem 6: Not Using Type Definitions. This can cause hours of frustrating rewrite when it’s time to expand or update your code. Using type defs from the start saves you a world of timewaste.
Solution: Good code can change over time with minimal effort. Use type defs in most cases enums and clusters are used.
More information: Unit 2 of Lucid LabVIEW Fundamentals Two - Type Definitions”

Spears encourages new users to take advantage of the final days of Sixclear's March promotion where access to Lucid LabVIEW Fundamentals One is free for a month.

About Sixclear
Founded in Austin, Texas in early 2008, Sixclear is a development and integration company offering LabVIEW courses, development, integration, and consulting in the automation, test, measurement, and data acquisition space. Besides offering the only fully self-paced, e-learning online LabVIEW training in the world, Sixclear offers a customizable LabVIEW course presented live in the classroom.

Share article on social media or email:

View article via:

Pdf Print

Contact Author

Brian Spears
Sixclear
888-707-9508 x201
Email >
Visit website