Eval formula VI

I am trying to input a formula from the front panel and have the eval formula node VI evaluate the formula - I keep getting errors from the VI.
I finally duplicated the formula (and variables) from the example in the help for the VI, and created a barebone VI to see if there was any other problem, but I still get the same set of errors - "Wrong variable name" or "Bracket at end" problem.
I have attached the sample VI I made - anyone have any idea as what I'm doing wrong? I'm using LV 6.1, in WIn2K.
Thanks.
Attachments:
evalformula.vi ‏33 KB

I had the same result - however, since I was still having problems with my actual VI, I went ahead and fiddled some more - it looks like labview has a problem with the input variable names being too long or too complex or something.
I get the 'bracket' or 'wrong variable name' error when I have my input variables named "xx1" or "ch1", but no errors when I name then "x1" or "c1".
I've attached the modified sample VI again for anyone to see if I'm doing something wrong...
Attachments:
evalformula.vi ‏38 KB

Similar Messages

  • Really need Min(a,b) and Max(a,b) function in "Eval formula node"

    Hi all,
    I've been using the 'Eval formula node" to let the user of my app configure his own calculations,
    but now I've found out that the "Eval formula node" doesn't support these functions.
    e.g        y= min (a,b)
    or         y = max (a+3, c-4)
    I considered adding them myself to the Eval formula node's subvi's,
    but franckly I've never seen such complex subvi's :-)
    Is pretty urgent. Any ideas?

    MegKB wrote:
    Maybe the MathScript node is the way to go now, as long as you want to install MatLab.
    The MathScript node does NOT need Matlab.  It runs Matlab-like code, but it is totally inside of LabVIEW.  There is a Matlab node that uses ActiveX to run Matlab.  For that you need to have Matlab installed.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Why do in-line conditiona​l expression​s work in Formula Node but not in 'Eval Formula Node.vi'?

    'Eval Formula Node.vi' and a standard Formula node seem identical in most respects in terms of their functionality, however I'm stumped by the case of inline conditional expressions. 
    I'd like to read in a string in the syntax "(expr)?(expr)expr)" from a text file and recieve the output as a double.
    The subVI seemed like the perfect tool since I was already using it to interpret a number of other calculations within the text file, however in this case the behavior is not as expected.
    Has anyone else ever tried this? is there a different syntax needed between the two tools?
    Are there other features of the Formula Note not replicated by this VI?  (so I can avoid them in future)?
    For simplicity I've attached a little demo of the behavior.
    I am currently working in 2010, which I know is getting on in years.
    If the behavior is improved in later versions, that may be a good excuse to upgrade :-) 
    Thanks,
    Elaine R.
    Attachments:
    Conditional Formula Node demo.vi ‏13 KB

    .aCe. wrote:
    Eval formula Node does not do any conditional expressions as far as I am aware.
    That is right. It's a rather dirty hacked VI library to do some formula evalution and has many limitations in comparison to the Formula Node including no support for conditional operator as well as some others. In addition it can also error on some more complex bracketed expressions.
    It is an old example VI that was never revisited and probably never will be as writing a new one from scratch would be easier. But considering that the Formula Node and Mathscript and other possibilities exist, this is not likely going to happen soon.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How can I programatically perform a conditional formula in "Eval Formula Node"?

    Okay, I'm stumped. I have an application where I need to evaluate a conditional programatically, and I can't do it with a Formula Node.
    Basically, my user wants to be able to enter some formula which describes conditionals, such as "if this temperature goes above X degrees or this temp goes above Y degrees, then take a reading" kind of thing. Since the conditional will be saved in a file, the formula node needs to be dynamic.
    I've used the "Eval Formula Node" before, which is built for this type of application...sort of. I tried it, but after trying in vain to get it to work properly, found out that it doesn't do boolean and conditionals in its parser, so it won't work.
    Does anyone
    have a good idea how to do this??

    Why do you even want to use the formula node at all? I don't think you "can take a reading" (i.e. interact with hardware) inside a formula node anyway.
    The formula node allows conditionals, see e.g. the example in the online help (image attached).
    You could also use a case structure with seperate formula node in each case.
    I highly prefer to skip the formula node and use wires instead. It will be more efficient and also much easier to debug. A formula node is not "in the true spirit of LabVIEW" ;-)
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    FormulaNode.gif ‏2 KB

  • Eval formula node expression​s

    Hi
    What are the acceptable formula inputs for the Eval Formula Node VI?
    The help files do not mention much. It took me a long time to work out that 2*pi needed to be written pi(2).
    I would also like to know if I can perform 'if' statements and what the correct syntax is.
    My application uses two inputs (an integer and a voltage reading), a formula that the user enters (eval formula node vi), and an output number (DBL).
    UniSA, Mawson Lakes, South Australia - LV 8.6.1
    Attachments:
    FormulaNodeExampleLV8_6.vi ‏12 KB

    Hi mikie121
    Take a look here. The  syntax, operators, and functions links will be what you are looking for.
    Joe Daily
    National Instruments
    Applications Engineer
    may the G be with you ....

  • Why do I receive Error -23088 when using the Eval Formula Node.vi (LV6.1)?

    Hi,
    I want to evaluate formulas like x=v>20; with that vi. When typing the
    same formula into an normal Formula Node I get the correct answer. When
    changing the formula into x=v+20; the eval Formula node.vi works fine.
    But whenever I try to resolve a boolean function like that mentioned
    above, I receive that f****n Error! Why this? What can I do? Is the Eval
    ... .vi less powerfull than the normal node?
    Thanks for your help,
    Daniel

    Joel A wrote:
    > I think the boolean (binary) ops are the only difference between the two nodes.  I pulled this from the help:
    > Formula Node and Expression Node Functions
    >
    > The following list contains the names of the Formula Node and Expression Node functions, and their descriptions. Except for the binary functions, you also can use these functions with <a href="gmath.chm::/Parser_VIs.html" target="_blank">Formula VIs</a>. All function names must be lowercase. You also can use <a href="mk:@MSITStore:C:\Program%20Files\National%20Instruments\LabVIEW%208.0\help\lvhowto.chm::/Precedence_of_Operators_in.html" target="_blank">operators</a> and the pi constant in Formula and Expression Nodes.
    > Start at the help above, and see if you can find any helpful information.
    > &nbsp;
    > &nbsp;
    > J
    Thanks for help,
    I solved the problem by using the "Parse Arithmetic Expression.llb" from
    examples. You can modify it and add the operators you need..

  • Eval formula node vi cannot work with simple math functions

    Hi I have problem using eval formula node.
    And it produces error.
    The formula is AI0=AI0-AI6; AI1=AI1-AI6; AI2=AI2-AI6; AI3=AI3-AI6; AI4=AI4-AI6; AI5=AI5-AI6;
    Pls see the attached. I am using LV 7.1
    Pls help. Will be grateful for your help
    Clement
    Solved!
    Go to Solution.
    Attachments:
    eval_formula_test.vi ‏29 KB

    Yes, the problem are your variable names.
    Can you give us a bit of background why you want to do such a complicated and inefficient method for such a simple operation. The same could be done trivally with exactly three primitives (index array, array subset, subtract) and no purple at all.
    LabVIEW Champion . Do more with less code and in less time .

  • Can't get a delimiter between Reapting Table Fields using the Double Eval formula.

    I have a problem in setting up the "Double Eval" formula, for a repeating table field.
    Background:
    I have a multiple-selection list box in an InforPath (2010) form. I want to concat all selected values in the list box and display them in a textbox with ";" as delimiter. I've gotten so far that with rules running when the list box is updated, the
    textbox content is updated listing the IDs of the selected items (I'm not sure yet if I want to display the IDs or make a lookup for the true text values, but that's another issue for later...).
    Problem:
    My problem is that I can't get the delimiter between the values. They are all listed in sequence with the ";" delimiter only at the end.
    I use the following formula ("Required" is the repeating field)
    eval(eval(Required; 'concat(., ";")'); "..")
    and get the following result:
    What I want to get into the comments text box is the string "684;239;91;".
    Any ideas what's wrong with my formula?
    (Using InforPath 2010 on a list published to SharePoint 2010.)

    Additional info that maybe is important to know:
    The multiple-selection list box is getting its values from a secondary data connection using a web service call:
    http://MySite/_vti_bin/ListData.svc/MyList?$filter=((CT%20eq%20'Product')%20and%20(CompGroup%20ne%20'OS'))&$orderby=Title
    The selections in my list box is yet stored in the field "Required" in a different SharePoint list, we can call it "BaseList", at the same site ("MySite").
    So to summerize:
    List 1: MySite/MyList
    Fields: CT, CompGroup, Title
    List 2: MySite/BaseList
    Fields: Required
    The different lists have more fields of course, but no need to list them all.

  • フォーミュラノード解析(Eval Formula Node.vi)について

    LabVEW2013
    Eval Formula Node.viに式を与えて計算させようとすると「エラーコード-23087が不明位置で発生」しました。
    同じ式をフォーミュラノードに与えると正常に計算し結果が出ました。
    2日ほど試行錯誤して、変数名に大文字が含まれるとParse Formula String.viが構文解析に失敗することがわかりました。
    mu=T1+P1;
    はエラーになりますが、
    mu=t1+p1;
    はエラーになりません。
    大文字が含まれる変数名も受け入れる様に改良されることを望みます。
    解決済!
    解決策の投稿を見る。

    これは仕様なのでしかたがないと思います。
    http://zone.ni.com/reference/ja-XX/help/371361J-0112/gmath/variables/
    http://zone.ni.com/reference/en-XX/help/371361K-01/gmath/variables/
    フォーミュラ解析VIで使用できるのは、以下の変数のみです。
    メモ  これらの変数は、「非線形カーブフィット」VIのフォーミュラ文字列の説明の指定にも使用されます。
    a, a0, ..., a9
    b, b0, ..., b9
    z, z0, ..., z9
    変数名と関数名には小文字だけを使用できます。大文字はエラーとして解釈されます。
    指数表記法のすべての数値では、1E-1の規約(大文字のE)を使用します。1e–1 を使用すると、エラーメッセージが表示されます。
    下記の製品および機能の提案で投稿すると実際にLabVIEWを開発しているエンジニアが意見を見てくれますよ。
    http://forums.ni.com/t5/LabVIEW-Idea-Exchange/idb-p/labviewideas

  • フォーミュラノード解析(Eval Formula Node.vi)で使える関数について

    LabVIEW2013
    http://forums.ni.com/t5/NI%E8%A3%BD%E5%93%81%E3%83%87%E3%82%A3%E3%82%B9%E3%82%AB%E3%83%83%E3%82%B7%E...
    の続きみたいな感じで、たぶん仕様を理解できていないのかも知れません。
    フォーミュラノード解析でxのz乗をプログラムしたいのですが、
    y=pow(x,z);
    とするとエラー(-23095)「関数が無効です」となってしまいます。
    xのz乗をプログラムするにはどの様にしたら良いでしょうか?
    解決済!
    解決策の投稿を見る。

    うぉ、ありがとうございます。
    c言語ライク→ハット→ビットごとの排他的論理和と思っておりました。
    演算子は懐かしのBASICライク?
     排他的論理和はどうやって記述するのだろう?
    どうもmod, maxなど引数をふたつ取る関数はエラーになるっぽいことがわかりました。
    ためしに
    y=x%z;
    と書いて見たらエラーになりました・・・
    計算式そのものをパラメータとして設定したいという要望があり、「Eval Formula Node」が使えると
    思ったのですが、悩まし過ぎます。

  • Does anyone know if there is a list of the functions/statements that can be used in the formula parsing (used in the VI Eval Formula String)? I

    have figured out a few already (ln(x), log(x), x^y, sin(x), asin(x), sinh(x), asinh(x), sqrt(x), pi(x), exp(x) ) but a complete list would be very useful. At the moment I am trying to figure out if it can handle factorials (x!). Any ideas? I am using LV6i.

    have figured out a few already (ln(x), log(x), x^y, sin(x), asin(x), sinh(x), asinh(x), sqrt(x), pi(x), exp(x) ) but a complete list would be very useful. At the moment I am trying to figure out if it can handle factorials (x!). Any ideas? I am using LV6i.Such a list is in Chapter 1 of the "G Math Toolkit Reference Manual". Please note that there are some differences to the formula node. Therefore, the help on the formula node lists some functions, that do not work with the Parser VIs.
    You can get the G Math manual from: www.ni.com/manuals
    Just search for "math".
    Hope this helps!
    Robert Buhrke, Systems Engineer
    Contact: [email protected]

  • Labview eval formula node with VI

    The VI has been attached this time
    I really have no idea why it doens't work
    please help
    thanks
    ====================
    =Labview 7.0 & 8.0 & 8.5=
    =====================
    Attachments:
    Untitled.vi ‏37 KB

    It seems to work fine. Make sure that all inputs are defined. I have attached your example showing some simple inputs set as default values, just run it and see.
    (E.g. remember that "variables output" is actually an input that needs to be defined!)
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Formula.vi ‏29 KB

  • Eval Formula Node variable names

    I am using the Evaluate Formula node to allow programatic changes to formula
    in my data acquisiiton VI. Has anyone built any code to enable using full
    descriptive names as variables, instead of the a0 to z9 that this VI limits
    you to?

    You can replace full decriptive names with short names like a0...z9 using Substitute Variables.vi, which you will find at 'Mathmatics'->'Formula'->'Advanced Formula Analysis'.

  • Eval Formula Node VI in exe version

    Hi everyone, The
    node function I have used without problem in my applications, the problem
    arises when I generate an executable of my application, the text fiel shown in the panel can not be edited.
    I've also had delays when
    I type equations like this:
    T= 13.75-1.026*10^5/(X-1)+2.767*10^8/(X-1)^2-3.408*10^11/(X-1)^3+1.929*10^14/(X-1)^4-2.894*10^16/(X-1)^5;
    X is a vector of 1x400.
    The processing capacity is limited node function?,
    as I can give more processing power.

    I'm not quite sure what you are asking, but you could try this if X is a vector:
    Is this what you were looking for?
    This will step through your array (vector) one element at a time, so it doesn't really matter how large the array is, assuming you are careful in other parts of your application.
    Cory K

  • "Eval Parsed Formula Node VI" does not return outputs in predefined order

    I make a data analysis program, where the data consists of some million events and each event has e.g. 4 channels and 1-5 hits on each channel. 
    I would like the user to select different expressions of these channels to give coordinates to plot in a 2D histogram (increment a bin in Intensity Graph), e.g. for some experiment you want to show x=ch1-ch2; y=ch1+ch2+ch3+ch4; while in another experiment you want x=ch1-123; y=123-ch2;
    There are other VIs that use static LabView-code for the normal things, but now after a few years of adding to this program I find that it would be quite good with a general plotter and let the user specify simple expressions like this. Also with the "normal" static plots, there is a need to filter out bad data and then it would be much simpler both to program and use if you could write text expressions with boolean logic to combine multiple filters. Making a LabView code and GUI that allows AND/OR/parenthesis combinations of expressions will be quite an effort and not very reusable.
    So, with the above motivation, I hope you see that it would make sense to have a useable string formula evaluator in LabView. I find some info about MathScript's user-defineable functions, but haven't managed to get MathScript working in LV2010 yet (maybe some licensing or installation issues, I think I had it in 8.6). But I think it would be possible to do most of what I want for the display-part (not the filtering) with the simpler Eval/Parse Formula Node VIs and suitable use of the limited variable name space. So I started testing, and found a quite annoying issue with how the evaulator works.
    To the parser, you are expected to send an array of output variable names. But then it ignores this array, and returns one output per assignment/semicolon in the formula, in the order of the formula text. Since the static parts of my program need to know what the output values mean (which of them is x and which is y), I would have to rely on the user not using any intermediate variable and defining x before y. The attached screenshot demonstrates the problem, and also that it has been solved by NI statff in the "Eval Formula Node VI" which does the appropriate array-searching to extract only the pre-defined outputs, in their expected order. But using that VI is about 100 times as slow, I need to pre-compile the formula and then only use the evaulator in the loop that runs over a million events.
    I don't know if I'll take the time to make my own tweks to the parsing stage (e.g. preparation of array-mapping to not have to repeat the search or maybe hacking the output list generated by the parser) or if I'll have to make it in a static Formula Node in the block-diagram (which supports more functions), so that the user has to run with development environment and stop the program to change the plotting function. But I wanted to share this trouble with you, in hope of improvments in future LabView versions or ideas from other people on how I could accomplish my aim. I have MATLAB-formula node possibility too, but is far as I have seen the only place the user could update the formula would then be in a separate .m file, which is re-read only when typing "clear functions" in the Matlab console window. (Having this window is also an annoyance, and perhaps the performance of calling Matlab in every iteration is not great.) 
    Besides this issue, it also seems very strange there is virtually no support for conditional expressions or operators in Formula Node evaulated formulas (called Mathematics VIs in the documentation). Maybe using (1+sign(a-b))/2 you can build something that is 0 when a<b and 1 when a>b, but it is not user friendly! Would it really be diffcult to add a function like iif(condition, return_value_if_true, return_value_if_false) to replace the unsupported "condition ? if_true : if_false" operator? Would it really be difficult to add support for the < <= >= > == || && operators? Although compiled to an assemply language, this can't exactly be difficult for a CPU.
    Attachments:
    LV script test.png ‏62 KB
    LV script test.vi ‏18 KB

    (1) You can put any kind of code inside an event structure with the limitation that it should be able to complete quickly and without user interaction.  For example a while loop for a newton-raphson method is fine, but an interactive while loop where the stop condition depends on user iteraction is not recommended. By default, event structures lock the front panel until the event completes, so you would not even be able to stop it.
    (2) Yes, you can do all that. LabVIEW has no limitation as a programming language. Use shift registers to hold data and state information, the manipulate the contents as needed.
    (3) I would recommend to use plain LabVIEW primitives instead of formula nodes. Show us your code so we can better see what it's all about. Obviously you have a mismatch betweeen scalars and arrays. It is impossible from the given information where the problem is.
    (4) Yes, look inside the nonlinear curve fit VI (you can open it an inspect the code!). One of the subVIs does exactly that. Just supply your model VI.
    LabVIEW Champion . Do more with less code and in less time .

