Loops and Other Structures
- Updated2026-09-28
- 2 minute(s) read
Structures in LabVIEW are graphical representations of the loops and case statements of text-based programming languages.
LabVIEW includes different types of structures that serve different purposes. You can find structures on the Structures palette () from the block diagram.
| Structure Use Case | Structure |
|---|---|
| Repeat blocks of code |
|
| Execute all structure code in order |
|
| Execute code conditionally |
|
| Disable code |
|
| Increase memory efficiency | In Place Element structure |
Related Information
- For Loops: Repeating Operations a Set Number of Times
You can use a For Loop to execute a section of code contained within the loop, called a subdiagram, a set number of times.
- While Loops: Repeating Operations Until a Condition Occurs
Similar to a Do Loop or a Repeat-Until Loop in text-based programming languages, a While Loop executes a subdiagram until a condition occurs.
- Configuring Timed Loops and Timed Loops with Frames (Real-Time, Windows)
- Sequence Structures: Executing Sections of Code Sequentially
- Configuring Timed Sequence Structures (Real-Time, Windows)
- Case Structures: Executing a Section of Code Based on Input Values
LabVIEW Case structures operate similarly to switch statements or if...then...else statements in text-based languages. Case structures allow you to run different sections of code based on the input value you provide to the structure.
- Disable Structures: Preventing Code from Executing
- In Place Element Structures: Increasing Memory Efficiency
- Executing One or More Sections of Code Using Structures
Certain structures in LabVIEW include subdiagrams. You can use these structures to execute the code on a specific subdiagram in specific circumstances.
- Configuring Settings of a Timed Structure (Real-Time, Windows)
- Adding Structures to the Block Diagram
Add a LabVIEW structure from the Structures palette to the block diagram, then place and size it for your code.
- Resizing Structures
- Adding Objects inside Structures
Add an object inside a structure in LabVIEW by dragging it inside the structure or by dragging a new structure around the object. You cannot put an object inside a structure by moving an existing structure over the object.
- Replacing One Structure with Another Structure
- Removing Structures without Deleting Objects in the Structure