Hi all,
I'm currently trying to get my head around how flatten to string works in terms of using it to write a configuration file which is loaded on startup in my VI. Writing and loading the configuration file is no problem and it is working beautifully. However... this is for a data acquisition system and the configuration file stores all the calibration data in the system which is entered through arrays. Anyway, the data recorded by my VI is to be post processed using MATLAB and needs to apply the calibration data stored in the configuration file.
So I've been trying to work out how to get MATLAB to decypher the configuration file, but... I can't make heads or tails as to how the data is written into the file. I made a mock up of the saving file routine as you can see below, and run it a number of times by changing the input array dimensions and the values.

Then opened the saved file to see if I can find a pattern... but I can't! Simply changing the element values changes the number of "\ \'s" Here is what I produced from my trials:
[1x1 0]
Config=\00\00\00\01\00\00\00\00\00\00\00\00 (1x1 array of 0's)
[1x1 1]
Config=\00\00\00\01?ð\00\00\00\00\00\00 (1x1 array of 1's)
[1x1 2]
Config=\00\00\00\01@\00\00\00\00\00\00\00 (1x1 array of 2's)
[1x2 0]
Config=\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00 (1x2 array of 0's)
[1x2 1]
Config=\00\00\00\02?ð\00\00\00\00\00\00?ð\00\00\00\00\00\00 (1x2 array of 1's)
[1x2 2]
Config=\00\00\00\02?ð\00\00\00\00\00\00?ð\00\00\00\00\00\00 (1x2 array of 2's) etc. etc. etc
[2x2 0]
Config=\00\00\00\02\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00
[2x2 1]
Config=\00\00\00\02\00\00\00\02?ð\00\00\00\00\00\00?ð\00\00\00\00\00\00?ð\00\00\00\00\00\00?ð\00\00\00\00\00\00
[2x2 2]
Config=\00\00\00\02\00\00\00\02@\00\00\00\00\00\00\00@\00\00\00\00\00\00\00@\00\00\00\00\00\00\00@\00\00\00\00\00\00\00
Could someone explain to me how flatten to string flattens the array information? Particularly when the array elements are double precision? I look forward to any help that anyone can offer!
Thanks,
Stirling
Message Edited by stirlsilver on 09-08-2007 08:47 AM