Eugen Graf Posted February 23, 2007 Report Share Posted February 23, 2007 Hello, my question is: how can I realize Flatten To String with little endian byte order for 7.x LabVIEW versions? I tryed Swap Bytes and Type Cast VIs, but it fits only interegr data types and not floating point numbers. Eugen Quote Link to comment
robijn Posted February 23, 2007 Report Share Posted February 23, 2007 QUOTE(Eugen Graf @ Feb 22 2007, 03:28 PM) Hello, my question is:how can I realize Flatten To String with little endian byte order for 7.x LabVIEW versions? I tryed Swap Bytes and Type Cast VIs, but it fits only interegr data types and not floating point numbers. Eugen Hi, Flatten to string and friends are independent of machine type. So you can use the same data on both Macs and PC's. Flatten/unflatten does the big/little endian rearranging for you. Joris Quote Link to comment
Eugen Graf Posted February 23, 2007 Author Report Share Posted February 23, 2007 QUOTE(robijn @ Feb 22 2007, 05:00 PM) Hi,Flatten to string and friends are independent of machine type. So you can use the same data on both Macs and PC's. Flatten/unflatten does the big/little endian rearranging for you. Joris Thanks, I know, but this feature for this VI is only available for 8.x versions. I can't convert data from big endian to little endian in 7.x. Quote Link to comment
Mellroth Posted February 23, 2007 Report Share Posted February 23, 2007 QUOTE(Eugen Graf @ Feb 22 2007, 03:28 PM) Hello, my question is:how can I realize Flatten To String with little endian byte order for 7.x LabVIEW versions? I tryed Swap Bytes and Type Cast VIs, but it fits only interegr data types and not floating point numbers. Eugen If you want to change the byte order in a DBL (e.g. to Little Endian byte order), you can always typecast to an array of U8. For Little Endian, just reverse this array and typecast back to DBL http://lavag.org/old_files/monthly_02_2007/post-5958-1172161029.png' target="_blank"> /J Quote Link to comment
Eugen Graf Posted February 23, 2007 Author Report Share Posted February 23, 2007 QUOTE(JFM @ Feb 22 2007, 05:18 PM) If you want to change the byte order in a DBL (e.g. to Little Endian byte order), you can always typecast to an array of U8.For Little Endian, just reverse this array and typecast back to DBL http://lavag.org/old_files/monthly_02_2007/post-5958-1172161029.png' target="_blank"> /J Oh, thanks, but I want to handle any data undependent on type. So I want to replace Flatten To String with my own VI, that has the same functionality and works under 7.x versions. The problem is, I have a lot of big clusters with different datas, so I don't want to handle every element others, I want only one VI, that converts every data type. Eugen Quote Link to comment
Eugen Graf Posted February 23, 2007 Author Report Share Posted February 23, 2007 No more ideas? Quote Link to comment
robijn Posted February 23, 2007 Report Share Posted February 23, 2007 QUOTE(Eugen Graf @ Feb 22 2007, 05:30 PM) Oh, thanks, but I want to handle any data undependent on type. So I want to replace Flatten To String with my own VI, that has the same functionality and works under 7.x versions. I don't understand you. I was not talking about LV8 specific behaviour, the platform independent flattening was there at least from version 5. QUOTE(Eugen Graf @ Feb 22 2007, 05:30 PM) The problem is, I have a lot of big clusters with different datas, so I don't want to handle every element others, I want only one VI, that converts every data type. Well, you can connect the various datatypes to the flatten function, but I don't understand why you want to do flattening AND big/little endian reordering. Just flatten and the resulting string can be unflattened on any platform. You talked about a subVI, maybe you can create one that works with any datatype by using a variant as input. Joris Quote Link to comment
jpdrolet Posted February 23, 2007 Report Share Posted February 23, 2007 QUOTE(Eugen Graf @ Feb 22 2007, 02:24 PM) No more ideas? Try this VI. It uses the Variant Data Tools to recurse into any structure and swap endianess of numbers Quote Link to comment
Eugen Graf Posted February 24, 2007 Author Report Share Posted February 24, 2007 QUOTE(jpdrolet @ Feb 22 2007, 11:26 PM) Try this VI. It uses the Variant Data Tools to recurse into any structure and swap endianess of numbers Yes, I am happy now. Thanks a lot. :thumbup: Eugen Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.