Summary: In this section, you will learn about dataflow programming.
LabVIEW follows a dataflow model for running VIs. A block diagram node executes when all its inputs are available. When a node completes execution, it supplies data to its output terminals and passes the output data to the next node in the dataflow path.
Visual Basic, C++, JAVA, and most other text-based programming languages follow a control flow model of program execution. In control flow, the sequential order of program elements determines the execution order of a program.
For a dataflow programming example, consider a block diagram that adds two numbers and
then subtracts
Subtract function cannot execute
until the Add function finishes executing and
passes the data to the Subtract
function. Remember that a node executes only when data are
available at all of its input terminals, and it supplies data
to its output terminals only when it finishes execution.
![]() |
In the following example, consider
which code segment would execute first-the Add,
Random Number, or Divide
function. You cannot know because inputs to the
Add and Divide functions are
available at the same time, and the Random Number
function has no inputs. In a situation where one code segment
must execute before another, and no data dependency exists
between the functions, use other programming methods, such as
error clusters, to force the order of execution. Refer to the
Error Handling section of Clusters for more information about error
clusters.
![]() |
"A full introductory course on programming with LabVIEW."