LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

alternative to flatten to string?

I have some problems with the flatten to string function. The labview function does not convert arrays or strings in its byte to byte counterpart. As explained in the manual it adds a 4 byte integer in front of the string and n 4 byte integers, one for each dimension of the array in front of the array. Consequently the flatten to string result of a 10 character string is an array of 14 bytes and not of 10 bytes. The situation is even more complex when clusters are used. Is there a function or subvi that performs what I need? I can understand the reason why the labview function behaves like this but I still need something different.
Thank you very much for your cooperation.
Massimo
0 Kudos
Message 1 of 3
(2,952 Views)
I'd consider breaking your cluster into its individual element types of numbers, strings, arrays, etc. Then use the conversion VIs which apply for each element type (eg: Byte Array to String, Format Into String, To Decimal, From Decimal, etc.) - as applicable. Most of these VI are in the String and/or Numeric Palette, under Conversions. You can use the Concatenate Strings VI to put them all back together if needed. Good Luck, Doug
0 Kudos
Message 2 of 3
(2,952 Views)
I find that typecast under the "Advanced" menu is usually a better choice. Try that. It's the square peg going into the round hole.
Message 3 of 3
(2,952 Views)