ni.com is experiencing intermittent service disruptions.

Support teams are actively working on the resolution.

LabVIEW Idea Exchange

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

Enter Equation In Numeric

Status: New

I would like the ability to enter simple equations in numeric controls and constants. Pressing return places the answer in the control or constant.

 

Smart Numerics.png

=====================
LabVIEW 2012


17 Comments
Jason_Harrigan
Member

I'm kudoing this.....specifically for constants that keep their equations, and controls that compute the equation and keep only the decimal.

labview4steve
Member

I have an idea, make the control right clickable and then you can select it to be formula  scientitific etc....
If its in formula mode, then make it a different colour or bold or something else (and the rules based system for errors ie out of bounds will need to be relaxed) - also you will need a preview button indicator so that the calculated value is displayed so that you know its not an expression error when its an out of bounds error etc.

GregSands
Active Participant

Sounds like an XControl could get fairly close, where the data type is numeric, but the control is a string.  The smarts is in parsing and evaluating the expression (Eval Formula String.vi?).  And on the block diagram, an expression node without an input value seems equivalent.

Kyle_M
Member

I definitely like this idea. I know most cad software allows you to input expressions into the inputs, and its fantastically handy for speeding up design time. Dont need a calculator every time you want to input a value. 

Regards,

Kyle M.
Applications Engineering
National Instruments
Dragis
Active Participant

The more I think about this, the more I think we should just merge the expression node and the literal constant. If you just want a single value, you can get it, but if you want something more complex you just type it in. A little "intellisense" for finding available functions and constants would be useful. The expression node is broken down in the compiler anyway, so a constant expression will be no less constant than a, well, constant. 

X.
Trusted Enthusiast
Trusted Enthusiast

<OT>DarinK should post his suggestion of making the input of the expression node optional (BD side). It is no biggie to connect 0, 1 or anything for that matter to it, but it would seem natural that, if there is no variable in the expression, to not break the diagram because the node expects an input.

 

ScreenHunter_001.jpg

 

</OT>

 

Disclaimer: I was searching whether anybody had suggested a "constant numeric expression" option for the numeric expression node and was sent to this thread.

 

Note: I haven't kudoed THIS thread's idea because I am suspecting that it will generate unwarranted expectations from the user (such as entering 1/3 and expecting the result of a complex calculation having 1/3 as a root to lead to exactly zero and in this case not fire the rocket aimed at the surgeon operating on the lead scientist for the fusion energy experiment). If you see what I mean.

Andrey_Dmitriev
Trusted Enthusiast

I remember this trick from the pretty old desktop publishing software called "Macromedia Freehand". That was really convenient - when I need to place objects precisely, resize objects by ratio, etc, I can simply put equations into any numeric fields, and hen hit "Enter", then result calculated. Very useful for scientific and engineering applications. Kudo for this idea!

Transform.png