06-19-2013 07:45 AM
The benefit of the XML ofcourse being that you CAN read and change it with notepad, should you need to and no 3rd part code.
It should also work if you make some changes to the cluster, in which case a binary file breaks.
Normal ini-files are prettier and easier to read though. 🙂
(I've made a general ini-file handler, probably similar to the open-g one, though i haven't looked at that one.)
/Y
06-19-2013 07:43 PM
A word of caution - if you have a cluster directly "Write To Binary File" and you later change the cluster, all your previous config files will be useless - in fact you unknowingly may start getting corrupted data even if you changed something in the cluster order. XML or text-based is readable by all but it can be made to have the benefit of being forward and backward-compatible.
-DP
(If you don't want others to read your text file, just encrypt the data before you write it in a config file and decrypt when you read it back - you could use something simple, or more involved like SHA1/MD5+salt.)
07-15-2013 03:57 PM
@BTC_Admin wrote:
A word of caution - if you have a cluster directly "Write To Binary File" and you later change the cluster, all your previous config files will be useless - in fact you unknowingly may start getting corrupted data even if you changed something in the cluster order. XML or text-based is readable by all but it can be made to have the benefit of being forward and backward-compatible.
-DP
(If you don't want others to read your text file, just encrypt the data before you write it in a config file and decrypt when you read it back - you could use something simple, or more involved like SHA1/MD5+salt.)
I've been using the OpenG config files for years. I tried XML once and had some real problems. In OpenG if I change or remove one control I'll lose that value until I write to the new value. In XML all of the values would vanish or would not be unreadable or even crash the read vi. XML has it's place but not storing control default values.
07-16-2013 10:01 AM - edited 07-16-2013 10:02 AM
@PaulG. wrote:
I've been using the OpenG config files for years. I tried XML once and had some real problems. In OpenG if I change or remove one control I'll lose that value until I write to the new value. In XML all of the values would vanish or would not be unreadable or even crash the read vi. XML has it's place but not storing control default values.
Just to clarify - this problem has nothing to do with XML. XML is simply a representation format and has nothing to do with whether you do or do not lose old values when you change the cluster. NI's built-in R/W XML schema primitives don't save the old data (at least not the last time I looked, and I doubt this changed), but I believe JKI's EasyXML does (although it's been years since I played with it).
It's simply a matter of implementing the code which will know to only load the relevant values on load, not a matter of the save format itself.
07-16-2013 10:16 AM
When I use OpenG to read/write cluster values via Config I have no issues at all when I change the cluster, except for losing the data for that one changed control. I can still read from the remainder of the control. Maybe I was doing it wrong but when I tried the same thing with XML I would get errors and lose all data from the cluster. XML just seemed to be a little too wonky and sensitive to changes to the cluster.
I banged on it for an hour or two and just gave up. It wasn't my code to begin so I re-wrote that portion to OpenG.
07-16-2013 10:41 AM
@PaulG. wrote:
When I use OpenG to read/write cluster values via Config I have no issues at all when I change the cluster, except for losing the data for that one changed control. I can still read from the remainder of the control.
I know. That's exactly the reason why I also use those VIs. My point was that the reason this wasn't happening when you were using XML had nothing to do with XML as a format, but was simply a matter of the code used to read and write. Like I said, I think EasyXML does keep the values.