03-21-2012 08:15 AM
Hello all,
I have a problem with a VI server call. I am currently using LV 2011 on Windows 7. Here's the problem - I have a subpanel in a larger VI into which I drop the interface of a (potentially) stand-alone VI. The path to the called VI is good (in both the exe and in the development application). However, I am getting an error 7 when I try to use the "Open Config Data.vi". More specifically, I am getting the description that it can not find the VI in the library Load.vi (called by Open Config Data). I have tried specifically adding the whole config library into the build, but this does not seem to help. Also, the config VIs are called in the main application with no problem. Does anybody have any thoughts?
Thanks, Matt
Solved! Go to Solution.
03-21-2012 08:33 AM
How do you know the paths are good? When exactly is the error occurring in development, executable, both?
Mike...
03-21-2012 08:35 AM
the error is saying the directory structure being passed into load library is wrong, I would try using the absolute path (if your not already) for the vi and go from there. If you are using the absolute path then i would suggest checking it (you proberly have many times tho)
Hope it helps
03-21-2012 08:39 AM
Matt,
VIs which are loaded dynamically using VI Server are not detected as dependency during the build process. So you have to add them manually to your project and in the build script mark them as "always included".
hope this helps,
Norbert
03-21-2012 09:01 AM
OK - so maybe my description was not so great. First - I know that the file paths are good because when they are not, the VI run dynamically in the subpanel via a VI server call will not load (there will be nothing in the subpanel). In this case, it loads and is running (can check this through debugging). Second, the error is occurring in both the exe and in the development system. The absolute path (although this is not an issue - see previous comment) is not possible given that this is built into an installer and deployed on other platforms (on which the directory structure is not necessarily duped). And finally, the VI that is loaded dynamically is already in the "always included". I don't have a problem calling and running this VI, the error crops up when I attempt to use "Open Config Data.vi" in that is called by that VI. This VI that is not loading (Load.vi) is located in the NI library NI_LVConfig.lvlib (located on the disk under the folder vi.lib). I currently have a workaround for this, but it is not the best (a pop-up dialog comes up that allows the user to configure everything from the UI rather than from the config file).
One thing that may help that I neglected to mention is that, in the development environment, I can run the calling VI one time and I get the error. However, in subsequent runs, I do not get the error.
Thanks for all of your responses. I hope this further explanation helps.
Cheers, Matt
03-21-2012 09:11 AM
Could you post an example project showing the issue?
Norbert
03-21-2012 09:36 AM - edited 03-21-2012 09:37 AM
Norbert,
I don't know if this will help - I can't post the code because it is too big at this point and pulls in too many device and config requirements, but here are some screen captures. The first is the code for the main VI where the VI called 'RH Interface.vi' is opened and run dynamically (the reference is used to populate the subpanel 'thermPanel'). The second shows the source for 'RH Interface.vi'; the red circle indicates where the VI bombs. The subvi called uses a file input called 'ConfigPath' as input to 'Open Config Data.vi'. This is where I get the error 7. The subsequent case strucutre with the error input is used to handle the case where the config file is not properly opened. There is nothing special about opening the config file; it is done in the main program also.
Thanks for all your help. Matt
03-21-2012 09:55 AM
Matt,
that screenshots are too small for identifying anything.
Nevertheless, it seems to me that there is no issue of the exe finding a vi, but finding a *.cfg file. Could you verify?
If so, you have to make sure that the cfg/ini file is within the expected location.
Norbert
03-21-2012 09:56 AM - edited 03-21-2012 09:57 AM
Norbert -
The config file is found - the vi 'Load.vi' is not found. I will try to fix the image shots.
m
edit: here are the pngs for the screen shot
03-21-2012 09:59 AM
So the first thing I noticed with your screen shots is that you are trying to feed in the config file path through a local variable. I wouldn't recommend doing that. I bet you are running into some kind of race condition where you load the VI into the sub panel before the local variable is populated with the path value. That would explain why this is happening in both the development environment and executable.
Dataflow work everytime, even if its in a way we don't want it to. So I'd recommend forcing the initialization of the config file path value before you load the VI into the subpanel. Use the error wire to ensure this happens!