01-22-2019 08:24 AM
I have a class private data that has an array of clusters. I need to set the data in a class method. I tried to use the array bundle by name but that did not work. There is a step to access the array element that I must be missing. The class private data element is an array is Test, which is a cluster.
This is a snippet from the block diagram. How do I access the Test cluster from the array? Any help appreciated.
Solved! Go to Solution.
01-22-2019 08:34 AM
It seems like you managed to set the data, now you need to get it back to the class, with Replace array subset and Bundle by name.
/Y
01-22-2019 09:17 AM
I added 2 new VIs "VI for Data member access" to write and read the data. Still not able to write to the class member array cluster data.
01-22-2019 09:53 AM
What do you have in write element of test.vi?
It should be unbundle class, replace subset (make sure array has enough size, otherwise - build array), then bundle back into class.
Read is just unbundle - index array.
PS index better be blue to track rounding errors.
01-22-2019 10:46 AM - edited 01-22-2019 10:47 AM
@Alexander_Sobolev wrote:
What do you have in write element of test.vi?
It should be unbundle class, replace subset (make sure array has enough size, otherwise - build array), then bundle back into class.
Read is just unbundle - index array.
PS index better be blue to track rounding errors.
Just to elaborate a bit here on Alex's sage advice:
It won't do to just add an explicit conversion or rounding function here. Make sure that whatever is calculating this index makes the right integer choice when it comes to non-integer values. (Which may, of course, turn out to be a simple rounding function - but then at least you've thought it through and decided it's okay to round.)