01-19-2010 08:45 AM
Hi everyone
The problem is about how to get the SubVI reference in Run Time System, when the SubVI is in .exe after building.
More details:
The top vi calls the SubVI by dynamic way, so the SubVI is included always, and the source object is the application.exe.
After the setup above, the SubVI will be in the application.exe. For example, SubVI's path is ...\application.exe\SubVI.vi
So, how to get SubVI's reference in Run Time System?
I can not get it when using "open VI reference" with the path ...\application.exe\SubVI.vi in Run Time System.
Actually, I can create a file to include the SubVI, instead of build the SubVI in application.exe , then I can get the reference convenintly. But it is not my favourate way.
Thanks
chenyin
Solved! Go to Solution.
01-19-2010 11:02 AM - edited 01-19-2010 11:08 AM
Not a good way to include dynamic subVIs in executable. You lose the main interest to be able to maintain it outside your executable environment.
Or perhaps, limited interest to own a rich library of features already developed or for confidential rights. Is it?
If it isn't, you could:
- let the executable and the SubVI independant by creating a folder next your executable (think to 'Strip Path' 2 times when you want obtaining the subFolder path relatively to the executable path)
- Use 'Static VI reference' to have a direct link to the SubVI
01-19-2010 11:10 PM
thanks J.DECHET
very helpful suggestion for me.
- let the executable and the SubVI independant by creating a folder next your executable (think to 'Strip Path' 2 times when you want obtaining the subFolder path relatively to the executable path)
So, if I take method above, how to invent the users from using the SubVI for their own program?
Perhaps they will change the SubVI, so the executable will be crashed.
01-20-2010 02:30 AM
Here is the problem. Call a dynamic subVI means users could change it but it's also very attractive.
The dynamic call must be used within a user mastered but some parade can avoid problems.
It depends of why you use dynamic calls... => 2 main ways:
- Dynamic call are use to maintain an evolutive part of the code without acting on the executable => one unique VI distribution maintained by the administrator/developer
- Dynamic call are use to provide a collection of 'external' feature which could be enriched by the administrator/developer. For example, you provide to your customer a set of custom signal filters selectable in the executable.
In the 2 cases, you are only able to assess user skills to know if there is a risk of damage if there is modification.
So, to stay alone master a parade could be to provide dynamic VI without diagram but with the problem of maintenance because no modification in situ and more attention to manage distribution.
An other way is to hide the real distribution to user => call dynamic VI but unnamed it as *.vi but other (a repulsive name as OS system name ) or simply with no extension in order to not attract user... but it's questionable...
Another method more difficult but safer is to create a test of consistency ahead of your routine (version, user, modification date, ...)
01-20-2010 07:12 AM