10-13-2015 03:26 AM
Dear all,
I have a cluster with many elements of the same type. I want to manipulate any of them the same way, however keeping their labels. My solution does work, however, it is prone to mistakes from wrong wiring an its not actually scalable. do you have any better idea?
Thanks!
Solved! Go to Solution.
10-13-2015 03:50 AM
/Y
10-13-2015 03:57 AM
10-13-2015 04:43 AM
I was for some reason totally convinced the numeric functions (add,....) woul only work on doubles. thanks for pointing this out!
10-15-2015 05:49 AM - edited 10-15-2015 05:51 AM
what if i didnt want to add but apply a digital filter?
assuming this cluster comes in every iteration with 4 new data elements .... and i have 10 clusters with total 50 data elments
10-15-2015 07:18 AM - edited 10-15-2015 07:22 AM
Hi OPC,
why did you create a new account?
what if i didnt want to add but apply a digital filter?
Then you should rethink your datatype design!
At first you should use type definitions with clusters - in your image you didn't do this.
And when you want to apply a filter to a variable number of data elements you should use an array. It doesn't make sense to use a cluster: you cannot create subVIs which accept any kind of cluster… (Well you could work with polymorphic VIs, but you would need to create a new one for each cluster.) Quick&easy approach: use an array for channel names and an array for values.
10-15-2015 09:49 AM
thanks for your reply!
... account details lost
>> Then you should rethink your datatype design!
I kind of do this for every new project i make, learning by doing
the reason why i didnt wnat to use an array in first place is because i want every channel to have its name, otherwise i will get totally lost. thats why I tried for this project to go with "bundle by name".
the filter i have in mind only accepts doubles, not arrays.
to be honest i am doing some guesswork to put together your recommendation. is that what you have in mind:
now if i want to do something specific to f D2, i do have to index array and count wires, right?
Thanks again!
10-15-2015 10:02 AM
Hi OPC,
is that what you have in mind
You're halfway…
I would only use a cluster like you create on the right side of your image: two arrays holding names and values.
And use this cluster in the whole application: no need to bundle by name or convert cluster to array and back…
Btw. this is also halfway to using variant attributes aka key-value-pairs!
Also note that using a PtByPt-Filter like you do will result in garbage after filter…
02-03-2016 07:23 PM - edited 02-03-2016 07:29 PM
Using the Autotestware Cluster Toolkit 2.0.0.4 Cluster can contain elements of different types. VI can be modified to execute functions based on an element’s data type, name, or position in cluster.
05-30-2016 05:30 AM - edited 05-30-2016 05:34 AM
[edit : where is the delete button for dispensable posts?^^]