LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

While Loop #1 vs While Loop #2 VI Scripting

Hi all,

does anyone know the difference between these two objects?

The code creates two While Loops that look exactly the same to me.

AldhairGarza_1-1645634218348.png

Thanks in advance.

=======
My Channel: https://www.youtube.com/@LV_Lab

0 Kudos
Message 1 of 6
(2,400 Views)

When I run your code I see two while loops that are in different locations and have different sizes. Additionally, the different class inputs of GObject vs. Generic (the parent of GObject), I believe, simply affect the type of refnum output; for example, wire a property node to it and you will either get a Generic or a GObject property node. The Generic and GObject refnums can be typecast to the other. They are interchangeable; style #1 doesn't require Generic nor #2 GObject. I agree, they both have Class ID 16435 and Class Name "WhileLoop". I suppose what you really want to know is the functional difference between a style "While Loop #1" vs. "While Loop #2". Unfortunately, I don't know that either.

0 Kudos
Message 2 of 6
(2,365 Views)

Yes that is my question. The size and position are different because I coded that.

But why is there While Loop #1 and While Loop #2 in the Enum.

 

Doesn't make sense to me.

=======
My Channel: https://www.youtube.com/@LV_Lab

0 Kudos
Message 3 of 6
(2,346 Views)

There is no difference between them. My guess is that in older (way older) LabVIEW versions the different options might have been used to create loops with:

 

1. Different stop conditions (stop on true vs. stop on false), or 

2. One with a stop button already wired to the stop terminal, and one without.

 

But those differences were at some point removed, causing the two scripting options to generate the same object. Again, that's just a guess.

Message 4 of 6
(2,326 Views)

I would inspect the auto-grow property of each before I claimed them to be identical.   Beyond that.  While loops switched from defaulting to stop on TRUE between 6.i and 7.1. I misremeber how 7.0 did them I was too busy having fun with7.0


"Should be" isn't "Is" -Jay
Message 5 of 6
(2,312 Views)

@JÞB wrote:

I would inspect the auto-grow property of each before I claimed them to be identical.   


Yup, I checked all the properties, including private hidden flags. They're identical.

Message 6 of 6
(2,309 Views)