From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you control the order of operations inside a LabView “VI”?

How do you control the order of operations inside a LabView “VI”?

0 Kudos
Message 1 of 7
(5,547 Views)
Are you talking daq operations or daq assistants or other (math or comparison)?
___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 2 of 7
(5,543 Views)
Dataflow determines the order. A common method is to use error in/out connections. Try to avoid the flat sequence structure and never use the stacked sequence structure.

Take some of free tutorials to get a better understanding.
Message 3 of 7
(5,522 Views)
The error in/out was going to be my suggestion.
___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 4 of 7
(5,504 Views)

Using the flat sequence structure when a component, like timers or other  "free standing" ones that don't have error clusters to force data flow.

 

 

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 5 of 7
(5,488 Views)

@kiwi77 wrote:

How do you control the order of operations inside a LabView “VI”?


You got some good advice already, but let me emphasize that  for the vast majority of operations the order does not matter and is sufficiently determined by dataflow alone. Heavy handedly adding error wires everywhere causes excessive serialization and leaves no leeway for the compiler to optimize the code for parallel execution of code that can be independent.

 

Order of operations is important for IO operations, and here the error wire is sufficient to enforce order. On a higher level, order is enforced by proper code architecture, such as state machines.

 

(A typical beginner mistake is the excessive use of local variables, which breaks data dependency and the natural order of execution, which them must be restored by excessive use of sequence structures. Two wrongs don't make a right!)

0 Kudos
Message 6 of 7
(5,479 Views)

@LV_Pro wrote:

Using the flat sequence structure when a component, like timers or other  "free standing" ones that don't have error clusters to force data flow.

 

 


In this case, you could use use a case structure and wire the error into that.  In the case of the error, the wait is meaningless.  You bypass the wait.  In the no error case, it operates the same as the FSS.  You gain functionality by changing from FSS to case structure.

Message 7 of 7
(5,448 Views)