LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write to file Question

Solved!
Go to solution
If you are going to reuse the cluster anywhere in your application and especially if you will be using it as a parameter to subVIs you should always use a typedef. Your typedef does not have to be the data you display on the front panel. You can pull out the values that you need and only display the pertinent data. However, a typedef is a MUST when you are reusing the data type in your application. It is the only way to ensure that everything gets updated properly and that all references to that data are in sync.


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 21 of 33
(1,507 Views)

Right, I've got it type def'd.

 

I don't think that's what's holding me up right now.  

 

My issue is with the ini file, and failing to read and write.

0 Kudos
Message 22 of 33
(1,506 Views)
Alright, this just isn't working, I think I'll try the xlm route.
0 Kudos
Message 23 of 33
(1,504 Views)
Solution
Accepted by krwlz101

krwlz101 wrote:
Alright, this just isn't working, I think I'll try the xlm route.

The problem is that you're never closing the file. You need to call the Close Config Data VI with the "write" set to True.

Message 24 of 33
(1,490 Views)

THANK YOU!

 

I wish I could give you more than one Kudos smercurio!

0 Kudos
Message 25 of 33
(1,486 Views)
Alright, last question for this issue.  I see where it is easy to obtain the section names, however I'm not sure how to get them into a list/combobox/menu ring, etc.
0 Kudos
Message 26 of 33
(1,481 Views)
Use the Strings[] property or the Item Names[] property, depending on which control you're using. The LabVIEW Help has information on the available properties for each type of control.
0 Kudos
Message 27 of 33
(1,475 Views)
Got it.  Don't know why I always forget about property nodes.
Message 28 of 33
(1,474 Views)

krwlz101 wrote:
Got it.  Don't know why I always forget about property nodes.

Hey,  You're still learning!  you won't always forget Smiley Wink

 

Nice thread- sorry it took me so long to check back in.  Glad the others showed up with good advice for you.   

 

 That being said-  I'll chime in on a couple of points that Christian and Mark debate:

  1. INI vs XML-  XML is quite powerful and widely used.  understandng the schema (the "formatting Rules") is key to unlocking the power of XML.  IMHO there is not a true standardized schema with univesal acceptance so the format is too limited in scope for a truely portable solution.  you can't garantee the LV XML schema is compatable with VB,  MS Office apps, c# etc....  Maybe someday..  but certainly a structure form to watch!  .ini on the other hand lacks some ability in that there is no native way to format a complex data structure.  Ben has posted a solution to this and I have overcome the shortcommings in other manners as well but you need to code the solution to write data structures to an ini.  My preferance TODAY is to go with the .ini as its human readable (with notepad).  LabVIEW itself uses a .ini for configuration settings. 
  2. TO OpenG or not to OpenG whether tis better to suffer the slings and arrows.....  It there - Its open - its free.  And its there today.  As a guide for reuse code its great!  I'll "waste the time" to code my library simillar but do not use the library myself.  Maintainablity is my only isssue with it.  With all due respect to the OpenG community (Truely- my hat's off to them all) there is no mandate for maintaing the code and my NI SSP is paid up.  

"Should be" isn't "Is" -Jay
Message 29 of 33
(1,408 Views)

Jeff Bohrer wrote:

 That being said-  I'll chime in on a couple of points that Christian and Mark debate:

  1. INI vs XML-  XML is quite powerful and widely used.  understandng the schema (the "formatting Rules") is key to unlocking the power of XML.  IMHO there is not a true standardized schema with univesal acceptance

There is no standardized schema for XML. There was never meant to be one. The XML spec doesn't define what your schema is supposed to be. That's for you to decide based on what information you have to transport. Remember that the initial purpose of XML was to provide a generalize encoding method to transport information. Given that, how can there be a standardized schema when there is no standardized information?

 

 


... so the format is too limited in scope for a truely portable solution.

 

Too "limited in scope for a truely [sic] portable solution"? This I disagree with 100%. I think you have a basic misunderstanding of the purpose of XML.

 


you can't garantee the LV XML schema is compatable with VB,  MS Office apps, c# etc.... 

 

Why should the LV XML schema be compatible with VB, Office, or anything else for that matter? Consequently, there is no reason why the reverse should be true.

 


Maybe someday..  but certainly a structure form to watch! 

XML doesn't need to be watched anymore. It's been around for more than 10 years. I think it's proven itself quite well.

 

 


My preferance TODAY is to go with the .ini as its human readable (with notepad).  LabVIEW itself uses a .ini for configuration settings. 

XML is just as human-readable as INI files. Besides, what difference does it make what format is used by LabVIEW for configuration settings?

 


  1. TO OpenG or not to OpenG whether tis better to suffer the slings and arrows.....  It there - Its open - its free.  And its there today.  As a guide for reuse code its great!  I'll "waste the time" to code my library simillar but do not use the library myself.  Maintainablity is my only isssue with it.  With all due respect to the OpenG community (Truely- my hat's off to them all) there is no mandate for maintaing the code and my NI SSP is paid up.  

I don't quite understand your point about maintaining the library. It seems as if your point is more general in that it relates to open-source code, rather than OpenG specifically. 

Message 30 of 33
(1,402 Views)