02-17-2025 11:50 PM
Hello:
I use LabVIEW ini file read/write functions at various places.
I have this [Main] section where most things get written-to and read-from.
At some point, however, a bunch of KEYS and their respective VALUES get mysteriously WIPED OUT (DELETED).
I have hunted for a process that does this to no avail.
Does anyone know how this can happen?
When this happens other Keys remain. The truncation happens from a specific Key downwards.
Solved! Go to Solution.
02-18-2025 01:05 AM - edited 02-18-2025 01:07 AM
Hi Anthony,
@Anthony_L wrote:
When this happens other Keys remain. The truncation happens from a specific Key downwards.
What is this "specific" key?
Can you replicate the behaviour with a small test VI?
Are there additional comment lines in your INI file? (Lines with semicolon at the start…)
Are there non-ASCII chars in the INI file? (ASCII is defined as 7-bit values from 0x00 to 0x7F!)
Any non-readable chars other than "usual" (TAB, LF, CR, Space)?
02-18-2025 02:13 AM
Without seeing any code we can only speculate, but from your description:
You read the file in many places, maybe remember in a control (bad design) or shift register (then, why have several). You then add and write back from several places, each overwriting the previous change thus "removing" keys.
Sound about right?
02-18-2025 02:48 AM
Hello Gerd:
Thank you for taking time to look at my issue. I am at the beggining stages of troubleshooting this issue.
what happens is as if when a certain set of keys is written, it reSETS the file to have only those keys.
All keys have simple ASCII strings.
I am wondering about the TRUE default boolean on this INI CLOSE File VI.
will that RESET things?
I will continue troubleshooting and will report back further findings.
02-18-2025 02:56 AM
Thank you Yamaeda:
For taking time to review my issue. For example: Does it mean that if I have 15-keys,
Then if one process writes 5 keys does it mean that 10 keys will be deleted?
I am wondering if this is what us happening.’
for example what does boolean true do here?
02-18-2025 03:05 AM
Hi Anthony,
@Anthony_L wrote:
For taking time to review my issue. For example: Does it mean that if I have 15-keys,
Then if one process writes 5 keys does it mean that 10 keys will be deleted?
I am wondering if this is what us happening.’
The INI file functions internally buffer the keys. So you should not open the same INI file more than once in your app otherwise you create a race condition!
@Anthony_L wrote:
for example what does boolean true do here?
It will do what the help says: write the INI file when a key has changed…
You don't need to create two messages to answer. And you don't need to attach the same image twice…
02-18-2025 02:02 PM
Have you accidentally used the "Remove Section" VI?
02-18-2025 03:43 PM
The reference wire for a .ini file isn't a real reference. It actually contains the contents of the file.
If you have forked that wire, that would account for the behavior.
02-18-2025 09:09 PM
No I did not.
Looks like it was caused by a race condition as Gerd pointed out.
02-18-2025 09:10 PM
True!
A parallel same ini file read/write process was causing it.