LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to build a cluster dynamically at run time

Solved!
Go to solution

Hi everyone,

 

I would really appreciated if someone point me to the solution. I need to build a cluster which I only have the information at run-time. Each element of the cluster could be of different data types. Is there an example of how to do it?

 

Many thanks,

 

Chris_Ng

0 Kudos
Message 1 of 18
(1,454 Views)

Any data type (wire) is strictly typed, this means, the type of the wire is defined at edit time.

 

If you change the cluster definition, this means, you are changing the data type. If you could describe more on why you need to create clusters in runtime, there could be better ways to achieve it.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 18
(1,439 Views)

Hi santo_13,

 

I create a program which depends on user input, will produce different collection of data (sizes and types). At the moment, I use map to hold the variable names and values (in string format). I think of a solution where I could loop through my map collection to parse the data and somehow insert them into a cluster. With this method, I could dynamically generate cluster for my code but I guess that is not the right way. Therefore, I manually parse each item in my map collection into a defined cluster. I wonder if there is a better way to minimize the "manual" process in getting the output.

0 Kudos
Message 3 of 18
(1,420 Views)

The question is, why a cluster? why not retain as a Map?

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 4 of 18
(1,411 Views)
Solution
Accepted by topic author Chris_Ng

I like the cluster toolkit from Autotestware.

Message 5 of 18
(1,369 Views)

Why?

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 18
(1,337 Views)

Hi all,

 

The reason I'd like to go with cluster is because I think it's a cleaner solution. In a map, I have to keep the key/value pairs to keep track of each of my data (just like variable name and value). In a cluster, I don't have to worry about that and it looks better. Anyway, that was just my opinion.

 

Best,

0 Kudos
Message 7 of 18
(1,313 Views)
If a dynamically built cluster existed you would still need some name or reference to the data to be able to access it.
0 Kudos
Message 8 of 18
(1,280 Views)

Hi Chris,

 

What would be an example of datasets "different data types" that you will be dealing with?

 

X

0 Kudos
Message 9 of 18
(1,276 Views)

The error cluster is the collection of different data types.

0 Kudos
Message 10 of 18
(1,266 Views)