LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

labeled indicies : why not?

That's all cool and all.  But the data's not self documenting.  You have to go back to where the arrays were created to figure out how to label your loops.

Is there a way to save the contents of a typed cluster and merge it with the typedef that created it? 

You could invent a storage format that would allow you to encapsulate both data and typedefs in one file so that you could save a workspace, or subset of one. 
LV 8.6 on Windoze XP
0 Kudos
Message 11 of 14
(794 Views)


Clueless1 wrote:
That's all cool and all.  But the data's not self documenting.  You have to go back to where the arrays were created to figure out how to label your loops.

i still have big trouble understanding what you want. you have to go back to were the arrays were created....i remember a Labview Proverb saying this: "if you need a bigger screen, your problem is elswere" . it seems you have a similar problem.
 
How about instead of saving your data as array, you would save it as a cluster, with single element array in. then, everytime you want to use the array, you directly have its label:
 


Message Edited by Gabi1 on 12-12-2007 11:17 PM
-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 12 of 14
(790 Views)
Yes, you can do it that way, and I probably have or will adopt some of these sugestions. 

If you can't see the utility in what I'm proposing then you wouldn't have to use it  I think it would be cool that's all.

I'm sure I could learn to go back to FORTRAN IV if I had to.  

We probably all know a few folks who still program in FORTRAN IV and compile on a FORTRAN 90whatever compiler.  Not a problem.


LV 8.6 on Windoze XP
0 Kudos
Message 13 of 14
(783 Views)
If NI implemented what you are talking about, it is nothing more than an additional array of strings.  So, if you would find it so useful, you can write code to implement the behavior you desire and link the array of strings with the array of data.  You also have the option of using variants and using Variant Attributes to apply your descriptions.  If you are doing a lot of processing, though, it would be a nightmare, as you would be constantly converting to and from variant.

The only time I have ever thought it would be nice was when I just hated carrying an array of strings around for the array.  Most times, it is completely unnecessary.  FWIW, TestStand does have the behavior you are talking about and NI has stated that they carry the array of strings around in the background.  If you try to index by name, all TestStand does in the background is search the array of strings to get the index, then index the array.  You can certainly do that in LabVIEW.

If you do this with functional globals or objects, then you wouldn't have to pass the arrays through every subVI.  Of course, if your data names are constant, then you can drop the array of strings and use a functional global which knows where everything goes.  That way, you do it once, then in your other code, you don't have to think about it.  You just use your subVI and tell it which element you want by enum type or string.
0 Kudos
Message 14 of 14
(777 Views)