Jump to content

Data flow: Difference between revisions

From LabVIEW Wiki
No edit summary
Change links to point to execution highlighting, remove notice about single thread
 
(12 intermediate revisions by 8 users not shown)
Line 1: Line 1:
Data flow is the fundamental tenet by which LabVIEW code is written. The basic philosophy is that the passage of data through nodes within the program determines the order of execution of the functions of the program. LabVIEW VI's have inputs, process data and produce outputs. By chaining together VI's that have common inputs and outputs it is possible to arrange the functions in the order by which the programmer wants the data to be manipulated.
[[Wikipedia:Dataflow programming|Dataflow programming]] is a [[Wikipedia:Programming paradigm|programming paradigm]] where the execution of functions is determined by their data dependencies. This is fundamentally different from traditional programming paradigms that execute functions in sequence as they appear in the source code.


Often a single input is used as a common "thread" running through several VI's and the program to force the order of operations. Examples include the error cluster or the refnum data structure.
== LabVIEW dataflow model ==
== See Also ==
 
{{Portal|Getting Started}}
LabVIEW uses the graphical programming language [[G|G Dataflow]], which utilizes wires to represent data dependencies between functions (''nodes'' in LabVIEW terminology).
 
A node without input wires can execute immediately, while a node with input wires must wait until the previous node has finished execution.
 
{|
| [[File:Dataflow - Node without input wires.gif|thumb|left|A node without input wires executes immediately.]]
| [[File:Dataflow - Node with input wires.gif|thumb|left|A node with input wires waits for the previous node to finish execution.]]
|}
 
It is also possible to execute multiple nodes in parallel, as long as they have no data dependencies between each other. However, the total number of nodes that can execute in parallel is limited by the [[LabVIEW Execution System|execution system]].
 
{|
| [[File:Dataflow - Nodes execute in parallel.gif|frame|Nodes without data dependencies execute in parallel. (Note: [[Execution highlighting]] forces the code to run in a single thread which is why they appear to execute sequentially).]]
|}
 
== Visualizing dataflow in LabVIEW ==
 
[[Execution highlighting]] can be used to visualize the flow of data while executing a [[VI]] in LabVIEW.
 
== See also ==
 
* [[G|G Dataflow]]
* [[Debugging]]
* [[LabVIEW Execution System]]
 
== External links ==
 
* [[Wikipedia:Dataflow programming]] (Wikipedia)
* [http://www.ni.com/getting-started/labview-basics/dataflow Dataflow Programming Basics] (National Instruments)
 
== References ==
<references />
 
[[Category:LabVIEW fundamentals]]
[[Category:Programming Paradigm]]

Latest revision as of 16:33, 6 May 2023

Dataflow programming is a programming paradigm where the execution of functions is determined by their data dependencies. This is fundamentally different from traditional programming paradigms that execute functions in sequence as they appear in the source code.

LabVIEW dataflow model

LabVIEW uses the graphical programming language G Dataflow, which utilizes wires to represent data dependencies between functions (nodes in LabVIEW terminology).

A node without input wires can execute immediately, while a node with input wires must wait until the previous node has finished execution.

A node without input wires executes immediately.
A node with input wires waits for the previous node to finish execution.

It is also possible to execute multiple nodes in parallel, as long as they have no data dependencies between each other. However, the total number of nodes that can execute in parallel is limited by the execution system.

Nodes without data dependencies execute in parallel. (Note: Execution highlighting forces the code to run in a single thread which is why they appear to execute sequentially).

Visualizing dataflow in LabVIEW

Execution highlighting can be used to visualize the flow of data while executing a VI in LabVIEW.

See also

External links

References