Diagram disable adds overhead in certain cases

I was doing some timing tests of two ways to do the same thing – a typecast and flatten to string.  Well, in the process I saw a discrepancy when a diagram disable structure was wrapped around a typecast.  Without the diagram disable, 1000000 iterations took 274 msec.  With a diagram disable around the same thing, it took 1485 msec.
This scared me a bit, because technically the diagram disable case should be no different (ok, maybe a small overhead).  It further scared me, because the same overhead is invisible with flatten to string.  Inconsistent behavior…
The vi that clearly shows the “bug” in 8.0.1 is attached.
This is not a show stopper, but says “use the diagram disable structure with caution”.
Thoughts?
Attachments:
Diagram Disable Bug.vi ‏24 KB

Apparently that wasn't the only case where Diagram Disable behaves differently than just having the code inline.  I also was  investigating the performance of certain VIs, because I wanted to know if variant operations were faster than flatten/unflatten to/from string.
In the following snippet, I set the number of loop iterations to 100 and ran the VI, resulting in an Elapsed Time of ~50ms.  I then moved the 'To Variant' VI inside the Enabled structure for both cases (Disabled and Enabled), and running the VI again resulted in an elapsed time of over 2 seconds!  The source code should be identical in both cases, but it appears as though there is some optimization occuring in the first case that is not occurring in the 2nd case. It's as though in the first case, the compiler is smart enough to realize that the loop output does not change from iteration to iteration, but in the 2nd case it gets stupid.
So continue to beware of the Diagram Disable structure...
Attachments:
benchmark.png ‏71 KB

