Does unsigned 32-bit arithmetic work in formula nodes?

I am trying to generate some 32-bit patterns to control my instrument under test. The easiest way to assemble these patterns seems to be to put the bits together in a formula node by shifting and OR'ing. All of my LabView variables are defined to be U32, and the corresponding variables in the formula node are uInt32.
The problem is that whenever I assign a "1" to the most significant bit of a variable, the entire value is coerced to zero. What is happening? what might I be doing wrong? I checked all of the obvious things, such as incorrect data definition, etc. I tried putting together the pattern in various orders, and I narrowed the assignment down to its simplest form. However, I still cannot get a value of 1 into the most significant bit of the U32.
Is there a way around this problem?
Thanks,

Well I seem to have recreated your problem using the formula node (either that or we're both not doing something right).. Look at "out1".
The logical shift function works fine of course.
Message Edited by Bill@NGC on 07-30-2007 08:42 PM
“A child of five could understand this. Send someone to fetch a child of five.”
― Groucho Marx
Attachments:
shift fp.png ‏219 KB
shift bd.png ‏206 KB

Similar Messages

  • Problems with bit shift left in Formula Node

    Hi,
    Sorry but my English is not good.
    I'm trying to execute a bit shift left in the Formula Node, but the shift left is not working as I expected.
    uInt32 parametro[5];
    float32 valorAmostra;
    int16 indiceAmostra;
    uInt8 indiceResposta;
    int16 controle;
    int32 valor;
    int8 i;
    for(i=0; i<5; i++)
    parametro[i]=param[i];
    valor = parametro[5]<<16 | parametro[4]<<8 | parametro[3];
    controle = parametro[1]<<8 | parametro[0];
    indiceAmostra = (controle & 0x3FF);
    indiceResposta = (controle >> 10);
    valorAmostra = valor & 0x7FFFFF;
    valorAmostra = valorAmostra*(2.4/8388607);
    if((valor & 0x800000) == 0x800000)
    valorAmostra = valorAmostra*(-1);
    the input param array is of the type uInt8, as I saw in other topics that does not shift with uInt8,
    I copy the values of param array to parametro which is of type  uInt32, but still did not work.
    Testing the input param with the following values:
    param[] = {10,14,10,0,16}
    the valorAmostra returned is 0,00117188 when he should be 0,300003.
    Can someone help me please?
    Solved!
    Go to Solution.

    Portuguese:
    Olá,
    Existe um bug no LabVIEW para esta operação. Este bug deverá ser corrigido em versões futuras. Uma solução para esta situação é utilizar um int32 ao invés de um ulnt32.
    Qualquer dúvida por favor entre em contato.
    Obrigado.
    English:
    I investigated the problem you are having, and it turns out that it is a bug that has already been reported and documented. The work around for it is to use int32 rather than uInt32.
    Thanks.
    Luciano Borges
    R&D Engineer
    Pirelli Brazil

  • 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

  • Formula node bitwise OR has a bug?

    Hello everyone,
    I am trying to do a bitwise OR with 32 bits in an formula node. It seems that the OR operation produces unexpected results if the most significant bit is set. For example if I do:
    0x00000000 OR 0xffffffff I would expect 0xffffffff. Instead I get 0x80000000. In binary this looks like:
    00000000000000000000000000000000  OR
    11111111111111111111111111111111  EQUALS
    10000000000000000000000000000000
    Please see the attached minimal example for comparison of some example values. The output with using blocks is exactly the one I would expect and is also included in the example.
    I am using Labview Version 14.0f1 on Windows 7 Professional.
    This might also be in connection with the following currently unresolved bug:
    48016
    3P7CBB4Q
    http://www.ni.com/product-documentation/52150/en/#48016_by_Category
    However that that bug is for unsigned int32 and the suggested workaround is to use signed 32 bit integer, which nevertheless fails in the provided example code.
    If someone could have a look and tell me if this is a bug or if I am misunderstanding somtheing that would be great. I am already starting to go crazy.
    Best regards and thanks in advance
    Saali
    Attachments:
    Minimal_Bug_example.vi ‏10 KB

    No, actually this bug is different from what is documented.The documented bug happens with uInt32 and the documentation specifically suggests to use Int32 as a workaround for the known bug:
    "2. Use signed 32-bit integers instead of unsigned 32-bit integers in the formula node."
    However this is exactly what fails in my case when I use OR. I thought this might be some valuable information for the people trying to fix that bug. (Which seems to be hard to find, as it has been around so long and screws up very basic operations.)
    It might also be that NI does not really care for that bug because most people don't use the formula node for basic bit arithmetic. Anyway, I just wanted to put the information out somewhere for the next person who has that problem to find. I  guess the lesson I learned from this conversation is don't trust the formual node to much for doing low-level bit stuff...
    Best regards
    Saali

  • 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

  • Formula node: type conversion

    Hello guys
    I have LV 5.0 and have to edit a script which has some kind of overflows. For testing I set all variables to the hightest usable range - extended or i32. Now I see, in all formula nodes, there are type conversions. How can I change the type of the inputs/outputs of the formula node?
    Hardware_Tester
    My first language is German, please ignore my faults...

    Hi,
    I forgot that you run Lv5.0. My example refers to Lv7.1.
    As far as I know in Lv7.1 the input variable type changes automatically as you connect a control.
    On the contrary the output is DBL by default but you can change it in the formula node introducing an explicit declaration of that variable (see "h" in the attached picture).
    Here are some useful link:
    http://forums.ni.com/ni/board/message?board.id=170&message.id=12253&requireLogin=False
    http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/d6bed7d73659c43586256a7300691c26?
     Sorry, I understand that this cannot solve your problem but I don't remember how Lv5.0 works with formula node.
    Regards
    CLD - Labview Certified Developer
    Attachments:
    untitled3.gif ‏42 KB

  • TS4062 hi can somebody help me... itunes does not accept the iphone 4s but i already have the version 64 bit to work with windows 7 64 bit,  the computer recognizes the phone but itunes sais i need 64 bit itunes.... please is there something im missing...

    hi can somebody help me... itunes does not accept the iphone 4s but i already have the version 64 bit to work with windows 7 64 bit,  the computer recognizes the phone but itunes sais i need 64 bit itunes. please is there something im missing... thanks

    Let's try a standalone Apple Mobile Device Support install. It still might not install, but fingers crossed any error messages will give us a better idea of the underlying cause of why it's not installing under normal conditions.
    Download and save a copy of the iTunesSetup.exe (or iTunes64setup.exe) installer file to your hard drive:
    http://www.apple.com/itunes/download/
    Download and install the free trial version of WinRAR:
    http://www.rarlab.com/
    Right-click the iTunesSetup.exe (or iTunes64setup.exe), and select "Extract to iTunesSetup" (or "Extract to iTunes64Setup"). WinRAR will expand the contents of the file into a folder called "iTunesSetup" (or "iTunes64Setup").
    Go into the folder and doubleclick the AppleMobileDeviceSupport.msi (or AppleMobileDeviceSupport64.msi) to do a standalone AMDS install.
    (If it offers you the choice to remove or repair, choose "Remove", and if the uninstall goes through successfully, see if you can reinstall by doubleclicking the AppleMobileDeviceSupport.msi again.)
    Does it install (or uninstall and then reinstall) properly for you? If so, can you get a normal iTunes install to go through properly now?
    If instead you get an error message during the install (or uninstall), let us know what it says. (Precise text, please.)

  • How exactly does the logical shift function work?

    I think I am missing something very basic here - I am trying to left shift an 8 bit unsigned integer by one place (x<<1)in each iteration of a while loop. So if I start with a number, say 18, the first iteration I get 36, then 72, 144 and after this 32, 64 and so on. I'm not able to do this apparently simple operation in LabVIEW. I tried the logical shift function and a formula node, but both dont give me what I need. The formula node appears to be close in that it gives me 18,36,72,144 but after that I get 255 rather than 32. I dont understand what the logical shift function is doing here. I have attached a vi here that shows what I am trying to do. Any help explaining the mistake I am making will be greatly apprec
    iated.
    Thanks.
    Attachments:
    Logical_Shift.vi ‏17 KB

    You have the inputs confused. If you want to left-shift by 1 at each iteration, the "1" goes on the upper "y" terminal and the number from the shift register (the "shiftee") goes at the bottom. (see attached modification).
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Logical_Shift_2.vi ‏27 KB

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

  • Two part question 1) what happens if you  sign into messages beta on os x lion 10.7.5 after it expired? does the whole application not work or just imessage? 2) does installing messages beta on os x lion 10.7.5  delete ichat?

    Two part question
    1) what happens if you  sign into messages beta on os x lion 10.7.5 after it expired? does the whole application not work or just imessage? can you stil use AIM, jabbar, google talk, or yahoo?  if you open messages beta does it immediately tell you that messages beta expired?
    2) does installing messages beta on os x lion 10.7.5  delete ichat or just transform ichat into messages beta giving the illusion that ichat is deleted?

    Hi,
    It was never completely clear whether it was just hidden or whether Apple ran a download page for iChat 6.
    As the Download for Messages Beta was separate and "Deleted" iChat it would seem it would be another download for iChat 6.
    iMessages will not function as it is only an Account type within Messages and iChat 6 does not have it.
    Therefore messages on the iPhone will not sync to the Mac. (until you get Mountain Lion and Messages in that OS X version).
    Mountain Lion and it's full version of Messages will not sync the iMessages that have happened in between the 14th December 2012  (end date of Messages beta) and the Install of Mountain Lion if you decide on that route.
    8:51 PM      Sunday; May 5, 2013
      iMac 2.5Ghz 5i 2011 (Mountain Lion 10.8.3)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • Does anyone have URL replacement working for catalog generated from wiki pages library

    Hi everyone,
    I have created a catalog from a wiki library which surfaces news/event/announcement articles to a publishing site (with make URLs relative to this site selected).  This works well after modifying the item page and specifying the content as HTML regarding
    the functioning of category/item pages.
    The only issue which remains is that hyperlinks between wiki pages are not replaced in the target site (they always point to the wiki pages within the authoring site collection rather than to their catalog counterparts in the publishing site).  It is
    my understanding that with publishing pages from a pages library these links are replaced to point to other items in the catalog connected site rather than the source.
    Is this just by design (only working for publishing pages rather than wiki pages), or does anyone have this replacement working?
    If this does not work it kind of defeats the purpose of the catalog here and I might as well give everyone access to the authoring library and just use a CSWP in the publishing site to redirect to the authoring wikis.  Not terribly nice from a layout,
    navigational or conceptual standpoint though.

    Just to add a bit more info to this... looking at the coreclient.log file you can plainly see that the page view took 50367ms to complete.... if anyone has any ideas, it would be greatly appreciated.
    Started GET "/wiki/pages/V6C291y8z/price_lists.html" for 192.168.0.100 at Fri Nov 04 13:48:49 -0500 2011
      Processing by PagesController#show as HTML
      Parameters: {"title"=>"Production_Intercom.html", "id"=>"V6C291y8z"}
    Rendered cc/_banner_link.html.erb (0.2ms)
    Rendered cc/_banner_link.html.erb (0.2ms)
    Rendered cc/_banner_link.html.erb (0.2ms)
    Rendered cc/_banner.html.erb (1.8ms)
    get_timezone_offset_from_request: -18000
    time: Wed Oct 26 12:52:17 -0500 2011
    time (client timezone): Wed Oct 26 12:52:17 -0500 2011
    Rendered cc/_entity_header.html.erb (2.5ms)
    Rendered cc/_wikieditor.html.erb (0.1ms)
    Rendered sidebars/_tags.html.erb (59.0ms)
    Rendered cc/_related_item.html.erb (0.0ms)
    Rendered sidebars/_related.html.erb (0.3ms)
    Rendered cc/_comment.html.erb (0.0ms)
    Rendered sidebars/_comments.html.erb (0.4ms)
    Rendered sidebars/_updates.html.erb (0.1ms)
    Rendered sidebars/_settings.html.erb (0.2ms)
    Rendered cc/_sidebar_section.html.erb (61.2ms)
    Rendered cc/_sidebar.html.erb (61.5ms)
    Rendered pages/show.html.erb within layouts/application (50366.0ms)
    Completed 200 OK in 261847ms (Views: 50367.1ms)

  • Why does the plug in stop working sometimes

    Why does the plug in stop working sometimes?

    Is your pc. laptop, whatever Windows -ana what version, like Windows Vista, or Windows 10.
    What bit is it? 32 or 64?
    You can get that info by right clicking on "My Computer" Uusually on the desktop) and selecting Properties in the drop down menu.
    And what version of Fire Fox are you using?
    And which plugin are you using, and is it for Flash Player?
    This info will help someone to answer your question.

  • CS4 64-bit stopped working completely

    I have a new computer with wondows 7 and when I installed CS4 it worked perfect in the beginning but after a few weeks PS CS4 64-bit stopped and I could only open the "normal" version.
    If I try to open the 64-bit it says: "Adobe photoshop cs4 does not work anymore, looking for a solution" and after that I can only quit the program.
    Does anybody know what the problem is and how I can fix this?
    thanks in advanced,
    marca

    Sounds like something that was installed or configured is now in conflict with Photoshop CS4 64 bit.
    Did you update anything (e.g., download new video drivers) at the time that Photoshop 64 bit stopped working?
    How long has it been?  Can you consider doing a System Restore back to when it worked?  You might have some stuff to reinstall, but you could check after each to know what it is that's conflicting with Photoshop.
    Hope this helps.
    -Noel
    P.S., Photoshop CS4 64 bit works just fine for me on my fully up-to-date Windows 7 x64 system, so keep heart; it can work.

  • Logic 9.1 crashes on startup in 32 bit. Works fine in 64 bit.

    I am using Logic rewired to Ableton Live for all my tunes, so I cannot use the 64 bit version of Logic given the lack of rewire support. That and I use Novation Autopmat which is also not available, so there are multiple reasons why I need to use the 32 bit version.
    When launching 9.1 in 32 bit mode, it crashes at startup. The splash screen comes up, then my whole screen flashes, and I get the unexpected crash dialog box. Set Logic to open in 64 bit, it opens up fine.
    I have disabled all AU plugins and also removed them all from the components folder, with no positive effect.
    Logic 9.0.2 works perfectly fine, which is what I've been sticking with the past month. Any help would be appreciated.

    Can you post the crashlog? Might give some clues.
    Does Logic 32-bit work if you start it bypassing the audio engine (hold control while starting it up).

  • 10-bit color works in LR4 devel module but not in PS CS6

    Dear all,
    my setup is a ATI FirePro v4900 connected to two monitors: an Eizo CG276 and an old second monitor. I would like to get the Eizo to display 10-bit colors in PS CS6 under a 64-bit Windows 7.
    After setting everything up, I am at a point where Lightroom 4.4 displays the notorious ramp.psd file (see below) without banding in the develop module, hence I assume 10-bit is working there. In Photoshop, however, I had no success so far to get 10-bit to work.
    Here's what I've done so far:
    I set everything up as described here http://www.eizo.com/global/support/compatibility/photoshopcs6_nvidia_amd/index.html
    Summed up, I did:
    1) enable 10-bit mode in ATI driver and rebooted -> checked and this is still enabled after reboot
    2) open PS CS6 and enable "advanced" drawing mode and 30-bit display in the "performance" options and rebooted  -> checked and this is still enabled after reboot
    I verified that the monitor runs in 10-bit mode using Monitor Asset Manager 2.6 (http://www.entechtaiwan.com/util/moninfo.shtm). It states that Color bit depth is "10 bits per primary color", which is what I want.
    Then I tried to open the ATI 10-bit test file ramp.psd (http://www.amd.com/us/products/workstation/graphics/software/Pages/adobe-photoshop.aspx). In Photoshop it shows banding. As I've read that Lightroom 4's develop module uses 10-bit, I opened the file there and it had no banding.
    The only troubleshooting I could find for 10-bit colors in PS was this post http://www.dpreview.com/forums/post/40945907 however I do not have desaturation set in the color preferences of PS, hence it does not apply to my problem.
    Does anyone of you have any idea about what to try next?

    I forgot to mention: the Eizo is obviously connected to the V4900 via DisplayPort as that is the required connection type for 10-bit colors.
    PLEASE someone help me with some tip on this, I'm really stuck.

Maybe you are looking for

  • VPN Connects but unable to access internal devices

    Thank you in advance for any assistance that can be provided. I am using AnyConnect to create a VPN with an ASA 5505.  Once connected, the client needs to access a device behind a 1941 router. Internally, (not using VPN), all my routing is working co

  • Where is the ipad backup file in Mountain Lion?

    In Snow Leopard, there was a library folder in the user folder, but in Mountain Lion, you have the system library, but no user library that I can see.  I would like to locate it so that I can have the option of deleting the iPad portion of the Mobile

  • Xserve and HP StorageWorks Ultrium 1840 SCSI

    Hi everyone, I'm planning on buying a new Xserve (and an Xserve RAID) and using the relatively new HP StorageWorks Ultrium 1840 SCSI (external tape drive) to do backups. The specs are over here: http://h20000.www2.hp.com/bizsupport/TechSupport/Docume

  • Group by conversation

    Hello, I need  my "group by conversation" to include the additional keywords (in additon to the usual RE:, FWD: and a combination there of) Is there a setting or a script i can use? Thanks, Amit

  • Can't receive emails on my company's account with Yosemite

    I have a Macbook Air late 2012 with 8GB memory. I recently installed Yosemite (which I already tested on beta version last summer) and the problem is the same I had with the beta version: cannot receive emails from my company's account. The server re