From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
krwlz101

User Defined Math Constants

Status: Declined
Already implemented in LabVIEW. Available in LabVIEW 2010.

I feel that it would be very handy to be able to define your own math constants, and mask them similar to the ones already in labview, much the same way one is allowed to design the icon for vis.

 

In my specific case, I do a lot of heat transfer and flow modeling, making pi/4 a much needed constant (pi/4*Diameter^2).  It is clunky to have that simple division all over my vi's and masking as a subvi seems over kill.

10 Comments
elset191
Active Participant

You can do this by making a subvi and customizing it's icon, like you noted in your suggestion...

test.PNG

--
Tim Elsey
Certified LabVIEW Architect
S_Kamath
NI Employee (retired)

This seems like a prime candidate for subVI inlining. New in 2010 in the Execution options of VI Properties. That way you get the mask you want and don't have the overhead of the subVI call.

krwlz101
Member

What you can't (to my knowledge) do is make it nice, neat and small like the labview defined constants.

krwlz101
Member

OK,


Clearly I didn't do quite enough research!  My apologies.

Laura F.
Active Participant
Status changed to: Completed
 
G-Money
NI Employee (retired)
Status changed to: Completed
Available in NI LabVIEW 2010
X.
Trusted Enthusiast
Trusted Enthusiast

I am not sure I understand the "Completed" status. Do you mean that it is available via "inlining"? But then the "constant" is actually recalculated each time the subVi is executed, isn't it? Also, it would be nice to be able to drag and drop that "subVI" into the Numeric Constant Palette to really implement what I understand this idea is all about...

crossrulz
Knight of NI

@ X-) - Because of constant folding, the constant is actually only calculated at compile time.  With inlining, you also lose the subVI overhead.  Combined, these two features allow the custom constant.  You'll have to muck around with the pallettes if you want the "constants" in them.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
G-Money
NI Employee (retired)
Status changed to: Declined
Already implemented in LabVIEW. Available in LabVIEW 2010.
clendon.gibson@canrig.com
Member

Personally, I like the idea of having user defined constants in a place where the developer can find them easily.

 

While it is absolutely true that inlining and constant folding accomplish the same thing, do we expect a novice to know this?

 

In any case I appreciate the expert commentary here. I will begin using this instead of Globals since Globals can be changed at run time.