Formula nodes and hex values: strange behavior?

Hi all,
I am having problems using hex values in a formula node. It appears that the hex values are converted to decimal and then assigned to the variable. For example, if I initialize an int8 in a formula node to 0xFE (should be -2), I get 127 (the highest positive value an int8 can have). In order to get -2, I must initialize the variable to -0x02. However, if I initialize the variable to -2 decimal and view it in a indicator in hex, it displays the correct 0xFE. Is this typical behaviour? I didn't think negative hex values were used and I can't find it documented anywhere. Here is a VI that shows the "problem".
Thanks!
Attachments:
Formula Node Example.vi ‏7 KB
Formula Node Example.png ‏31 KB

Hi brett,
int8 test = 0xFE
You defined a variable to be of type I8, but then you want to assign a value out of range of that datatype. LabVIEW will coerce the value to fit the datatype resulting in 0x7F stored in test.
int16 test2 = test
Now you copy the value stored in test over to test2. Why do you even expect a value of 0xFE here? In the line before you stored 0x7F in test, so test2 will also have the value 0x7F!
int8 test3 = -0x02
This was explained before…
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome

Similar Messages

  • Difference between hierarchy node and single value

    Hi experts,
    Can anyone explain me the difference between hierarchy node and single value?
    This is my problem:
    I have a query that uses a characteristic (0ORGUNIT) with a hierarchy and I execute it without any problem but when I try to set a fliter on this characteristic and I try to find a single value, for example 101, it doesn't appear in the single value list, instead it appears in the hierarchy nodes list in the selection window.
    I think I'm confused about both terms because I thought  a hierarchy node was always the one who has one or more values as its lower levels like this:
    A. 10
        A1.  100
        A2.  101
        A3.  102
             A3.1.  1021
    B. 11
    I this case I thought , for example, 101 was a single value but not a hierarchy node so I must find it in the single values list in the selection window, however, 102 can be both and must appear in both lists, is it true?
    Thanks in advanced

    In BW, hierarchy node with more information compare to the single value. for example, it always carries its father node information, which it belongs to. and some time information if it is time-dependent.
    So, when you using hierarchy node, it means at least 2 information: value and "position" (who is its father node)
    That's the reason why you see the hierarchy tree when choosing the node.
    If you want to expand the hierarchy to the certain level, you can setting in the property. Another choice is restrict in the query designer.

  • Combining formula node and arrays for calculatio​n

    Hello all!
    I have two arrays containing values defined by me. Each value of respective column and row index shall be used in a formula to calculate the new value for the respective column and row, to build a new array for further use. This shall be done several times during a simulation with variable function parameters.
    I am aware that I should probably use a for loop for this calculation, but I am curious to how I should build such a procedure.
    Any ideas?

    Hi Euler123,
    Let's say that you have an array of fix size and with values in it. Then you'll need to use auto indexing at the beginning of each for loop input tunnel (usually it is by default for for loops) as shown below:
    In the first iteration of the other for loop, it will take the first row values [1, 2, 3] and pass it to the inner for loop (unless you want to extract the values for each column, transpose that 2D array before connecting it to the outer for loop). In the inner for loop, it will execute 3 times and each iteration it will extract each element from the array obtained from the outer for loop. 
    To build the new array, it's just the opposite. Pass the element out from the for loop and instead of getting a last value tunnel, you'll get an auto indexing tunnel (default for for loops).
    Anyways, you'll need to get some basic understanding on LabVIEW first. Here's some tutorials to aid you on understanding For Loops.
    http://www.youtube.com/watch?v=ziOnPNJgeVg
    Here's some additional notes which might help you:
    http://zone.ni.com/reference/en-XX/help/371361J-01​/lvhowto/auto_indexing_1/
    http://zone.ni.com/reference/en-XX/help/371361H-01​/lvhowto/auto_indexing_1/
    http://zone.ni.com/reference/en-XX/help/371361G-01​/lvhowto/auto_indexing_1/
    Play around with For Loops and use something to slow the execution down like Highlight Execution which allows you to see what is going on. Else, take up some LabVIEW courses
    Warmest regards,
    Lennard.C
    Learning new things everyday...

  • READBINARY and HEX values.

    I have a small JPG that I've converted into a RAW RGB format.
    I've tried every combination of TOBASE64(), FORMATBASEN(), and
    TOSTRING() that I can think of but still can't read the values.
    For instance, if I open the .RAW file in PaintShop Pro, I can
    see that the first pixel at (1,1) has an RGB set of 84,82,73. If I
    open the JPG and look at the same pixel, the same RGB value of
    84,82,73 which is kind of brownish grey.
    If I open the .RAW is a hex editor, I can see the hex values
    as "84-82-73-82-88-79-8c",etc. So, I would like to use
    CFFILE/READBINARY to read the first set of RGB values. In reality,
    I would like to read all sets of RGB values, three at a time.
    How is this done?
    Gracias.

    Have you had a look at Christian Cantrell's method of
    Using
    ColdFusion to Write Out Binary Data. You could then just put
    the number of bytes in place of
    arrayLen(pic), remembering that one RGB set is 3 bytes.

  • Excel formulas copy and paste values option

    I use a spreadsheet that has descriptions in column A, then column B is my cost.  I am reselling these goods so I use the formula =mround((cost/0.95),0.05) in column C which will take the original price in column B, mark it up 5% then round it off to the nearest nickel. the formula works, however when I go to delete column B , Column C just shows an orange triangle.  In excel I would have to COPY all of column C then PASTE and then chose VALUES  option so that it would keep the actual marked up numbers, rather than pasting the formula.  However when I try to copy column C in numbers and paste it into a new column D it is marking column D up 5% also.  I know I can HIDE my actual cost column, but since I have to email this over to the buyer I do not want her to be able to UNHIDE it and see my costs. I have the book and I cant find anything relating to this in there, and have spent almost an hour trying different things and can not figure this out. 

    In the Edit menu is Paste Values.

  • Mission Control and the dock -- strange behavior

    Go to Mission Control and click on an open application's dock icon:  Lion acts very erratically.  It might switch the right app.  It might switch to some other app.
    Note:  Have a couple of full-screen apps, like Safari, Mail or iTunes, open.
    This is driving me crazy.  Since the dock isn't displayed in full-screen apps, I tend to do the four-finger-up gesture to get to the Mission Control screen to get to the dock to switch to another open app.  I recognize that there are other ways to switch apps, but shouldn't this way work work, too?

    I feel your pain. "Over 250 exciting new features" was the promise. I, literally, have found ZERO new features that are useful. Yes, that's right---not a single one.
    And for the record....I am a long-time Apple fan, and Apple addict. My first computer was in 1985 and it was an Apple. Every computer ever since has been Apple. I've never had a complaint---until now. I'll just say it in plain English---Lion is GARBAGE. I have found absolutely, positively, nothing useful about it---zip, zero, nada! Now I'm trying to figure out how to get rid of this junk and put Snow Leopard back on. Apple should be ashamed---this is pitiful. And my computer has NEVER EVER crashed before (well, okay..I'm sure it has at some point over the last 26 years..but I don't recall when). But now my computer crashes at least 3 times per day. Un-fricking-believable.

  • Creating views on 9.2.0.7 and red hat: strange behavior

    Hi all,
    here you can find two new problems to solve:
    create table test1(id1 number, text1 varchar2(4000));
    create table test2(id2 number, text2 varchar2(4000));
    create or replace view v_test1_test2 as
    select t1.*
    , t2.*
    from test1 t1
    test2 t2
    where t1.id1 = t2.id2;
    Note that on line 3 of the view script there is a comma at the beginning of the line...
    After creating the view, if you edit the view script from the data dictionary, you will find something like this:
    CREATE OR REPLACE VIEW V_TEST_!_TEST (ID1, TEXT1, ID2, TEXT2) AS
    select t1."ID1", t1."TEXT1",
    , t2."ID2", t2."TEXT2"
    from test1 t1,
    test2 t2
    where t2.id1 = t2.id2
    As you can note, Oracle added another comma to the script: the result is that the view,
    successfully created without errors, is invalid ("Missing expression" if you run a select against it)!!!
    So there are two different problems in this:
    a) I created the view without specifying all the fields name: Oracle added the column name after each column. This means that the view code stored in the data dictionary is quite different from that stored in my source control software.
    b) The view is invalid even if it was successfully created without errors, because there is a new comma that I did not write in my source code.
    Do you know if there is any solution at these two problems?
    Many thanks!
    Ste.

    a) Nothing wrong here. Even if you didn't write the column name (by using *), Oracle replace it by all the current existing columns. Anyway, it's a bad practice to create view with *.
    b) Seems a bug solved in 9.2.0.8.
    Take a look to the below thread :
    Re: Create View in Oracle9.2.0.7.0 - Is this a bug?
    Nicolas.
    Message was edited by:
    N. Gasparotto

  • How to create DOM with node and its value

    <Order>
    <Manifest>
    <Item>
    <ID>101</ID>
    <NAME>Name one</NAME>
    <PRICE>$29.99</PRICE>
    </Item>
    </Manifest>
    </Order>
    i can write the code to create a DOM for this one.
    but how can i write the code to get the DOM as shown below
    <Order>
    <Manifest>
    <Item name="xxx">
    <ID>101</ID>
    <PRICE>$29.99</PRICE>
    </Item>
    </Manifest>
    </Order>

    Your question appears to be how to get an attribute applied to an element. Is that right?
    If so, use the setAttribute() method of the Element interface.

  • 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

  • Strange behavior of the notifications

    Hi guys.
    I use an iPhone 5S running iOS 7.0.3 and have a strange behavior of the notifications.
    Example:
    I get 3 messages from WhatsApp.
    The lock-screen shows the preview of all 3 messages. OK so far.
    But if I unlock my iPhone, a banner shows the latest message and the app-badge shows only 1.
    This I have with other apps too.
    This was not with older iOS versions
    All settings looks OK. Do you have an idea?
    Thank you, Tom

    Because you are comparing floating point numbers.
    For example 0.1 cannot be exactly represented in binary, so repetitve additions will probably not end in an exact integer later.
    From the three inputs you can calculate the number of values exactly, and use a FOR loop. Don't use convoluted code....
    Why don't you simply use ramp pattern?
    LabVIEW Champion . Do more with less code and in less time .

  • Formula Node Calculation Issues

    I'm trying to make an array where the output is defined by the formula 25*(2^x) where x is the input variable, with integer iterations from 0 to 7.  To do this, I made an formula node and put it in a for loop.  Unfortunately the (^) symbol is not working right for the calculation.  I tested it simply with x^2 and this did not work, while having x*x returned the correct values.  Instead of outputting the correct values, it outputs seemingly random integers.  Anyone know why?  I am new to this software so I apologize if this this a common issue but I could not find help anywhere else.
    Solved!
    Go to Solution.

    If you use the numeric primitives rather than a formula node, craziness can be avoided (well, sometimes).
    Lynn

  • Formula node error: missing left parenthesi​s

    Hi guys
    I am new on labview and i am strugling to right a bit of code.
    I am using formula node and i keep getting the error as above on the title moreover it displays: Error on line 5 is marked by a '#' character: "     for   {# H = 00.00.00 to  H = 06.00".
    I am attaching my file so that if you can give me a hand you could have a brief look.
    Thank you
    Solved!
    Go to Solution.
    Attachments:
    time_look up test.vi ‏14 KB

    Hi inaslab,
    still your formula node doesn't make sense: You still overwrite the value for H in the first FOR statement...
    What you want is either an IF-THEN-ELSE or a SWITCH/CASE construct like "IF (H>=0 AND H<6) THEN...". Right-click the formula node, select help, select formula node syntax !
    And I'm even more convinced a standard LV case structure will be much more reasonable here: just wire H to the selector input...
    Message Edited by GerdW on 10-29-2009 11:29 AM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Strange Behavior from iTunes 7.2

    Running itunes - 7.2Recently had my itunes library “corrupted” or non functional.
    Spent a long, long time rebuilding the library (see below) and noticed some strange behavior that has me terrified that itunes is corrupted and I am going to loose all the hard work, etc..
    1. I have about 100 GB of music in various formats (apple protected/itunes store, mp3 (128 to 320), apple lossless, wav) and when I tried to rebuild the library by clicking on add to library it only added about 65 GB of the 100 GB. I had to go through and figure out what was missing and manually choose the specific folder when I added it.
    Major pain and very time consuming.
    So it is not adding songs correctly, but through way too much effort able to work around this.
    2. About ½ of the itunes store tunes I purchased are no longer apple protected format. Somehow they were converted to mp3 at 192kbs. Some of the songs play fine others are now not as crisp and make a poping sound or skip. How could this happen? Are these files corrupted? Will I loose them?
    3. At the top center of itunes the information bar, where the read out is for what song is playing and how much time has elapsed in the song, is not working. When I click on a song it starts playing but the elapsed time bar and counter never move, and when the next song starts playing the information never changes. It is stuck on what ever song you initiate play with by clicking on it and the information stays frozen.
    4. itunes randomly stops playing at the end of a song….If listening to an album it is usually after three or four songs and when listening to a play list it is usually after one song.
    I am afraid itunes is corrupted and will not function correctly and I am going to loose the hard work I put in trying to recover from the last crash.
    Any suggestions??
    Can’t wait for time machine. I hope it works as advertised. If so I could just go back in time to the last time iTunes worked correctly and go from there.

    First of all I hope that you have a good b/u of all your tunes - either on ext HD or on DVD. Don't forget to b/u the iTunes Library and .xml files at the same time.
    Have you tried to reinstall iTunes? Drag the app to the trash and remove the iTunesX.pkg from HD>Library>Receipts>iTunesX.pkg. Using a fresh .dmg of iTunes 7.2 reinstall.
    Have you repaired permissions with Disk Utility?
    Is your Quicktime up to date? At least version v7.1.5.
    MJ

  • Parenthesis in formula node

    I'm using the formula node and it appears that parenthesis don't work. Is this correct? What is the order of operations?
    The Formula Node Syntax page in the help is extremely brief and sparse, bordering on useless for anyone that doesn't already now what is going on. Is there a more thorough description of the Syntax anywhere?

    Thanks Dennis,
    The error is just an incorrect calculation.
    I put together a simple node and parenthesis did work. So something else must be amiss. I stripped down my VI and equation and made two formula nodes implementing the same equation with and without parenthesis. One gives an exponential decreasing curve, the other a constant array. Where is the error?
    Attachments:
    parenth_ex.vi ‏49 KB

  • Strange behavior of the Macbook pro display

    Hi to all
    I'm using my MacBook pro, and notice some strange behavior after open several windows or applications, I don't know how to explain, so here is a photo:
    http://www.flickr.com/photos/86155326@N00/
    I have tried: go back to 10.4.6 / create a new account / Hardware test... and Nothing.
    Any suggestions?
    Pedro

    I am having the exact same problem(and no one is replying to my post either), I read in another post of someone who had a somewhat similar issue and someone commented that it was bad VRAM and warranted the logic board to be replaced. I'm hoping this is not the case, or at least hoping the problem does not get worse because I am in school and can't be without this computer for 2 weeks while it gets repaired..I'm hoping I can last til the holidays...
    pictures of my problem:
    http://www.rpi.edu/~neala/pics/display/Messed%20up%20desktop.png
    http://www.rpi.edu/~neala/pics/display/Picture%204.png
    Sometimes I can make it go away by moving windows, and sometimes that makes it worse... this computer is only 100 days old...come on apple..help us out!

Maybe you are looking for

  • View order history by business partner

    Hi, In SAP Webtools 6, is it possible to show all the sales orders for one account (BP) to the user for that account? Right now, if one BP has multiple users login to webstore, they can only their own orders. Thanks, David

  • Error while deploying the Eclipse Link Application into Server

    Hi guys, i tried to deploy the application using Eclipselink into the server. but i got the following exception: Error processing persitence unit EJBModel of module WLEclipseLinkDemo-ejb.jar: Error instantiating the Persistence Provider class org.ecl

  • Par file deployed without code

    Hi Experts, Our portal version is SAP EP 7.02 SP23. We have a custom par file developed. Now we want to do changes to it. When I try to download the custom par file. It contains only custom jar file (in that jar file there is only one class file.). 

  • IPod mini Battery & Reset Problems - So Annoying!

    Hi Everyone! My first post and it's a problem! I bought the second generation iPod mini back at the very end of February this year. I love it to bits and i've used it every single day since i got it! I charge it whenever i need to (mostly every other

  • Trying to get in touch via email with customer ser...

    Dear Forum, I am currently more than 3 months into an unresolved fault with my service (originally logged 11th Dec 2014). I am trying to establish a means, in writing, to express my disappointment and concerns in this regard to the customer managemen