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

Similar Messages

  • 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 .

  • 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

  • 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..

  • 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

  • Array output from formula node with input variable as array size

    Hi,
    I have created a formula node with an array output called al, but I get an error "you have connected a scalar type to an array with that type".
    I declare the output as follows..
    float64 al[len_as];
    where len_as is an scalar input to the formula node.
    It only works when I put a number as.
    float64 al[5];
    ,but I don't know beforehand how many elements I need, so I cannot use this.
    Please help! This is so stupid.
    Thanks

    Don't define your array in your formula node.
    Initialize the array as the size you want and pass it in as an input into the formula node.
    Are you sure you even need to use a formula node?  Can you implement your formula using all native LabVIEW functions?
    Message Edited by Ravens Fan on 10-07-2009 11:51 PM
    Attachments:
    Example_VI_BD.png ‏3 KB

  • Formula node with global variable

    Hi,
    I am tring to use formula node with global variables as an input and output,
    but this is where I see the SW hangs forever.
    By the way I am a novice to the labview.
    Can some give me hint why this is happening?
    Thank you in advance,
    Do
    Solved!
    Go to Solution.
    Attachments:
    formula_node_wGlobalInputOutput.JPG ‏281 KB

    Well, the first case of the two loops has a direct LabVIEW translation like this:
    However, just because that's the direct translation doesn't mean that's what you should be doing. In the formula node it seems as if you were copying elements from one array to another. Element-wise operation on arrays via loops can be quite inefficient in LabVIEW. Often one can operate in place with arrays, and an operation that would require two loops in a language like C would actually require no loops in LabVIEW. In fact, with the above example, even if you were to use loops, arrays can auto-index for-loops so you don't even need to wire the constants to the N terminals to tell the loop(s) how many times to run.
    Can you describe what you're trying to accomplish? There's likely to be a more natural way to do it in LabVIEW that would require no loops. Have you gone through the tutorials? You can also look over the material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.

  • 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 ....

  • フォーミュラノード解析(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

  • 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

  • フォーミュラノード解析(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」が使えると
    思ったのですが、悩まし過ぎます。

  • 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 .

  • HELP: Run-time array dimension in LabVIEW formula node

    I need to dimension an array at run time within a formula node as follows:
    int32 i,N;
    N = sizeOfDim(inputArray,0);
    float64 outputArray[N];
    for (i = 0; i outputArray[i] = myfunction(inputArray[i]);
    However, LabVIEW complains "Formula Node: index list expected". On the
    other hand, if I say
    float64 outputArray[1000];
    LabVIEW is perfectly happy. But that's not what I need to do! Is there
    an alternative
    way of accomplishing my goal?
    BTW, I've tried calculating N outside the formula node and then
    presenting it as
    an input with the same results. I've got a bad feeling that run time
    array dimensioning
    just isn't allowed.
    TIA,
    Hugh

    Can't you just use the Initialize Array function outside the formula node and pass that instead?

Maybe you are looking for