01-17-2014 05:02 AM
Hello,
I am having a problem with variant array conversion.
A VI gets a 1D array of generic data type as variant. This VI generates a 2D array of this and passes this to a third VI which has to write that data into a 2D array by the "Value" Property as variant of a control element.
I somehow cannot convert the 1D array of variant into a 2D array of data.
I can demonstrate it with a simplified VI that is demonstarting the problem.
I hope someone can help me out.
01-17-2014 05:03 AM
The vi
01-17-2014 05:33 AM - edited 01-17-2014 05:35 AM
You cannot directly convert an array of variants (of 1D arrays) to a 2D array. "Variant to data" accepts a variant, not an array of variants.
What are you actually trying to do with all this?
01-17-2014 05:34 AM
01-17-2014 06:22 AM
01-17-2014 06:54 AM
Sorry, my example doesn't reall describe what I need to do.
I created a new example. The VI architecture is fixed and the data generated by Sub 1 is generic. It can be numeric, string, bool..
I nned to be abl eto write the 2d array by reference to the control and hope somehow to do it without another conversion step.
Thanks
01-17-2014 06:55 AM
Somehow cant attach zip files
01-17-2014 10:39 AM
Your first problem is that you want to put a string into a numeric indicator. That's not gonna work.
A smaller problem is the way you're putting the array of variants into another variant in sub 2. This works if you change the False constant to True in sub 1:
01-17-2014 11:25 AM
Jim
sorry for the confusion with the boolean constant. It was meant to write the numeric values.
I found a workable solution for me. It works, when scalar valuse are converted to variant and then arrays of variant are built.
01-17-2014 11:43 AM
How are you going to handle this?
@DAckermann wrote:
[...] the data generated by Sub 1 is generic. It can be numeric, string, bool [...]