LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Interpretation of flattended Variant

Hi,

I have files containing flattened data of the data type variant. I want to intepret this data in Matlab. How can I find out what data type is hidden behind the variant and of how many bytes it consists?

Thank you!
0 Kudos
Message 1 of 7
(3,279 Views)

Hi dwoerner,

do you mean like this? Is it the string you write to a file and which you want to read in matlab?

Mike



Message Edited by MikeS81 on 06-23-2008 08:27 AM
0 Kudos
Message 2 of 7
(3,255 Views)
Here you can see what is written to a file.
The file looks like this: [FIFO Settings]
FIFO Settings="\00\00\16Ü\14D@P\00\08\02†@ñ\00\00\00\00\10FIFOSettings.ctt\00\02R\00P\00\05\00ª@P\00\07\00\12@\09\0C

and I like to use this data in Matlab
0 Kudos
Message 3 of 7
(3,249 Views)

Hi dwoerner,

that´s only the data, afaik you need also the type string to know how to read the data.

Mike

0 Kudos
Message 4 of 7
(3,244 Views)
Thank you for your help Mike

I think my files always have the same structure so I only have to find out once which data types are behind the variants. But I don't know which length a single flattened string has. I need to know because then I will be able to cast the specific bytes as the proper data type.
0 Kudos
Message 5 of 7
(3,218 Views)
Hi dwoerner,
is it a single string or an array of strings? A single string has 4 byte for the length and then the string. An array of string has 4 byte which shows how many elements are in the array and then for every element the structure of a single string.
 
Hope it helps.
Mike
0 Kudos
Message 6 of 7
(3,208 Views)
It's a cluster, so it can be anything. I would suggest heading over to www.openg.org and downloading the OpenG Data Tools. They contain many functions that make dealing with variants a lot easier. In fact, here's a simple example.




Message Edited by smercurio_fc on 06-23-2008 09:54 AM
Message 7 of 7
(3,192 Views)