pawel wrote:
> Take a look on the enclosed vi. TypeCast will not accept this datatype,
> even though in help is written that it accepts everything. When you remove
> string from the cluster, it will work. Why it can not accept a string
> inside a cluster?
This is expected behaviour. Typecasting only works on flat data by
definition. This is a limitation of LabVIEW put in on purpose. What
should the result be here?
You seem to expect the C behaviour where the embedded string would count
for four bytes for the pointer (well it really is a handle in LabVIEW
anyhow). However this C behaviour makes no sense in LabVIEW, as LabVIEW
does strictly speaking not support pointers at all in its language
definition. And embedding the variable sized string or array into the
typecasted byte stream would make the bytestream impossible to reverse
typecast as it would miss the information as how long the string must
be. That is why Flatten can work on non-flat data and does add extra
int32 values in front of each variable sized data element so the
bytestram can properly be unflattened later on.
Rolf Kalbermatter
Rolf Kalbermatter
My Blog 
DEMO, Electronic and Mechanical Support department, room 36.LB00.390