07-06-2011 06:50 PM
Hi,
there are many versions of saving and loading a control via ini/xml files.
However, most of them require casting the output into the proper cluster.
I'm trying to do it with LVM files which can contain the cluster type so I could load the control as is without the need of a casting.
However, I can't get the LVM file to save the cluster values thus I saved the values in an xml file and combiles them.
What am I doing wrong? Please help me save both the type and the value into the LVM file?
I attached the vi and a snapshot:
Thanks in advance,
Dror.
07-07-2011 09:47 PM
In essence, a LVM file is just a text file with a certain structure. You could do what you did with the "flatten to XML" function, and then save that flattened data into your LVM file. If you take a look at that flattened XML string, you'll notice that the data types are included as XML tags. You could use these and some XML parsing to re-construct the cluster without doing explicit type casting.
1. The data did get written, but perhaps not in a way that made the cluster values very easily readable.
2. The "write datalog" function sets the current datalog position to the end of the file before writing. That function isn't serving any purpose from what I can see.
3. What error do you get? -1 is just telling this function to read the entirety of the file.
4. The file reference will stick around in memory until LabVIEW is closed. It may also lock out the file so that it will not be able to be deleted. This may need to be tested, however.
5. It seems to be correct from what I can see.
6. Here's a forum thread discussing that. Hopefully it can help point you in the right direction.
7. You could do something similar to this.
I hope I was able to address all of your questions!