How about putting all constant in subVI's as discussed and then creating
a Polymorphic VI from all the individual constant VI's?  Then you only
need to drop one VI and you get access to all your constants from a
simple right click menu.  In LV7, you can even show a selector menu
right on the diagram that gives you even quicker access to all your
constants.  I've never done this, but I just tried it out and it looks
like it should work pretty well.

I think this solves both the desire for succinctness and easy access to
editing.  You can open up the poly VI, select an instance VI and edit
it.  Or edit the instance VI directly from the diagram.  Either way,
only slightly more than a *handful* of clicks.  Adding a new VI constant
could be easier.  It would be nice if the Poly VI supported having a
template from which you could easily add/create a new instance.

Sure, there is still a separate file for each constant to manage, but to
me this approach would mitigate the value editing and diagram
readability/selection issues.

The question is now whether using constants from polymorphic VI's in
this manner still benefits from the in-lining optimization?  Steve, care
to comment.

Scott Menjoulet
Texas Instruments Inc

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of George Gatling
(Contractor)
Sent: Thursday, June 17, 2004 10:55 AM
To: info LabVIEW
Subject: Re: Wanted: #define

Seems to me the general consensus is that constants should be sub-vis,
and 
since there could (will) be many of them, they can be collected together

into a subfolder under the application.  This does achieve some of the 
advantages of the #define:  the constants are collected together in one 
easy to find place, changes to the constants are easily propagated 
throughout the application, and there is little (if any) performance 
penalty at runtime.  The downside?  Well, if you told a c programmer he
had 
to have a different *file* for every constant he probably wouldn't stop 
laughing for a couple of years.  And there is considerably more of an 
editing headache... #define is a handful of keystrokes... the vi
constant 
method is about a hundred mouse clicks, editing an icon, saving a new
file, 
and bringing that file onto whatever diagram I was working on (which I
can 
remember anymore).

George Gatling
Applied Technology Division, SFA Inc.
Space Physics Simulation Chamber
US Naval Research Laboratory
202-404-5405 (phone)
202-767-3553 (fax)



Reply via email to