LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

BUG: Labelled array constant vs build array vs Bundle (array loses label) (LV2019)

So, this is a fairly common design, right?

Yamaeda_0-1783003213904.pngYamaeda_1-1783003428903.png

 

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

Qestit Systems
Certified-LabVIEW-Developer
Message 1 of 5
(297 Views)

I don't think the language makes guarantees about what the wire label will be in situations like this so I wouldn't classify it as a bug.

0 Kudos
Message 2 of 5
(274 Views)

You could also do the following to ensure that the label survives...

 

altenbach_1-1783007834744.png

 

Note that the wire after the build has no name when  probed. it's a bit a can of worms. What if you would concatenate two arrays (same problem:  no wire name, even if both input arrays are named the same!)

 

In my best practices, I always wire a cluster constant with proper element names to the top of the bundle operation if I later want to do anything "by name".

0 Kudos
Message 3 of 5
(261 Views)

If i have an advanced testcase i typedef a cluster, but usually i just create constants or wire inital wires to a bundle. I mean i could wire the constant and then use a Bundle by name, but it was just stuff like that i was trying to avoid.

I had this situation i thought "Why to i type cast the array, why not simply Build array and it'll be a little cleaner"

Yamaeda_0-1783067538306.png

Btw, you can't Type cast a Path in this way, you must use Coerce to type. Hmm, i'll use that on Programmers also, it looks a little nicer.

Still i consider it a bug!

 

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 5
(194 Views)

Not a "bug", in that NI doesn't really promise to support this kind of dynamic name use and they would probably suggest you make a cluster constant to define names.  BUT, I personally think it is a valuable use case and NI should make some effort to support it.

0 Kudos
Message 5 of 5
(152 Views)