LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Conditional compiling in LV.

Does anybody know if it is possible?

Or maybe it's possible to remove VI's from memory once loaded?

I want to make a program that will have two versions, modes:a debug mode,
all the errors
will be carfuly described and presentd, and a final version for the end
user, he
does not need all the things needed for debuging.

Other example is polimorphic vi's. If i want to write a vi that will take
care of different 500 types
, if I want to us only one in my program do I really have to load all 500 vi
into memory?

Tnx for help
@D@$
0 Kudos
Message 1 of 3
(2,915 Views)
Adam Blazowski wrote:

> Does anybody know if it is possible?

Conditional compiling as you might see in text based C code? Then NO, not
the way you want.

>
>
> Or maybe it's possible to remove VI's from memory once loaded?

VIs in a program are unloaded from memmory when they are closed and
no other VI that contains them is open.

>
>
> I want to make a program that will have two versions, modes:a debug mode,
> all the errors
> will be carfuly described and presentd, and a final version for the end
> user, he
> does not need all the things needed for debuging.

This could be easily done depending on how the program is structured.
You have several options
1) Use some error handling routines to give you all the errors. In the final
version replace the VI on disk wit
h one of the the same name that does
only user error stuff.
2) Use the VI server and / or configuration files to determine what VIs
are loaded.
3) Put a case statement around the error stuff and use a global, or file
or VI server to determine which one to present. Note that this will increase
the amount of disk space and /or memory required. (as opposed to other
options).

>
> Other example is polimorphic vi's. If i want to write a vi that will take
> care of different 500 types
> , if I want to us only one in my program do I really have to load all 500 vi
> into memory?

I am not sure about these but I would say that the unused VIs will either not
get
loaded or will unload when it is determined that they are not needed.

Kevin Kent
0 Kudos
Message 2 of 3
(2,915 Views)
If you want to unload VI's after using them, you can use VI References
and the VI server. However, if you wish to reload the VI later, it will
take longer. But that can be used to determine whether or not to load a
particular VI, and may be what you are looking for.

Check the Reference manual and the function + VI manual for how to use
VI references.
0 Kudos
Message 3 of 3
(2,915 Views)