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: 

Idiom for initialising a sub VI?

Solved!
Go to solution

From documentation for the FOR loop:

 

The count terminal specifies the number of times to execute the code inside the For Loop. If you wire 0 or a negative number to the count terminal, the loop does not execute.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 11 of 15
(1,053 Views)
Solution
Accepted by topic author bojinlund

@bojinlund wrote:

 

1) I am trying to understand the difference in “my” and “the common” way to initialise a sub VI.

 


Your way works.  I've just never seen it done that way before.  Perhaps using constructs that people will immediately recognize is worth something to you?

 


@bojinlund wrote:

Hej GerdW!

 

Have you any reference to this in the documentation of LabVIEW?

 

/Bosse


Default Data in Loops

Loops produce default data on the first iteration when the shift register is not initialized.

For Loops produce default data if you wire 0 or a negative number to the count terminal of the For Loop or if you wire an empty array to the For Loop as an input with auto-indexing enabled. The loop does not execute, and any output tunnel with auto-indexing disabled contains the default value for the tunnel data type. Use shift registers to transfer values through a loop regardless of whether the loop executes.

 

from - http://zone.ni.com/reference/en-XX/help/371361G-01/lvconcepts/for_loop_and_while_loop_structures/

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 12 of 15
(1,053 Views)

Betelgeuse

 

Betelgeuse

 

Betelgeuse

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 14 of 15
(1,040 Views)

Hoovahgeuse

Hoovahgeuse

Hoovahgeuse

🙂

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 15 of 15
(1,002 Views)