Maybe you are looking for

  • How to upload chinese word in the R/3 with fileupload element?

    HI, experts, I am working with a File Upload Web Dynpro Application. And i am using the File Upload UI Element to upload data to R/3, every thing works fine if i upload the file that content is English word. I have 2 questions : (1)But it give me dum

  • How to solve a problem about an Apple Authorized Distributor . . .

    hello to all ... I am Vlad from Romania from the beginning ... maybe I will not find an answer here but I reached a point of desperation ... so I will tell you my story ... and I hope that someone will hear me and maby help me in 13 December 1012 ...

  • Help - SYNC problem watching video on Fancast

    On both of my computers , When I watch a video on Fancast and other sites that use Flash Player the video and voice is not in sync. The longer you watch the farther the voice and video gets out of sync. The voice is ahead of the video. The video is a

  • Active Threads in  OHS is always 0

    Hi, While doing load test we are gettting response time more proportionately to no of Requests.We gave 200 for "ThreadsPerChild" but in enterpise manager it is always showing "Active Threads" as 1 and "Idle Threads" as 199. Even we have tried from di

  • Encore won't activate under Creative Cloud

    I installed Creative Cloud trial (Mac Mountain Lion) and after 30 days upgraded to paid subscription. Premiere works fine and I have completed a project. Now I urgently need to burn to DVD, but Encore keeps asking for a serial no. Of course, there is