09-19-2017 07:59 AM
450 elements in a cluster? o.O You don't mean 450 rows/values? If it's only 1 cluster of 450 elements you can easily send it around in a shift register, but if it's an array of this so the data gets big you might want to go with a DVR instead.
/Y
09-19-2017 11:04 AM
@Blokk wrote:
I can use a cluster of clusters but I would end up with two many bundle/un-bundles to the get to my elements.
Why? You can create a proper data hierarchy with descriptive names and sub-clusters! If you want to pick a subcluster, it takes only a single "Unbundle by Name"! Oh yes, and you MUST use Type defined cluster for your project, alongside with "Bundle/unbundle by names".
edit: and do not forget to make the subclusters also type defined. It will help you when you need to carry out modifications.
That's great Blokk, I had no idea.
But the comments made me think... Maybe using an array is better because I have corresponding elements that need to be selected for certain actions like comparison. And in clusters I have to select them by name individually because indexing is also not that easy. To be clear my output which needs to be dumped into a csv looks like the attached spreadsheet. In my final step I need to compare for example measurement-1 to lower limit-1 and upper limit-1 to determine Pass or fail-1, these all correspond together. I avoided the array solution because I didn't want to keep track of the labels. Now I am thinking maybe it's better to use a cluster of settings sub-cluster and four arrays for measurements, lower limit, upper limit and pass or fail. Any opinions?
09-19-2017 11:19 AM
@crossrulz wrote:
I am with the others. It sounds like you need to rethink your data structure. And why do you even need that many parameters? I have yet to run into a situation where I needed that many variables. But a couple of options:
1. Use arrays. Arrays of clusters also work well, depending on what you are doing.
2. Use Variant Attributes. You can store all of your parameters in a single variant and use a string (name) for the lookup. The lookup for a Variant Attribute is fast (everything is sorted as you add data).
Thanks for your input crossrulz.
I know variants are good for handling different data types but here I am handling everything as string. Could you point to an example on how I can use them here?
09-19-2017 02:07 PM
So this is what I have come up with. The question now what is the most efficient data type to use: Most of my cluster elements can be single precision float along with a limited number of strings. Is it more memory efficient to keep everything in string format(since it uses a pointer) and convert when needed?
09-19-2017 05:43 PM
It definitely sounds like the array of clusters is what you really need. It is a lot more expandable than the giant cluster.
As for your data, I would use a string. You can either flatten the data to string or use the many string conversion functions. If memory is the concern, then use Flatten To String and Unflatten From String as necessary.
09-20-2017 03:04 AM - edited 09-20-2017 03:09 AM
@H7N wrote:
So this is what I have come up with. The question now what is the most efficient data type to use: Most of my cluster elements can be single precision float along with a limited number of strings. Is it more memory efficient to keep everything in string format(since it uses a pointer) and convert when needed?
If you use a cluster (or clusters in array), you'd be using a pointer anyway. LV doesn't pump cluster data though the wires, but passes pointers. My guess is it doesn't matter at all if the elements inside are strings or singles.
If they are floats, I see no reason to convert them from\to string. It's a waist of CPU, memory and programming effort.
What makes you worried about memory anyway? 450 stings in a cluster, even if you have that 100 times would not make me worried. Optimize when proven to be needed, not when you expect it to be needed.