08-03-2010 08:58 PM
I am trying to use data socket server to send and receive data from my device (a wavefront sensor) in the same computer. The data I received is in variant type, and I need to convert the variant to other data type I can use in Labview for furthur processing and computation.
The data variant I received has a lot of attributes, and the attribute I need is a 2D array. However, I can only see the size of my array in Labview, but not the numerical values. The indicator shows me
4 Attribute(s):
'Centroid_Pos_X' -> [33x41]
'Centroid_Pos_Y' -> [33x41]
'Centroids_X' -> 15
'Centroids_Y' -> 15
These four attribute should all return me an array, but they all return me the size of the array...
I tried "get variant attribute", and also "variant to data".. but couldn't get the correct data.
anyone can give me some advice?
Solved! Go to Solution.
08-04-2010 11:01 AM
Try wiring cluster of 4 arrays to data type of variant to data.
08-04-2010 01:26 PM
@KateB wrote:
Try wiring cluster of 4 arrays to data type of variant to data.
That won't work since you're dealing with the attributes of the variant, and not the actual datatype of the variant.
To poster: You said you tried "Get Variant Attribute". What exactly did you try? Did you wire a 2D array of the appropriate datatype to the "default value" input of the Get Variant Attribute function?
08-06-2010 03:08 AM
Hi, I have solved the problem. I used a "Convert variant to data" vi, and wired a 2D array to the type. I attached a snapshot of the connection.
08-06-2010 03:10 AM
Hi, the problem is solved by wiring a 2D array to the "variant to data" type terminal. you can refer to the screen snap I attached in the post above. Thanks for ur attention!
08-06-2010 08:57 AM - edited 08-06-2010 08:57 AM
You are performing an extra step that's not necessary. As I pointed out, the Get Variant Attribute function has a default value input, to which you can wire a 2D array to get your array directly: