Expression node

What is the correct syntax for an exponent with the expression node?
I looked in LabVIEW help, and it looked like it was the '^' character,
except that doesnt appear to be correct:
The correct output should be 2, but LabVIEW returns 3.
Cory K
Solved!
Go to Solution.

Darin.K wrote:
That is easily in my top 2 or 3 LV pet peeves.  I use exponentiation countless times and the next time I use bit-wise XOR in a LV text formula will be my first.  Why couldn't LV be like every other program/language I have used and use ^ for exponentiation?
Define your definition of every other programming language!
There are Ada, Bash, COBOL, Fortran, FoxPro, Gnuplot, OCaml, Perl, PL/I, Python, Rexx, Ruby, SAS, Seed7, Tcl, ABAP, Haskell (for floating-point exponents), Turing, VHDL which do just as LabVIEW, Algol, Commodore BASIC which use a special symbol ↑, and some like Java who don't even have a special exponentiation operator, but require the call of a math library function.
BASIC, J, MATLAB, R, Microsoft Excel, TeX (and its derivatives), TI-BASIC, bc (for integer exponents), Haskell (for nonnegative integer exponents), Lua, ASP and most computer algebra systems do use indeed the ^ symbol, but in Bash, C, C++, C#, Java, JavaScript, Perl, PHP, Python and Ruby, the symbol ^ is used for the XOR operator and the LabVIEW formula node borrowed a lot of syntax from C and is in its current incarnation in fact a limited C syntax environment, so that leaves the ^symbol not available for the exponentiation anymore.
Also I would say that LabVIEW is indeed more a programming language and not a computer algebra system.
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions

