LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW Sections and Keys in old versions are different -- Why is that?

Solved!
Go to solution

LabVIEW 8.6 saves keys in a format like this:

[thisSection]

thisKey=26.6

thatKey=12,5,76

theOtherKey=c:\workspaces\specialFile.txt 

 

LabVIEW 2018 saves keys in a format like this:

[thisSection18]

thisKey18="26.6"

thatKey18="12,5,76"

theOtherKey18="c:\workspaces\specialFile.txt"

 

Notice the addition of quotation marks on the key values.

Why was the change made?

It's causing a mess, since the client's code calls a code library which depends on the sections and keys in the original format.

Is there a backward comparability setting?

I currently am using a workaround which is to

1. close the key file

2. rename the key file (1)

3. use string VIs to remove blank lines and quotation marks from the renamed file (1)

4. write text to the original file 

5. continue processing the key file

Check out the LabVIEW 2018 code below, please.

 

 

0 Kudos
Message 1 of 5
(2,232 Views)

@Jandy wrote:

LabVIEW 8.6 saves keys in a format like this:

[thisSection]

thisKey=26.6

thatKey=12,5,76

theOtherKey=c:\workspaces\specialFile.txt 

 

LabVIEW 2018 saves keys in a format like this:

[thisSection18]

thisKey18="26.6"

thatKey18="12,5,76"

theOtherKey18="c:\workspaces\specialFile.txt"

 

Notice the addition of quotation marks on the key values.

Why was the change made?

It's causing a mess, since the client's code calls a code library which depends on the sections and keys in the original format.

Is there a backward comparability setting?

I currently am using a workaround which is to

1. close the key file

2. rename the key file (1)

3. use string VIs to remove blank lines and quotation marks from the renamed file (1)

4. write text to the original file 

5. continue processing the key file

Check out the LabVIEW 2018 code below, please.

 

 


Quotes around the value in an ini file is acceptable in some implementations; when a portion of a value is in quotes, it means "parse this part literally".  I guess LabVIEW puts strings in quotes so it doesn't get fooled into parsing a character inside the quotes as a special character.  Of course this doesn't really help you.  This is an inherent problem with ini files because there isn't really a standard.  I guess xml files would be a little more reliable (although I've heard similar complaints about LV xml implementations, also).

 

Unfortunately, I don't know how to do better than what you are describing.  😞

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 5
(2,201 Views)

Hi,

 

to expand on billko's message:

I guess LabVIEW puts strings in quotes

Yes, it does so.

Now the question is: do you save those keys as strings?

 

Atleast this one needs to be saved as string:

thatKey=12,5,76

So you might rethink your tool to generate those INI files…

 

Is there a backward comparability setting?

Quotes around strings is compatible with usual Windows INI files. The problem is that other (not compatible) EXE expecting strings without quotes…

 

I currently am using a workaround which is to

Some other workaround: did you examine the WriteKey function (in its "string" variant)? Maybe you need to create a copy (!) of that function without the AddQuotes subVI inside…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 5
(2,196 Views)

Another work around, is you could post process the file after it is done being written.  If all you want to do is remove all " characters then you could open the file with the Read From Text File, perform a search and replace setting it to replace all " with an empty string, then resave the file.

0 Kudos
Message 4 of 5
(2,168 Views)
Solution
Accepted by topic author Jandy

I do know that the configuration file library had a bit of an overhaul with LabVIEW 2009 (the version right after 8.6).  I could not tell you if this was involved in that update or not though.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 5
(2,161 Views)