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
 
(One intermediate revision by one other user not shown)
Line 15: Line 15:


{|
{|
| [[File:Dataflow - Nodes execute in parallel.gif|frame|Nodes without data dependencies execute in parallel. (Note: [[#Visualizing dataflow in LabVIEW|Execution highlighting]] forces the code to run in a single thread which is why they appear to execute sequentially).]]
| [[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 ==
== Visualizing dataflow in LabVIEW ==


The [[Debugging|debugging]] option "''Execution Highlighting''" [[File:Execution Highlighting On.png|border|Execution Highlighting enabled|link=Debugging]] will visualize the flow of data while executing a [[VI]] in LabVIEW.
[[Execution highlighting]] can be used to visualize the flow of data while executing a [[VI]] in LabVIEW.
 
This, however, forces the code to run in a single thread, which causes nodes to execute sequentially<ref>[https://forums.ni.com/t5/LabVIEW/Execution-Order/m-p/2655447/highlight/true#M791922 Execution Order] (National Instruments Forums)</ref>.


== See also ==
== See also ==
Line 32: Line 30:
== External links ==
== External links ==


* [[Wikipedia:Dataflow Dataflow]] (Wikipedia)
* [[Wikipedia:Dataflow programming]] (Wikipedia)
* [http://www.ni.com/getting-started/labview-basics/dataflow Dataflow Programming Basics] (National Instruments)
* [http://www.ni.com/getting-started/labview-basics/dataflow Dataflow Programming Basics] (National Instruments)



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