LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the SubVI(the virtual path is under .exe) reference in Run Time System

Solved!
Go to solution

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

 

0 Kudos
Message 1 of 5
(4,197 Views)

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

Message Edité par J.DECHET le 01-19-2010 06:08 PM
Message 2 of 5
(4,180 Views)

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.

 

0 Kudos
Message 3 of 5
(4,161 Views)
Solution
Accepted by chenyin

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 Smiley Tongue) or simply with no extension in order to not  attract user... but it's questionable...Smiley Wink

 

Another method more difficult but safer is to create a test of consistency ahead of your routine (version, user, modification date, ...)

Message 4 of 5
(4,148 Views)

thanks J.DECHET

I have learned a lot from you.

 

0 Kudos
Message 5 of 5
(4,133 Views)