LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can the Configuration File VI's be called simultaneously?

I am using the Configuration File VI's in my program to read various parameters from a single .ini-style configuration file in my LabView 7.1 program.  I've been having occasional problems where Read Key.vi fails to find a section-key pair known to be in the configuration file.  This seems to occur more often at the start of my program while a number of independent loops are all trying to read their various configuration parameters from the configuration file.  Do I need to protect my configuration file and/or the configuration file VI's (Open Config Data, Read Key, Close Config Data, etc.) from simultaneous access by different loops within my program?  If so, what needs to be protected?  Is it enough to wrap each individual call to Open Config Data, Read Key, and Close Config Data in a semaphore, or do I need to ensure that my configuration file is never accessed simultaneously by two different parts of my program?  Would it be better (and safe?) to simply open the configuration file once at the beginning of my program, and then use that reference throughout the program rather than opening the configuration file multiple times?
 
Note that I am only reading values from the configuration file.  I am not adding, changing, or removing parameters from the file.
 
Thanks.
0 Kudos
Message 1 of 3
(2,794 Views)

Yes, I think your best bet is to open one reference to the configuration file VI and use that reference in multiple places.  This should solve your race condition.

-D

0 Kudos
Message 2 of 3
(2,786 Views)
Since changing my program to use a single reference to the configuration file I haven't had any more problems with key's not being found in the file.  I think that fixed the issue.
0 Kudos
Message 3 of 3
(2,765 Views)