Similar Messages

  • Expression node bit shift

    Is this a bug or am I just thinking about this wrong?  The attached VI shows a U8 going through an expression node where the expression is "x << y".  I've tried multiple versions of y and as soon as y becomes large enough to shift all the original 1's off the U8, the result becomes 0xFF instead of 0x00.  I would assume that its intent was to match C's functionality since it matches C's syntax but this does not appear to be the case.
    Any suggestions or is this a bug?
    Thanks
    Andy Brown
    Averna
    Attachments:
    expression_shift_issue.vi ‏11 KB

    Hey Andy,
    Thank you for contacting National Instruments.  It does look like that is acting strangely.  However, we do have a Logical Shift VI that I believe accomplishes what you are looking for.
    On the Block Diagram, go to Programming>>Numeric>>Data Manipulation>>Logical Shift.
    It takes two inputs, x and y, with x being the original number, and y being the number of bits you want to shift.  It looks like it will clear out to 00 once all the bits have been shifted over.
    Let me know if you any questions!
    Regards,
    Kevin H
    National Instruments
    WSN/Wireless DAQ Product Support Engineer

  • Bit Complement in an Expression Node

    I can use bit complement in a formula node but not the expression node. The
    "~" tilde is the only text in the expression node. The error is "~#" with
    # being the error. The input is a U8. Thanks in advance for any help.

    Hi Catherine,
    I've tried your suggestion earlier and tried it again after your
    post but it still doesn't work. I am new to expression nodes so maybe my
    syntax is incorrect. To do the same in C language I think it looks like
    this: "a = ~ b;". I made a picture and a copy of the error. Let me know
    if you see anything wrong. Thanks!
    Error on line 1 is marked by a '#' character: "~#"
    [Image]
    Pat S.
    cfpautx wrote:
    > Hello Pat,
    > The way to fix this problem is fairly simple, if you change your
    > inputs and outputs to I8, u16 or I16 it will run correctly.
    > Regards,
    > Catherine Petronino
    > National Instrument
    > www.ni.com/ask

  • Bug typedef does not connect to expression node

    Attached is a simple vi that tries to connect a typedef (in this case a double) to an expression node.
    Since LV8 this is not allowed anymore.
    We choose LabVIEW because it was possible to use it as a strict typed language. (one of the reasons).
    We see that the developers go a long way to make the language so easy that it is too strict to allow typedefinitions to an expression node.
    But it can also be a slip of the compiler of course.
    attached are the example vi and the typedef.
    please supply a patch because this makes it impossible for us to switch to LV8
    greetings from the Netherlands
    Albert Geven
    greetings from the Netherlands
    Attachments:
    typedef does not connect to expression node.vi ‏7 KB
    dbl typedef.ctl ‏5 KB

    A workaround is easy but should not be necessary because the typedef is used to keep it a typedef.
    Simply use an explicit type conversion in this case to [DBL], at least that was my guess....
    but an explicit conversion already knows there is nothing to do so it does not help.
    A typecast helps but sure that is not what I want, see picture below.
    greetings from the Netherlands
    Attachments:
    typedef bug not solved by explicit conversion.JPG ‏5 KB

  • Polynomial in expression node

    I would like to enter the following equation into an Expression Node: 
    1 / ((1.376E-17*x^4) - (0.000000000000026254*x^3) + (0.000000000023901*x^2) + (0.0000000055134*x10) + 0.000000063412)
    However, each time I try I get block diagram errors.   I've tried removing spaces, parans, etc but have had no luck resolving the problem.  Any suggestions on how to do this or is there a different function in LabView that would be more appropriate?  Thanks.

    Hi JHess,
    what about rewriting the formula as:
    1 / ( (a*x)+b)*x)+c)*x+d)*x+e )
    with a to e your constants from left to right.
    It's just a different representation of the same formula. Your formula maybe doesn't work because of the "^" - powers should have to be written as "**".
    Using LabView primitives instead of the expression node may speed up your code as well!
    Message Edited by GerdW on 02-05-2008 09:51 PM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Expression node line too long

    Hi,
    I have an expression node which is very long.  How do I break it into multi-lines?
    Thank you in advance.
    Qing

    Hi Lucither,
    I tried but do not know how to do it.  Instead I attached my images of VI to you in a Word document.
    Thank you for help.
    Regards,
    Qing
    Attachments:
    HelpNI.docx ‏55 KB

  • Application Express node missing

    Hello experts,
    I have installed SQL Developer v. 1.5.5 Build MAIN-5969, connected to my application owner, but I can't find the Application Express node.
    Any tip?
    Tks
    Edited by: user12088893 on Oct 27, 2009 9:32 AM

    Hi Tks,
    Sorry for the late reply, this may not be of use anymore but someone else may get something from it.
    Is your install of Application Express 3.0.1 or higher?
    Oracle XE ships with Application Express 2.1.0.00.39. (You can upgrade Application Express to the latest version if you want).
    Here are some details
    http://www.oracle.com/technology/products/database/application_express/html/sql_dev_integration.html
    If you do have Application Express 3.0.1 or higher, then please post back and we can dig further.
    Thanks,
    Dermot.
    SQL Developer Team

  • Using an array with an expression node on a PDA

    I'm having a problem deploying an application to my PDA (pocket PC 2003) when the block diagram has an array wired to an expression node.
    When I try to build the exe I get the following error:
    retrun is a missing VI or C file.
    Attached is an example VI that produces the same error
    Thanks for the help.
    Eric
    LV 8.2
    PDA Module 8.2
    Attachments:
    Array w ExN.vi ‏11 KB

    Hello,
    This is an issue known prior to release - it is documented in the PDA Readme file:
    Open the LabVIEW Readme files folder by selecting Start»All Programs»National Instruments»LabVIEW 8.2»Readme, and then open readme_PDA.html.
    Search that html page for "expression node" (without quotes) and you should find this issue acknowledged as the 8th bullet under the section entitled "VIs and Functions Known Issues."
    Best Regards,
    JLS
    Best,
    JLS
    Sixclear

  • Undocumented features of the expression node

    After investigating expression nodes in detail here, I stumbled on some undocumented features that could give your UIs some interesting new twists (if used in moderation!).
    I have not fully explored all possibilities, so there might be more.
    I have tested in it LabVIEW 4.0 through 2013SP1 and it seems to work everywhere. (Versions below 6i show some slight pixelation artifacts, but that can be ignored)
    Look what it can do!!!!
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    HiddenExpressions.png ‏8 KB

    Hornless.Rhino wrote:
    Hey wow, you can see through to the block diagram. Better put a perspex plate over that, you don't want animals getting in there and gnawing on the wires.
    Just duplicating the myRIO design, where you can see the "circuits" under a glass cover.
    LabVIEW Champion . Do more with less code and in less time .

  • BUG: Arithmatic shift right in expression and formula node

    Don't believe this isn't a known bug, but I couldn't find it... Tested in
    LV7.1 and LV8.5.
    In an expression node, if you use the << operator, the function produces
    wrong results if the input isn't an I32. For instance, x<<1 in an expression
    node, with an U8 as input:
    1 result 2
    128 result 255 WRONG, should be 0!
    130 result 255 WRONG, should be 4!
    The normal shift function is correct (I used it to compare the results,
    after I noticed that C results where different). Also, the function works
    correct when used for U32's (e.g F0000002 results in 4) or I32's. When an I8
    is used, results are limitted to 128. U16's and I16;s fail as well.
    As a work around: convert the input to U32, and afterwards to U8.
    In a formula node, create an aditional input that is an u32: "T32=T8; var=
    T32<<1;" might work in a lot of cases...
    Regards,
    Wiebe.

    LabVIEW 8.6.1 and bug still here:
    Compared with CVI C compiler and Intel C++ Compiler - both return zero. But formula node returned 255.
    I've lost more than hour for looking trobles in my code, but it was behaviour of shift!
    Andrey.

  • BRF+ Message Log & "Rule as Expression"

    Hi colleagues,
    I am quite new to BRFplus and have two questions:
    1) I would like to use a message log action in order to indicate errors. I tried to follow https://wiki.wdf.sap.corp/wiki/display/FDT/Message+Log   with method SET_APPLICATION_LOG_OBJECT, but I can't find the class this method belogns to. I also tried modelling a rule & action message log with help of the UI. My question is how can I log messages and where can I find them after the function is beeing processed?
    2) In every guide I can read something about rule expressions and even how to create them (e.g. http://help.sap.com/saphelp_nw70ehp1/helpdata/en/cc/85414842c8470bb19b53038c4b5259/frameset.htm), but in the workbench there is no possibilty of creating rules as expressions but only rules and rulesets (the rule is not part of the "Expression" node).
    I hope somebody knows what I mean
    Thanks a lot & kind regards,
    Ilijana

    Thanks a lot for your response!
    Could you tell me why using rules and rulesets is not recommended for 7.01 ? This could be interesting for my bachelor thesis.
    Thanks & Kind Regards,
    Ilijana

  • Gamma function in formula node

    I am running LabView V.6.1 and try to use the gamma function in a formula node.
    According to the HELP text ''Formula Node and Expression Node Functions'', the syntax for the Gamma funtion is gamma(x), but this leads to the block diagram error ''Formula node: Undefined variable''.
    Other functions (like exp(x), sqrt(x) etc.) work.
    Thanks for helping.

    Hi,
    we ran into this one a little while ago. The help is a little misleading. The Gamma function actually only works with the Expression Nodes, and not the Formula nodes.
    Go to the labview help file, and search for "Differences Between the Parser in the Mathematics VIs and the Formula Node "
    Also refer to the following link for a bit more information :
    http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=50650000000800000020540000&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0&USEARCHCONTEXT_QUESTION_0=%22Square%22+function+in+formula+node&USEARCHCONTEXT_QUESTION_S=0
    it's a bit long winded, but be patient - the information is in there.
    Hope that helps
    S.
    // it takes almost no time to rate an answer

  • TreeTable determining parent node

    Is it possible to determine whether a TreeTable row is the parent or child in an EL expression?
    Thanks

    you can have an attribute(isParent) in your tree model that define that i.e. in master view it will teturn 'true' and in detail 'false'.
    then you can use it in el expression #{node.isParent}

  • How to evaluate Expression??

    Is it possible to change the expression in “Expression Node” in run-time?
    For example: User enters the expression as a string. I need to evaluate it and give the result.
    Is it possible to do that?
    Any ideas how to sole this problem??

    The expression in a formula node cannot be changed at run-time. Instead, use Eval Formula Node (Analyze>Mathematics>Formula palette) or the Advanced Formula Parsing functions on the sub-palette under there. These functions are not in the LabVIEW base package.

  • 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.&nbsp; 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..

Maybe you are looking for

  • Error while creating a system in portal

    Hi, Iam trying to create a technical system(SAP System with Load Balancing) in the portal.When i try to test the connections im getting the following error: The WAS ping service (http://hostname:portnumber/sap/bc/ping) was not pinged successfully. If

  • CS3 'freezed' installation problem on Windows Vista Home Premium.

    Hi! I searched everywhere for answer that installation of my PS CS3 is freezed in moment on the screen. I installed Acrobat Reader, Dreamweaver cs3 only. Both in English language. I tried to uninstall, then install, using cs3clean, but it`s nothing c

  • What's a good file recovery program for a MacBook Pro running IS 10.7.5?

    Hey gang - I ordered a miniStack 4TB external hard drive from OWC a few months ago during a long overseas trip. I finally unwrapped it and started dumping data to the drive from the 1TB drives (also from OWC) I used via my MacBook Pro. I connected th

  • Change user name to numeric

    Change user name to numeric in active sync I cannot seem to get this to work any suggestion? R_M

  • Look-Ups

    Hi All, 1.Can you tell me what exactly the look-ups are? 2.Please tell me about the RFC and JDBC look-ups. 3.Also please tell me how many data types do I need to create for For JDBC <---> RFC sync ? 4.From my point of view I should create 2 data type