StructuresDownload PDFSelected SectionSelected Section and Subsection(s)Entire ManualUpdated2025-03-144 minute(s) readLabVIEWAPI ReferenceLabVIEW G Structures Use the structures to build VIs. For LoopExecutes its subdiagram n times, where n is the value wired to the count (N) terminal. The iteration (i) terminal provides the current loop iteration count, which ranges from 0 to n-1.While LoopRepeats the code within its subdiagram until a specific condition occurs. A While Loop always executes at least one time.Timed StructuresUse the Timed Structures and VIs to control the rate and priority at which a timed structure executes its subdiagram, synchronize the start time of timed structures, create timing sources, and establish a hierarchy of timing sources.Case StructureContains one or more subdiagrams, or cases, exactly one of which executes when the structure executes. The value wired to the case selector determines which case to execute.Event StructureWaits until an event occurs, then executes the appropriate case to handle that event. The Event structure has one or more subdiagrams, or event cases, exactly one of which executes when the structure executes to handle an event. This structure can time out while waiting for notification of an event. Wire a value to the Timeout terminal at the top left of the Event structure to specify the number of milliseconds the Event structure waits for an event. The default is -1, which indicates never to time out. In Place Element StructureControls how the LabVIEW compiler performs certain operations and, in some cases, increases memory and VI efficiency. Use the In Place Element structure when you operate on a data element within an array, cluster, variant, or waveform without requiring the LabVIEW compiler to copy data values and maintain those values in memory. You also can use this structure to operate on any data type that you want to maintain within the same data space in memory. Right-click the border of the structure and select the border node that matches the operation you want to perform.Flat Sequence StructureConsists of one or more subdiagrams, or frames, that execute sequentially. Use the Flat Sequence structure to ensure that a subdiagram executes before or after another subdiagram. Data flow for the Flat Sequence structure differs from data flow for other structures. Frames in a Flat Sequence structure execute from left to right and when all data values wired to a frame are available. The data leaves each frame as the frame finishes executing. This means the input of one frame can depend on the output of another frame.Formula NodeEvaluates mathematical formulas and expressions similar to C on the block diagram. The following built-in functions are allowed in formulas: abs, acos, acosh, asin, asinh, atan, atan2, atanh, ceil, cos, cosh, cot, csc, exp, expm1, floor, getexp, getman, int, intrz, ln, lnp1, log, log2, max, min, mod, pow, rand, rem, sec, sign, sin, sinc, sinh, sizeOfDim, sqrt, tan, tanh. There are some differences between the parser in the Mathematics VIs and the Formula Node.Diagram Disable StructureHas one or more subdiagrams, or cases, of which only the Enabled subdiagram executes. Use the Diagram Disable structure to disable a section of the block diagram.Conditional Disable StructureHas one or more subdiagrams, exactly one of which LabVIEW uses for the duration of execution, depending on the configuration of the conditions of the subdiagram. Use this structure when you want to disable specific sections of code on the block diagram based on some user-defined condition. Right-click the structure border to add or delete a subdiagram. When you add a subdiagram or right-click the structure border and select Edit Condition For This Subdiagram from the shortcut menu, you can configure conditions in the Configure Condition dialog box.Type Specialization StructureHas one or more subdiagrams, exactly one of which LabVIEW compiles and executes, depending on the order and the compilation result of the subdiagram. LabVIEW declines subdiagrams in order if they have syntax errors. LabVIEW accepts the first subdiagram that does not have syntax errors and ignores the remaining subdiagrams. If all subdiagrams have syntax errors, this structure accepts the last subdiagram. Syntax errors are errors within the structure, such as broken wires, not errors caused by subVIs or other dependencies. Use this structure to customize sections of code in a malleable VI (.vim) for specific data types. You also can use this structure in conjunction with the Assert Type VIs and functions to force a malleable VI to accept only a subset of the acceptable data types or to decline specific data types.Shared VariableRepresents a shared variable on the block diagram. To bind a Shared Variable node to a shared variable from the active project, add a Shared Variable node to the block diagram and double-click or right-click the node and select Select Variable>>Browse from the shortcut menu to display the Browse for Variable dialog box. You also can drag a shared variable from the Project Explorer window onto the block diagram of a VI in the same project to create a Shared Variable node.Local VariableUse local variables to read or write to one of the controls or indicators on the front panel of a VI.Global VariableUse global variables to access and pass data among several VIs.DecorationsUse the decorations located on the Decorations palette to group or separate objects on a block diagram with boxes, lines, or arrows. These objects are for decoration only and do not modify data.Feedback NodeStores data from one VI execution or loop iteration to the next.Parent topic: ProgrammingWas this information helpful?YesNo
Structures Use the structures to build VIs. For LoopExecutes its subdiagram n times, where n is the value wired to the count (N) terminal. The iteration (i) terminal provides the current loop iteration count, which ranges from 0 to n-1.While LoopRepeats the code within its subdiagram until a specific condition occurs. A While Loop always executes at least one time.Timed StructuresUse the Timed Structures and VIs to control the rate and priority at which a timed structure executes its subdiagram, synchronize the start time of timed structures, create timing sources, and establish a hierarchy of timing sources.Case StructureContains one or more subdiagrams, or cases, exactly one of which executes when the structure executes. The value wired to the case selector determines which case to execute.Event StructureWaits until an event occurs, then executes the appropriate case to handle that event. The Event structure has one or more subdiagrams, or event cases, exactly one of which executes when the structure executes to handle an event. This structure can time out while waiting for notification of an event. Wire a value to the Timeout terminal at the top left of the Event structure to specify the number of milliseconds the Event structure waits for an event. The default is -1, which indicates never to time out. In Place Element StructureControls how the LabVIEW compiler performs certain operations and, in some cases, increases memory and VI efficiency. Use the In Place Element structure when you operate on a data element within an array, cluster, variant, or waveform without requiring the LabVIEW compiler to copy data values and maintain those values in memory. You also can use this structure to operate on any data type that you want to maintain within the same data space in memory. Right-click the border of the structure and select the border node that matches the operation you want to perform.Flat Sequence StructureConsists of one or more subdiagrams, or frames, that execute sequentially. Use the Flat Sequence structure to ensure that a subdiagram executes before or after another subdiagram. Data flow for the Flat Sequence structure differs from data flow for other structures. Frames in a Flat Sequence structure execute from left to right and when all data values wired to a frame are available. The data leaves each frame as the frame finishes executing. This means the input of one frame can depend on the output of another frame.Formula NodeEvaluates mathematical formulas and expressions similar to C on the block diagram. The following built-in functions are allowed in formulas: abs, acos, acosh, asin, asinh, atan, atan2, atanh, ceil, cos, cosh, cot, csc, exp, expm1, floor, getexp, getman, int, intrz, ln, lnp1, log, log2, max, min, mod, pow, rand, rem, sec, sign, sin, sinc, sinh, sizeOfDim, sqrt, tan, tanh. There are some differences between the parser in the Mathematics VIs and the Formula Node.Diagram Disable StructureHas one or more subdiagrams, or cases, of which only the Enabled subdiagram executes. Use the Diagram Disable structure to disable a section of the block diagram.Conditional Disable StructureHas one or more subdiagrams, exactly one of which LabVIEW uses for the duration of execution, depending on the configuration of the conditions of the subdiagram. Use this structure when you want to disable specific sections of code on the block diagram based on some user-defined condition. Right-click the structure border to add or delete a subdiagram. When you add a subdiagram or right-click the structure border and select Edit Condition For This Subdiagram from the shortcut menu, you can configure conditions in the Configure Condition dialog box.Type Specialization StructureHas one or more subdiagrams, exactly one of which LabVIEW compiles and executes, depending on the order and the compilation result of the subdiagram. LabVIEW declines subdiagrams in order if they have syntax errors. LabVIEW accepts the first subdiagram that does not have syntax errors and ignores the remaining subdiagrams. If all subdiagrams have syntax errors, this structure accepts the last subdiagram. Syntax errors are errors within the structure, such as broken wires, not errors caused by subVIs or other dependencies. Use this structure to customize sections of code in a malleable VI (.vim) for specific data types. You also can use this structure in conjunction with the Assert Type VIs and functions to force a malleable VI to accept only a subset of the acceptable data types or to decline specific data types.Shared VariableRepresents a shared variable on the block diagram. To bind a Shared Variable node to a shared variable from the active project, add a Shared Variable node to the block diagram and double-click or right-click the node and select Select Variable>>Browse from the shortcut menu to display the Browse for Variable dialog box. You also can drag a shared variable from the Project Explorer window onto the block diagram of a VI in the same project to create a Shared Variable node.Local VariableUse local variables to read or write to one of the controls or indicators on the front panel of a VI.Global VariableUse global variables to access and pass data among several VIs.DecorationsUse the decorations located on the Decorations palette to group or separate objects on a block diagram with boxes, lines, or arrows. These objects are for decoration only and do not modify data.Feedback NodeStores data from one VI execution or loop iteration to the next.Parent topic: Programming
Structures Use the structures to build VIs. For LoopExecutes its subdiagram n times, where n is the value wired to the count (N) terminal. The iteration (i) terminal provides the current loop iteration count, which ranges from 0 to n-1.While LoopRepeats the code within its subdiagram until a specific condition occurs. A While Loop always executes at least one time.Timed StructuresUse the Timed Structures and VIs to control the rate and priority at which a timed structure executes its subdiagram, synchronize the start time of timed structures, create timing sources, and establish a hierarchy of timing sources.Case StructureContains one or more subdiagrams, or cases, exactly one of which executes when the structure executes. The value wired to the case selector determines which case to execute.Event StructureWaits until an event occurs, then executes the appropriate case to handle that event. The Event structure has one or more subdiagrams, or event cases, exactly one of which executes when the structure executes to handle an event. This structure can time out while waiting for notification of an event. Wire a value to the Timeout terminal at the top left of the Event structure to specify the number of milliseconds the Event structure waits for an event. The default is -1, which indicates never to time out. In Place Element StructureControls how the LabVIEW compiler performs certain operations and, in some cases, increases memory and VI efficiency. Use the In Place Element structure when you operate on a data element within an array, cluster, variant, or waveform without requiring the LabVIEW compiler to copy data values and maintain those values in memory. You also can use this structure to operate on any data type that you want to maintain within the same data space in memory. Right-click the border of the structure and select the border node that matches the operation you want to perform.Flat Sequence StructureConsists of one or more subdiagrams, or frames, that execute sequentially. Use the Flat Sequence structure to ensure that a subdiagram executes before or after another subdiagram. Data flow for the Flat Sequence structure differs from data flow for other structures. Frames in a Flat Sequence structure execute from left to right and when all data values wired to a frame are available. The data leaves each frame as the frame finishes executing. This means the input of one frame can depend on the output of another frame.Formula NodeEvaluates mathematical formulas and expressions similar to C on the block diagram. The following built-in functions are allowed in formulas: abs, acos, acosh, asin, asinh, atan, atan2, atanh, ceil, cos, cosh, cot, csc, exp, expm1, floor, getexp, getman, int, intrz, ln, lnp1, log, log2, max, min, mod, pow, rand, rem, sec, sign, sin, sinc, sinh, sizeOfDim, sqrt, tan, tanh. There are some differences between the parser in the Mathematics VIs and the Formula Node.Diagram Disable StructureHas one or more subdiagrams, or cases, of which only the Enabled subdiagram executes. Use the Diagram Disable structure to disable a section of the block diagram.Conditional Disable StructureHas one or more subdiagrams, exactly one of which LabVIEW uses for the duration of execution, depending on the configuration of the conditions of the subdiagram. Use this structure when you want to disable specific sections of code on the block diagram based on some user-defined condition. Right-click the structure border to add or delete a subdiagram. When you add a subdiagram or right-click the structure border and select Edit Condition For This Subdiagram from the shortcut menu, you can configure conditions in the Configure Condition dialog box.Type Specialization StructureHas one or more subdiagrams, exactly one of which LabVIEW compiles and executes, depending on the order and the compilation result of the subdiagram. LabVIEW declines subdiagrams in order if they have syntax errors. LabVIEW accepts the first subdiagram that does not have syntax errors and ignores the remaining subdiagrams. If all subdiagrams have syntax errors, this structure accepts the last subdiagram. Syntax errors are errors within the structure, such as broken wires, not errors caused by subVIs or other dependencies. Use this structure to customize sections of code in a malleable VI (.vim) for specific data types. You also can use this structure in conjunction with the Assert Type VIs and functions to force a malleable VI to accept only a subset of the acceptable data types or to decline specific data types.Shared VariableRepresents a shared variable on the block diagram. To bind a Shared Variable node to a shared variable from the active project, add a Shared Variable node to the block diagram and double-click or right-click the node and select Select Variable>>Browse from the shortcut menu to display the Browse for Variable dialog box. You also can drag a shared variable from the Project Explorer window onto the block diagram of a VI in the same project to create a Shared Variable node.Local VariableUse local variables to read or write to one of the controls or indicators on the front panel of a VI.Global VariableUse global variables to access and pass data among several VIs.DecorationsUse the decorations located on the Decorations palette to group or separate objects on a block diagram with boxes, lines, or arrows. These objects are for decoration only and do not modify data.Feedback NodeStores data from one VI execution or loop iteration to the next.Parent topic: Programming