LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Looking for the Cleanest Workaround for a LabVIEW Bug

I'm looking for the cleanest workaround for a LabVIEW bug.
I have a library: "Localization.lvlib".
One of the files owned by that library is "L10N.ini", which contains the localization information.
Another file owned by the library is "INI Path.vi". It looks in the library to find the path to "L10N.ini".

lp.png


Separately from that, I have some Express VIs whose configuration VIs call localization; which means that (downstream), "INI Path.vi" gets called.
The LabVIEW bug is that when an Express VI's configuration runs the first time (on drop), any attempt to get a reference to a library, gets stuck.
I've tried many things; including opening a library reference from a different application context.

 

So I have to rewrite "INI Path.vi" such that it doesn't reference "Localization.lvlib".
The simplest approach would be to assume the relative path to "L10N.ini"; but I'm wondering if anyone can come up with something better.

My goal is to minimize the breakability of the project; so if I rearrange things, it still works.

0 Kudos
Message 1 of 7
(442 Views)

I think I would go with the relative path. If you want some insurance, you could probably expand it so that if the relative path doesn't work, you start searching for the file.

 

If your primary goal is to avoid breaking when moving things around in the file system, then I would consider caching the library reference and then using the cached value. The key, obviously, would be in running it once before you drop the express VI and I expect that can be done, but would require some setup (such as maybe having a class with a VI which is set to run on open, which will maybe run it when the class loads or finding a callback VI or project plugin which can run when a project opens) and I expect would be more brittle than the alternative. I haven't played with it to see if there are any options which work, but I don't think I would call it "clean".


___________________
Try to take over the world!
0 Kudos
Message 2 of 7
(385 Views)

Here's what I ended up doing.

0 Kudos
Message 3 of 7
(302 Views)

I don't know if that's cleaner, since you're still assuming a relative path from your VI to the library in the express VI case, but I suppose it does minimize the chances of problems, since it's only for a single VI.


___________________
Try to take over the world!
0 Kudos
Message 4 of 7
(199 Views)

@tst wrote:

I don't know if that's cleaner, since you're still assuming a relative path from your VI to the library in the express VI case, but I suppose it does minimize the chances of problems, since it's only for a single VI.


It assumes the relative path to the .lvlib file (which is not likely to change); but it does not assume anything about the location of the .ini file.

0 Kudos
Message 5 of 7
(145 Views)

Why make it so advanced? KISS. 🙂

Yamaeda_0-1743489510331.png

 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 7
(109 Views)

@Yamaeda wrote:

Why make it so advanced? KISS. 🙂

Yamaeda_0-1743489510331.png

 


Because I want the .ini file in a different folder than the .VI.  And I might rearrange things later; but I don't want things to break if I do that.

0 Kudos
Message 7 of 7
(78 Views)