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

Similar Messages

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

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

  • LV8: Diagram Disable Structure

    I am converting my test code from the use of traditional DAQ to DAQmx. In a couple of my test VIs I have the Traditional DAQ VI for Port Config. if I put those in a disable structure marked as disabled will it cause any issues when running using DAQmx drivers? I don't think it should since it does not get executed but I wanted to confirm.
    Once I verify my DAQmx changes work, I will remove it.
    Thanks
    Jeff D.
    OS: Win 7 Ultimate
    LabVIEW Version: 2011,2010,2009 installed
    Certified LabVIEW Architect

    Hi Jeff,
    That's right, any code in the disabled state of a Diagram Disable Structure does not get compiled or linked to by the owning VI.  You should be safe.
    -D
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

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

  • Diagram Disable Structure doesn't remove all objects it contains after deleting the structure.

    I have programmed in side of a while loop a Stop from "Application Control", later I used disable structure around that "Stop". It was working fine, but after removing disabled structure containing the disabled "Stop" my application stops even there was no reason to stop. Later I have experienced that removing the disabled structure leaves hidden object in the code and some how they get executed and it is no way debugging due the objects are invisible.
    I am worried that this is a bug in Labview !
    (Edi)
    Solved!
    Go to Solution.

    The Stop was in the disabled case in a frame and after removing the complete "disable structure" the software stopped randomly at the location where the disabled structure containing the Stop was already removed. Unfortunatally the code is to complex to post. I am working on a demo, but sofar doesn't prove my point yet. But I realized Labview was pointing on left over items from the disabled structure after its removal. The compiler was high lighten the hidden objects in the same shape of the object but without any visible object in the high lighted position in the graph. 
    (Edi)

  • Amusing disable structure bug

    When I say amusing I mean I took a few hours to find it and then laughed...
    If you have a diagram disable structure without an 'enabled' case LabVIEW throws and error and won't run, flags the structure and tellins you to add an 'enabled' case.  This happens even if the structure is empty.  Fair enough.
    If you a a diagram disable structure without an 'enabled' case in a disabled case of another diagram disable structure (with an enable case) then Labview won't run the vi but will only say : 'Labview needs more memory to compile vi', and won't flag the structure.  It will then often crash...
    This seems odd for several reasons:
    1)  I don't think this used to be the case - I found the bug importing an old .vi which used to work.
    2)  Logically an enable case isn't necessary - suppose I want to disable all the cases?
    3)  Why is code in a disabled case making any difference anyway?
    Anyway - hope this saves somebody a few hours
    Luke

    Jester_v01 wrote:
    When I say amusing I mean I took a few hours to find it and then laughed...
    3)  Why is code in a disabled case making any difference anyway?
    Anyway - hope this saves somebody a few hours
    Luke
    Whay answer require somebodt sitting in that conference room when the decision were made but...
    WHen the Disable structure was introduced a bug entered whenre "Source Distributions" would fail to take into concideration code in the disabled structure. Since the disabled structure was (?) intended (?) to affect if code got compiled or not but was not (?) intended (?) to influence if code was part of the Source Distribution this was called ab ug and I think fixed. Others have since realized the bugging behaviour was actually a bug and what they thought was a feature was really a bug.
    So I suspect you have found another corner case not concidered in that conference room years ago.
    Just my guess. If you have a better one please share.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Another use for the disable structure (Bug or Feature?)

    Hi,
    I always use a lot of dynamic VI's in my projects, and sometimes I need to
    pass parameters to them. I use Set Value methods.
    One problem is that when you build an executable, the application builder
    (AB) removes the panels by default, and the Set Value method will fail... I
    know you can change the AB settings, but I was getting tired of that (and
    had some free time). I also know you can change the VI properties so AB
    won't remove the front panel...
    But I started looking for things that tells the AB not to remove the front
    panel.
    I found out that the FP won't be removed when the VI has an event structure.
    And it turns out that this works even if you put the event structure in a
    disable case!
    I'm pretty sure this isn't supposed to happen. I'm not so sure if it's
    usefull since it might change over versions (I use 8.5.1), but I thought I'd
    share it anyway...
    Regards,
    Wiebe.

    Just today I had a problem with a VI with a diagram disable structure that would compile but the FP of the executable was mallformed and cause the whole app to crash.
    So I stay away from diagram disable structures in execution code.
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • LabVIEW Mac prompting me for dll's in conditional disable structure

    I'm using LabVIEW 2014 Mac and I have several conditional disable structures which call user32.dll but only in the Default case whereas they do nothing in the TARGET_TYPE=Mac case.  When loading my source code in LV Mac I get prompted to find "user32" and I have to Ignore All.  Afterwords the code is open with no errors.
    It seems to be a bug that this prompt is occuring?  Is there a way to supress it?
    Solved!
    Go to Solution.

    Hello Thomas,
    It sounds like the user32.dll is being loaded along with your LabVIEW code on launch instead of being loaded when called. What you can do is encapsulate the function that is making the user32.dll call in a subVI (if you haven't already done this), right-click the subVI and go to Call Setup. From this window, choose Load and Retain on First Call. This should make sure the user32.dll is only loaded when you reach the Default case in your Conditional Disable structure, and not search for it every time the code is loaded into LabVIEW.
    Hope this helps,
    Siana A.
    Application Engineering
    National Instruments

  • 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

  • Is code in a disable structure included in an executable?

    I have a LabVIEW 8.6 VI that I would like to build into an executable.  This code includes several PXI drivers for motion control and power supply control.  I have a hardware simulation mode built into the code that will allow me to run the front panel regardless of whether the software is running with hardware or not.  There are case structures around each of the hardware driver VIs in the software.  If I am running the code normally, the cases with the hardware driver VIs will be called and they will operate the connected hardware.  If I am running the code in hardware simulation mode, the cases with VIs that fake hardware will be called.  All of this works as I intended.  The problem comes when I try to build the code into an executable and distribute it to people who I know don't have the hardware, and probably don't even have LabVIEW installed.  The problem is that these people will have to install the NI runtime support (which I am perfectly fine with) but they will also have to install the drivers for the hardware that they don't have.
    I am wondering if I were to change the case structures to conditional disable structures and disable the drivers, would that code still be included in the executable and require someone to install unused drivers to run the simulated code?
    Eric C
    Systems Integrator, National Technical Systems
    Certified LabVIEW Architect

    Hi Eric C,
    Good Morning and I hope your well today.
    Thanks for your interesting post! 
    I would like to highlight one aspect of the help file, " ..Has one or more subdiagrams, exactly one of which LabVIEW uses for the duration
    of execution,..". To me, this suggests at run time only one case will be valid. Thus, I don't believe this will act as you wish. Secondly, I am under the impression that this can't be used in an executable (compiled form - I got an error 1 when trying to). This maybe because the exe can't decide what case to use. Due to the above, I feel we should look at this issue from a different angle. 
    To make it clearer, once the code is deployed there is no longer the conditional structure OR the code in the other frames. (There are however if your making a source distribution). 
    I am guessing your driver would be calling third party dlls, and the exe will load these at the beginning. So this is likely to generate the browse window is the driver isn't installed. In your documentation you could include that this means you need to install the driver. If your user was then to run the code you could use a case structure and test that the file has been created by the installer for the driver (I.e. no install directory no driver). This would then prevent the end user running the application without the driver.
    Thus, if you feel its not ideal the customer sees the browse window then you could run the installer for the driver at the end of the NI installer, which you could include when you distribute your application.
    Please let me know  your thoughts, 
    Kind Regards
    James Hillman
    Applications Engineer 2008 to 2009 National Instruments UK & Ireland
    Loughborough University UK - 2006 to 2011
    Remember Kudos those who help!

  • Diagram Disable produces "-17502 System Level Exception" with TS 4.2 + LVRTE 8.6.1

    I had a labview VI that had a diagram disable structure on it.  TestStand loaded it all right, but threw a -17502; System Level Exception at runtime.
    TS 4.2, using labview 8.6.1 RTEW adapter.

    Jed -
    Could you please attach files that reproduce this behavior?
    Manooch H.
    National Instruments

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

  • Disabling SMB2 and SMB3 Client from Windows Vista, Windows 7 and Windows 8.

    There are many programs that are using a shared file on the server from clients from XP to Windows 10. From time to time it seems like there is a network outage and the handle to the file is broken and the file
    cannot be read or updated. It seems more prevalent on a Windows 2012 server but may have happened from time to time on 2008 & 2008 R2. However there are not any network problems so it just leaves the server & Client
    I have searched for possible resolutions including:-
    Turning  off the Cache for the share
    Disabling the network adapter power setting to allow windows to put the device to sleep.
    Disabling  Antivirus/configuring it to ignore folders for on access scanning
    Disabling SMB  Signing
    Configuring the  clients DWORD registry value SilentForcedAutoReconnect=1 in HKEY_LOCAL_MACHINE\Software\Microsoft\CurrentVersion\NetCache
    Setting the "NET CONFIG SERVER /AUTODISCONNECT:-1" to not drop client
    connections
    The last bit of trouble shooting that I can think of is to disable SMB2 and SMB3 as that does a lot of caching and batching of packets which could also be the cause of the problem.
    I have looked at
    http://support.microsoft.com/kb/2696547/en-us
    I have disabled SMB2&3 on the server as that is very straight forward.
    When I get to the section about disabling SMB2 on the client the command fails.
    sc config
    lanmanworkstation depend= bowser/mrxsmb10/nsi
      After running the above command, it returns an error: 
          [SC] ChangeServiceConfig FAILED 1059:
          Circular Service Dependency was specified.
    So it's not worth running the following command:
    sc config mrxsmb20 start= disabled
    I have tried the command on Windows Vista, Windows 7 and Windows 10 just to confirm that it's  nothing to do with any particular PC, machines in Domains and Non-Domain machines.
    So, my questions are:-
    1, is
    http://support.microsoft.com/kb/2696547/en-us actually correct and up to date and for the OSes (Vista, 7, 8, 8.1, 2012 server and Windows 10) with latest updates & service packs?
    2, How do I disable SMB2 and SMB3 on clients for troubleshooting purposes the server to resolve problems with shared files (multi user access)
    3, If I just disable SMB2 & 3 from the server would that force the clients not to use SMB2 when communicating with the server and therefore not caching the directory structure and file not found etc? I have seen posts that suggest this is not the case.
    4. Does sc.exe have a bug in it?
    Thanks in advance
    Rob

    Hi,
    I made a test in our testing enviroment, everything works fine to disable SMB2 and 3. For your problem, in my opinion, as I didn't find any specific report about this error, it would be better to use Process Monitor to capture the trace when running the
    command.
    Start Process Monitor, then set the filter as cmd.exe, after that, open CMD and execute the command.
    Process Monitor:
    http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx
    In addition, I found another thread that had similar error with yours, you can take its solution as reference.
    https://social.technet.microsoft.com/Forums/windows/en-US/506828c8-e7af-4039-aca7-43321939bb55/offline-files-synchronization-error-the-file-specified-cannot-be-found?forum=w7itpronetworking
    Roger Lu
    TechNet Community Support
    Roger,
    Many thanks for the time taken to look into this.
    I've downloaded process monitor and loaded it. I filtered for cmd.exe started capture and saved a 1mb file.
    However I don't think this is going to help unless you can point me in the direction of what you're expecting to see in the capture file? If you want me to send you it I can but it does contain personal information which I'd rather not place online.
    You can recreate the problem yourself by doing the following:
    Go to modern.ie
    Download any windows 7 virtual machine for your preferred of virtualisation  platform 
    log in, start cmd as administrator and run the command
    sc.exe config lanmanworkstation depend= bowser/mrxsmb10/nsi
    You will also receive the same error.
    [SC] ChangeServiceConfig FAILED 1059:
    Circular Service Dependency was specified.
    You can also try it on the Windows 8 and 8.1 machine if you have time.
    I checked the link to the similar error and that just looks at the file not found problem which is the smb2 cache. They still didn't resolve the slow access to the share which is seen on a machine that has anti-virus on it when you go to right click
    on the folder or a file in the folder. It's about a 20 second (spinning circle) pause every time. The problem is bigger than that. If you have shared files on the network share that are used by multiple people at the same time, say a spreadsheet or database
    file windows is loosing the connection to that file so the user cannot write to it even if they have the file open. The smb2 caching shouldn't cause that problem.
    It appears that I have to disable from SMB2 and SMB3 and ensure that the clients only use SMB1.
    If SMB2 & SMB3 are disabled from the lanmanworkstation service the clients will not do any caching even if the server has disabled the share cache (offline files for that share).
    The problem with the "Circular reference" error message is standard across all versions of windows that have "smb2" or "smb2 and smb3". Can you recreate that problem? Or is it working on your windows computer and on the machines
    downloaded from modern.ie ?
    My testing has shown that the command "sc.exe config lanmanworkstation depend= bowser/mrxsmb10/nsi" does not work. Therefore that's the one I want to resolve first. By resolving that I may be able to get the clients accessing the share to behave
    themselves and use the shared files correctly as they always did from Windows 95/NT4 through to Windows XP and 2003/2008 server.
    I'm unable to recreate the problem with multiple users having access to shared database files on windows 2012 server from Windows 7 clients were the access to the files drops once a day or once every couple of days.
    Kindest Regards
    Robert

  • Close and open subVIs from main VI

    Hi,
    I am working on an issue. I have two subMainVI and both of them has have own FrontPanel. I want to merge these two subMainVI into the program and call them repeatadly with the another Main VI front panel. Simply, I when the program starts, the mainVI FP open and there are two buttons. When user clicks the button A, the subVI A FP open and it executes (some user events...) till the user close the VI (the standard cross button). Then the user can click the button A again or for a change the button B and then the subVI B starts to execute (event again). The program should run till the main VI (with the two buttons) is closed.
    I tried to do something similar with one subVI, but I was not succesfull. I was able to open and close the subVI once, but then the app gets frozen...
    I do not have much experience with events...I believe it may be easy for someone...I would appreciate some simple code example...
    Attachments:
    pokus.zip ‏19 KB

    billko wrote:
    camerond wrote:
    billko wrote:
    camerond wrote:
    Here's an easy way to do it, using a WHILE loop, T/F Case structures and local variables.
    Cameron
    It may be an easy way to do it, but it's basically bad programming.  You shouldn't use while loops to poll buttons when you can make it event-driven.
    But if he's confused with events, this does work. It may not be the most elegant solution, but that doesn't make it "bad" programming unless it interferes with his tasks. Computers are so fast and have so much memory now, that you don't always have to do things the most efficient way to get them done. Just IMHO, it's better to help someone with something he can understand than to give him a black box with magic inside, unless his goal is to learn the magic now.
    TIMTOWTDI.
    Cameron
    Understood, but teaching someone bad habits is not good, either.  Best to learn the right way or it will cause problems down the line.
    [edit]
    Granted that a QMH might be too complicated for a beginner, but then a simple event-driven structure would've been a better choice.
    It's never a good idea to peg a CPU core to just poll a button.  Instead, we should be trying to help the OP understand the event structure.  I looks like they already understand it enough to use dynamic events.
    They're only problem was not unregistering the events.  If you don't unregister, then the next registration will likely not work, which is what happened here.  But the easier solution is to just not use the dynamic events since the VI Panel Close event is a default one that you do not need to register for.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

Maybe you are looking for

  • How can I get an Ipod 4th generation users manual

    I bought a refurbished IPOD touch 4th Generation 8 GB as a Christmas gift for my niece from the apple store but it does not have a user manual with it. IS there anywhere I can get one to include with it when I give it to her for Christmas.

  • Word 2013 - Error inserting an HTML file in a word document

    Hello, Here is an issue i'm having: Open a blank doc in Word 2013 Click Insert - Object - Create from file. Then select an html file, click insert and ok. i'm always getting the below error message: I can reproduce this issue on multiple machines. Of

  • Where do i find what i have boughten on itunes???

    I NEED HELP

  • Online portfolio functionality help

    I'm a clothing designer, and in my sector, portfolios are usually in a book format. I'd like to mimic that format in my online portfolio. The closest I can come is with the slideshow feature: I do a picture page containing all the pages of the "book"

  • Flash file coming up in google

    Hello, I've used Flash for my portfolio which has details of websites that I've designed -www.rubydesign.co.uk/portfolio.html but one of my clients has told me that when he googles his name "sean pines" the fourth link that comes up is the flash movi