Similar Messages

  • Replace Diagram Disable Structure by Case structure?

    I may be missing something but at least in LV 2010, it appears only possible to replace a "Diagram Disable Structure" by a "Conditional Diagram Disable Structure".
    I don't see why it is not possible to replace it by a case structure... The content is very similar and I have faced occurences where I would toy around between different versions of my code and eventually decided that I wanted to offer the user the possibility to choose between them using an enumerated control (or Boolean). Currently you have to rewrite the code in a newly dropped case structure, which is a waste of time. I guess I could stop using Diagram Disable structures altogether, but I most of the time use them for their intended use, so that would be a step backward in functionality if I forced myself to use case structures "in case" I would later want to offer these different cases to the user (which is something that I can't always predict).
    Solved!
    Go to Solution.

    You are not alone.
    http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Add-the-ability-to-replace-a-disable-structure-with-a-...

  • Disable Add to Cart in inProcurement Page

    Hi Gurus ,
    /oracle/apps/icx/icatalog/shopping/webui/SearchResultsPG
    I have to disable 'add to cart' button in the iprorcurement categories serch page ,
    the issue here is when i search for some item , it can show multiple catagores
    each having a add to cart button enabled , i have to selectively disable the 'add to cart' for some items based on some condition , for others its should be enabled .
    Please help me in solving this ..

    Prasad,
    The way it works in iP Search Results page is that the results region is added dynamically to the results page. If you need to dynamically disable the add to cart button, you must have a boolean attribute in your VO and then define a SPEL on the region item. However in our case, you cannot attach the SPEL through personalization.
    When you extend the VO for added a new boolean attribute that derives the value based on the category. You'll have to do this for different VOs. As the VO used to display search results is not one. It might be different based on many criterias. If you are handling this, you need to make sure that the new attribute is included in all the Search Result VOs so that you don't get an "Attribute not found" error in some cases.
    Hope this clarifies.

  • Diagram Disable cosmetic bug ?

    Start from here (attached VI):
    switch to the Enabled case and wire the top tunnel to the right tunnel:
    Oops! While is the wire misaligned?
    The strange thing is that this problem does not occur if you wire from right to top.
    Tested in LV 2011.
    Attachments:
    Diagram Disable Cosmetic Bug.vi ‏4 KB

    Actually, this also occurs with For Loops as well:
    (you need to first connect the array to the Loop border. Then in a second step, connect the autoindex thingy to the other side - I know this is not what you would do normally, but this is just illustrating the bug).
    Oddly enough, this does not appear to be the case from below:
     ...for the For Loop. The Disable Structure does that from below:

  • Diagram Disable Structure and Asynchronous SubVI Bug?

    In this diagram, the boolean value won't arrive at the Boolean 2 indicator until ASYNC has completed running.
    Without the Diagram Disable Structure, it does not wait for ASYNC to complete.
    I always believed the Diagram Disable structure would compile the Enabled case as if the structure weren't there, but that is clearly not the case.
    Is this a bug?
    Solved!
    Go to Solution.

    I don't think I agree with you here. The flat sequence structure would behave exactly the same, no matter if it is internally implemented as a node or not. This is how LabVIEW dataflow has worked since the inception of LabVIEW and I see no reason why it should change.
    The border of a structure is a border that has well defined behaviour. The structure will not start before all its inputs are satisfied and the output tunnels will not be passed on until everything inside the structure has finished execution. If you want to have Boolean2 update while Async VI is still executing you have to place its terminal inside the DSS (or (Flat) Sequence Structure). This has been so since I first started to work in LabVIEW in version 2.2.1 and better stays so as long as LabVIEW wants to stay dataflow driven.
    All text code programming I know of wouldn't behave differently although there you don't have dataflow anyhow so the point is really mute as the sequential flow of the code is all that matters there.
    Inlined code is a special case. If they wouldn't do that you could get all kinds of very difficult to debug issues, because your code executes different depending on the inline status and may cause side effects that cause different results because of that.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Diagram disable structure not really disabling?

    I have a VI in which I had put a diagram disable structure (not the conditional one) around a section of code containing the Time Delay VI (this is the only place where I have the Time Delay VI). I built an executable containing this VI. When I start the executable I get an error that esssentially says it can't find the Time Delay VI. I removed the diagram disable structure (and the code inside it) and I no longer get the error. I thought the code inside the diagram disable structure wasn't supposed to get compiled. Right?
    George

    I just made a test built with a diagram disable structure containing an odd subVI in the disabled case and cannot reproduce this error. Are you sure that the relevant case is set to disabled?
    Can you attach a simple VI that shows the problem?
    LabVIEW Champion . Do more with less code and in less time .

  • Disable 'add measurement' in multiple limit test

    Hello,
    My goal is to make a step type which executes a specific code which returns 3 measurements. The user who uses the step of that type must be able to apply limits on these measurements but not change the number of measurements.
    So I use a Multiple Numeric Limit test, but I don't succeed in fixing the number of numeric limit test
    On way could be to disable add/remove measurement from the limit tab, but I didn't found the way to do that
    I tried to make Step.ExpectedNumMeas not editable, but that doesn't work
    Does anybody have an idea ?
    Thanks
    Laurent

    Hi Laurent,
    Your technical issue is a typical case where your need to create a custom step type.
    Two options in your case :
    1°) Duplicate the existing one by copy/pasting the MultipleNumericLimitTest from NI_Types.ini in the same file (it will be renamed MultipleNumericLimitTest_2) and then Cut/paste it in a new step type palette.
    Once you have done that you can edit the content of this custom step type definition.
    BUT I think the second option is better:
    2°) Create a new custom step type from scratch (not by copy pasting the one from NI).
    Have a look to the architecture series and TestStand Help for learning how to create custom step type.
    If you need more assistance you can keep writing on this topic
    regards
    Romain DUVAL || Application Engineer Specialist ||Certified LabVIEW Architect (CLA) || Certified TestStand Architect (CTA)
    National Instruments France

  • Program won't build if a broken vi is included in a diagram disable structure

    I develop code that can run on both PXI and Compact RIO devices.
    To allow for the different DAq methods I have a target specific child object that I tried putting in a conditional disable diagram.
    I found that even if it was disable, the build would still fail.
    When you build rio code on a pxi target, you et problems But I didn't expect them if the class was diagram disabled
    In fact it won't build if it is in the project at all.
    Posted as a bitter lesson for others to avoid.
    iTm - Senior Systems Engineer
    uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT

    I just made a test built with a diagram disable structure containing an odd subVI in the disabled case and cannot reproduce this error. Are you sure that the relevant case is set to disabled?
    Can you attach a simple VI that shows the problem?
    LabVIEW Champion . Do more with less code and in less time .

  • Firefox won't open; tried all I found on this site; can't get in to disable add-ons.

    Firefox will not open. Little wheel spins, then disappears. Nothing.
    Re-started computer - several times.
    Reinstalled Firefox. Nothing. Can't open in Admin. Can't open with double click or with right-click "Open".
    Many fixes on this site suggest going to the Firefox button to disable add-ons - of which I have few - however since Firefox won't start, I can't try these options.
    Can't get to my profile. (Have not changed my profile or add-ons for ages.)
    This seems to have happened right after the most recent update.
    I've read everything I can find on this website and other places, and can't make it work.
    Can't find old Firefox on program list, thus can't uninstall old version - perhaps this occurred automatically with new Firefox download?.
    Ran Spybot and deleted some adware and mal-ware. Still nothing. Ran Microsoft Security - nothing.
    I'm running Windows 7.
    I can't open the troubleshooting file offered below.
    Firefox was working well until yesterday. Sigh. Can anyone help with this?

    You can use one of these to start Firefox in <u>Safe Mode</u>:
    *On Windows, hold down the Shift key while starting Firefox with a double-click on the Firefox desktop shortcut
    *On Mac, hold down the Options key while starting Firefox
    *Help > Restart with Add-ons Disabled
    *https://support.mozilla.org/kb/Safe+Mode
    Create a new profile as a test to check if your current profile is causing the problems.
    Do a clean reinstall and delete the Firefox program folder before (re)installing a fresh copy of the current Firefox release.
    Download a fresh Firefox copy and save the file to the desktop.
    *Firefox 22.0: http://www.mozilla.org/en-US/firefox/all.html
    Uninstall your current Firefox version, if possible, to cleanup the Windows registry and settings in security software.
    *Do NOT remove personal data when you uninstall your current Firefox version, because all profile folders will be removed and you lose personal data like bookmarks and passwords from profiles of other Firefox versions.
    Remove the Firefox program folder before installing that newly downloaded copy of the Firefox installer.
    *(32 bit Windows) "C:\Program Files\Mozilla Firefox\"
    *(64 bit Windows) "C:\Program Files (x86)\Mozilla Firefox\"
    *It is important to delete the Firefox program folder to remove all the files and make sure that there are no problems with files that were leftover after uninstalling.
    *http://kb.mozillazine.org/Uninstalling_Firefox
    Your bookmarks and other personal data are stored in the Firefox profile folder and won't be affected by an uninstall and (re)install, but make sure that "remove personal data" is NOT selected when you uninstall Firefox.
    If you keep having problems then also create a new profile.
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    *http://kb.mozillazine.org/Profile_backup
    *http://kb.mozillazine.org/Standard_diagnostic_-_Firefox#Clean_reinstall
    Do a malware check with some malware scanning programs on the Windows computer.<br>
    Please scan with all programs because each program detects different malware.
    Make sure that you update each program to get the latest version of their databases before doing a scan.
    *Malwarebytes' Anti-Malware:<br>http://www.malwarebytes.org/mbam.php
    *SuperAntispyware:<br>http://www.superantispyware.com/
    *Microsoft Safety Scanner:<br>http://www.microsoft.com/security/scanner/en-us/default.aspx
    *Windows Defender: Home Page:<br>http://www.microsoft.com/windows/products/winfamily/defender/default.mspx
    *Spybot Search & Destroy:<br>http://www.safer-networking.org/en/index.html
    *AdwCleaner:<br>http://www.bleepingcomputer.com/download/adwcleaner/<br>http://www.softpedia.com/get/Antivirus/Removal-Tools/AdwCleaner.shtml
    *Kasperky Free Security Scan:<br>http://www.kaspersky.com/security-scan
    You can also do a check for a rootkit infection with TDSSKiller.
    *Anti-rootkit utility TDSSKiller:<br>http://support.kaspersky.com/5350?el=88446
    See also:
    *"Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked

  • HT201299 My Iphone 4s wont remember the disable cellular data for certain apps as I soon as I switch on the 3g and go back to home and come back again to Cellular the all apps are being enabled..Please help

    My Iphone 4s wont remember the disable cellular data for certain apps as I soon as I switch on the 3g and go back to home and come back again to Cellular the all apps are being enabled..Please help

    First, try a reset: hold down the home button along with the power button until you see the Apple, then let go.

  • HT201299 Not enable or disable cellular data for certain iOS apps and features from setting? I keep it off but when I go to other app it on automatic

    I can't  enable or disable cellular data for certain iOS apps and features from  setting.
    When I off data for specific application and go to other option it automatic on all application
    Any one can help

    SOLUTION! (NO NEED TO RESET YOUR IPHONE SETTING!)
    I have the same issue for the last two weeks. But i have already managed to solve the issue all by myself. When i go to Settings > Cellular > below the tab "use cellular data for:", i turned off some apps which i didnt want to use with cellular data. As soon as i go back to Settings, and then i went back to Cellular, the apps which i had switched off earlier, automatically turned back on.
    Here's the solution:
    Either you're using wifi or cellular data, first of all you're gonna hafto turn on the cellular data use for App Store. Once you have turned it on, go to App Store application. Update ALL the apps which have new updates available. If it asks you to log in your App Store, just do so. If there's something wrong with your debit or credit card information, it will ask you to update to a different card. Just do what it asks. Put in a new credit or debit card info and fill in the forms provided. The card you're using must be usable and has usable balance in it. Let's say atleast $10 to $20. As soon as it confirms your card successfully, the app updates will start automatically. Continue to update all the apps. After all updates are finished, go back to Settings > Cellular. Try to switch on or off some apps for data use and recheck.
    Try it yourself! Have a nice day and don't put a blame on Apple for this.
    From Malaysia, with love.
    Please hit LIKE button if this solve your issue. Thank you very much! (:

  • How do i get my code to be applicable in a certain case

    Greetings ABAPers. I would like to know the various ways in which i can get my code to be applicable in a certain case. Ive include the code below. I want the code to execute only when the object type is 'BP' for business partner. That is, i want my logic (code) to execute only when the object type is an external object (BP) otherwise it should be handled normally the way SAP handles internal objects. The tricky part for me isnt the actual check because i could have used the CHECK statement. The tricky part is how do i tell it to handle it the way SAP handles normal internal object assignments i.e. pass execution onto SAP so to speak.
    Any suggestions as to how i can clean up my code and improve my commenting is also greatly appreciated.
    Code:
    method if_ex_hrbas00infty~before_output.
    Ensure that this validation only occurs for this user
    check sy-uname = 'LMANDIMIKA'.
    If the function code is an insert then continue or stop otherwise
    check pppar-fcode = 'INSE'.
    *Data declarations
    data: lt_hrp1001 type table of hrp1001,
    ls_hrp1001 type hrp1001,
    lv_sobid type sobid,
    lv_sclas type sclas,
    lv_rsign type rsign,
    lv_relat type relat,
    lv_plvar type plvar,
    lv_otype type objid.
    Clear the local table and local variables
    refresh lt_hrp1001.
    clear: lv_sobid, lv_sclas, lv_rsign, lv_relat, ls_hrp1001, lv_plvar, lv_otype.
    *Take our data declarations and insert data elements from the new relationship which we are trying to create.
    lv_sclas = old_innnn-vdata+0(2). "target object type
    lv_sobid = old_innnn-vdata+2(10). "target object ID
    lv_rsign = old_innnn-subty+0(1). "relationship direction
    lv_relat = old_innnn-subty+1(3). "relationship type
    lv_otype = old_innnn-otype.
    lv_plvar = old_innnn-plvar. "planned version
    *Check for existing relationships between a BP of that type with other external objects
    select * from hrp1001 into table lt_hrp1001
    where plvar = old_innnn-plvar
    and sobid = lv_sobid
    and sclas = lv_sclas
    and rsign = lv_rsign
    and relat = lv_relat
    and otype = lv_otype.
    *Loop through the table and compare the existing relationship with the new one
    loop at lt_hrp1001
    into ls_hrp1001.
    Check that the end date for the existing relationship is after (greater than) the start date for the new relationship.
    if ls_hrp1001-endda > old_innnn-begda and ls_hrp1001-begda < old_innnn-endda.
    message e004(/cco/a3_msg) with lv_relat lv_sobid '' ''.
    exit.
    endif.
    endloop.
    endmethod.

    Hello kpmolinarivera,
    The iTunes Store country can be changed in Settings > iTunes & App Stores > Apple ID: > View Apple ID > Country/Region.
    iOS: Changing the signed-in iTunes Store Apple ID account
    http://support.apple.com/kb/HT1311
    Cheers,
    Allen

  • How do i get my code to be applicable in a certain case only

    Greetings ABAPers. I would like to know the various ways in which i can get my code to be applicable in a certain case. Ive include the code below. I want the code to execute only when the object type is 'BP' for business partner. That is, i want my logic (code) to execute only when the object type is an external object (BP) otherwise it should be handled normally the way SAP handles internal objects. The tricky part for me isnt the actual check because i could have used the CHECK statement. The tricky part is how do i tell it to handle it the way SAP handles normal internal object assignments.
    Any suggestions as to how i can clean up my code and improve my commenting is also greatly appreciated.
    Code:
    method if_ex_hrbas00infty~before_output.
    Ensure that this validation only occurs for this user
      check sy-uname = 'LMANDIMIKA'.
    If the function code is an insert then continue or stop otherwise
      check pppar-fcode = 'INSE'.
    *Data declarations
      data: lt_hrp1001 type table of hrp1001,
            ls_hrp1001 type hrp1001,
            lv_sobid type sobid,
            lv_sclas type sclas,
            lv_rsign type rsign,
            lv_relat type relat,
            lv_plvar type plvar,
            lv_otype type objid.
    Clear the local table and local variables
      refresh lt_hrp1001.
      clear: lv_sobid, lv_sclas, lv_rsign, lv_relat, ls_hrp1001, lv_plvar, lv_otype.
    *Take our data declarations and insert data elements from the new relationship which we are trying to create.
      lv_sclas = old_innnn-vdata+0(2).    "target object type
      lv_sobid = old_innnn-vdata+2(10).   "target object ID
      lv_rsign = old_innnn-subty+0(1).    "relationship direction
      lv_relat = old_innnn-subty+1(3).    "relationship type
      lv_otype = old_innnn-otype.
      lv_plvar = old_innnn-plvar.         "planned version
    *Check for existing relationships between a BP of that type with other external objects
      select * from hrp1001 into table lt_hrp1001
        where plvar = old_innnn-plvar
          and sobid = lv_sobid
          and sclas = lv_sclas
          and rsign = lv_rsign
          and relat = lv_relat
          and otype = lv_otype.
    *Loop through the table and compare the existing relationship with the new one
      loop at lt_hrp1001
        into ls_hrp1001.
    Check that the end date for the existing relationship is after (greater than) the start date for the new relationship.
        if ls_hrp1001-endda > old_innnn-begda and ls_hrp1001-begda < old_innnn-endda.
          message e004(/cco/a3_msg) with lv_relat lv_sobid '' ''.
          exit.
        endif.
      endloop.
    endmethod.
    Edited by: Lovemore Mandimika on May 14, 2008 10:36 AM

    Hello kpmolinarivera,
    The iTunes Store country can be changed in Settings > iTunes & App Stores > Apple ID: > View Apple ID > Country/Region.
    iOS: Changing the signed-in iTunes Store Apple ID account
    http://support.apple.com/kb/HT1311
    Cheers,
    Allen

  • Is there a way to make a number of cells add to a certain number. I need 5 or 6 cells to add to 1700. If one of the cells becomes 0, I need the other cells to change so the bottom number stays at 1700.

    is there a way to make a number of cells add to a certain number. I need 5 or 6 cells to add to 1700. If one of the cells becomes 0, I need the other cells to change so the bottom number stays at 1700.

    Okay then. If your seven numbers are in column B then the formula next to each number in column C would be
    =IF(B=0,0,1700/COUNTIF(B,">0"))
    This assumes all non-zero numbers are positive numbers. The sum will be 1700.

  • How to Remove Disabled Add-ons

    Working add-ons can be removed easily with a single button - whereas, disabled ones are not presented in the Add-on Manager with a means for removal.
    Seems an oversight; but in any event, with nothing in the FAQs about removing disabled add-ons, I'm hoping someone will point the way to add-on handling details

    Of course I tried uninstalling via the original install route in the originating program before coming here. ¡D ooh! There's no apparent effect.
    Specifics:
    * extension: Firefox '''''Synchronization''''' Extension 1.7.110.333
    * purpose: enables '''''Nokia Suite''''' to synchronize bookmarks and web feeds with Firefox
    * originator: Nokia Suite ''3.3.89''
    * Ff version: '''''12.0'''''
    * computer: ''hp pavilion notebook'' ze5200
    * OS: '''''MS Windows 7''''' ultimate SP1 fully patched
    Any clues?

Maybe you are looking for

  • Lock ups, etc.

    I have had my first generation IPod for about 1 1/4 yrs. Just recently it has started acting up frequently and requiring me to reset several times daily and eventually leading to a restore at least once a week (getting the 'you must restore IPod' mes

  • How to show a JSP Page Multiple Times ??

    Dear Experts, Our requirement is like : The client chooses to enter the details of 10 customers in the First Jsp page , by selecting 10 in a dropdown list and clicks the Proceed button in the same JSP. The Second JSP ie. Customer Details Jsp is poppe

  • Using my external hard drive with my Mac?

    I have a Maxtor external hard drive I used with my Dell.  Can I use it with my Mac?  Any worries about simply connecting it and seeing what will happen?

  • Trying to update in itunes, I get network connection timed out.  What can I do?

    Trying to undate ITunes, I get error "network connection timed out."  What can I do?

  • .dwt to .html files for upload

    Help! Newbie, designed my site in DW8, and all of my pages are .dwt. To upload to remote server for site to work I have to convert pages to .html, rename front page as index.html, and redo page links. Ok. But when I do this all of my images on the en