Instantaneous Output to MainVI from Currently Running SubVI

My mainVI calls a subVI which outputs a value based on the given input. I want the output from the subVI to update in my mainVI instantaneously as the subVI is running. Currenlty the output in my mainVI arrives only after the subVI has completed execution. I need to have instantaneous output from subVI in my mainVI so that way I can use that instantaneous value to do other calcuations. 
I tried using reference as the output, but even with that method the output only arrives at the end of the subVI execution. 
Attachments:
mainVI.vi ‏13 KB
subVI.vi ‏14 KB

Your VIs are a mess and full of race conditions and beginner mistakes. Many code parts don't make a lot of sense.
If you read and write to local variables (e.g. the done?" boolean), you need to ensure that it is set to FALSE before the loop starts and the code has a chance to read the potentially stale value. Else you get race conditions. (LabVIEW does not execute left-to-right, execution order is only determined by dataflow).
Incrementing in a loop is better done with shift registers instead of hordes of local variables.
Here's a simplified and corrected version. See if it does what you want. Modify as needed. There are many improvements possible.
LabVIEW Champion . Do more with less code and in less time .
Attachments:
subVI_MOD.vi ‏14 KB
mainVI_MOD.vi ‏12 KB

Similar Messages

  • From any running subvi('s), read controls and choose the ones you want to save to file

    Hi all,
    I now want to read controls from any running subvi('s) and save the data into a single file. I'm using subpanel to display the running subvi and use control reference to collect all the string-typed control and save the data to a single file. While that's cheating and ugly, because the host vi usually doesn't know what controls will be there in the subvi('s).
    I'm wondering if there is a way to dynamically read controls from any running subvi and display all the avalible controls depends on what subvi is running, and let the user decide which data are to be saved. I attached the vi I have now, please give any comment and I thank you very much in advanced.
    -chen
    Attachments:
    logger folder.zip ‏86 KB

    Hi thitchen,
    without looking at your code:
    with the VI reference you can get references of all controls on the VI's frontpanel. With that reference array you can collect all string controls in that subVI. The you should display a list to the user with the names/contents of those string controls so she/he may select which ones to save...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Disconnect​ing from a running subvi (i.e., fork)

    Is there a way to start a subvi running, but not wait for it to finish?  That is, to fork or disconnect from the subprocess?
    For example, my main timing program starts subvi 1 at certain intervals (say, 10 seconds).  This subvi will, based on certain conditions, run subvi 2.  Subvi 2 will take longer than 10 seconds to complete its job, but subvi 1 needs to be completed and ready to run again when the timing program calls it again 10 seconds later.  It will not call subvi 2 this time, knowing it has not completed its job.
    Thanks,
    Karl.

    Your SubVI1 needs to open a VI reference for SubVI2. This will load SubVI2 into memory. Normally I do this when starting the application. You have to provide a path to the Open VI Reference primitive and be aware that the path will change from development environment to built application.
    Use this reference in SubVI1 to start SubVI2 with the invoke node "Run VI". You can set the Invoke node not to wait until completion. This will start the execution of SubVI2. If for any reason SubVI2 is running when calling the node you will get an error in the error out of the Invoke node but SubVI2 will continue running.
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

  • How can I Call the MainVI from its SubVI, and this happen recursively?

    Hi All,
    How can I Call the MainVI from its SubVI, and this happen recursively?
    Actually, LAbView 7.1 doesn't support recurssion?
    Plz help me out!

    Dear GerdW,
    Thanks a lot 2 all of u guys,for all the brilliant responses.
    Actually, my basic aim is to call the Main VI, containing a SubVI.....
    Now, I want to call my main VI from this SubVI...recursively!!!!!..but whenever I tried to put the MainVI in this SubVI..an error message pops out saying recursive calling is not possible.
    I also tried using "Call by reference" but tht also didn't worked...an d error is somewat like...VI is invalid..or type matching..or state matching error.
    Here, Im attaching the snapshot of the MainVI... Im calling the SUBvi from it... It is running GOOD n FINE...
    But prob arrives when I call the Main from the SUBvi, which looks like same as MainVI(with little differences).
    I hope, Im clear in my words n not being ambigous.
    Plz, correct me where ever  im wrong.
    Thank You.
    Mishra_RnD
    Attachments:
    ScrShot.JPG ‏272 KB

  • I have copied my CDs into iTunes  (currently running v11) to play on my iPod.  I have now bought a non Apple mp3 player to use when I am out running.  How can I copy the many tracks I want from iTunes onto the new player?

    I have copied my CDs into iTunes  (currently running v11) to play on my iPod.  I have now bought a non Apple mp3 player to use when I am out running.  How can I copy the many tracks I want from iTunes onto the new player?
    Thanks

    I tried Notpod but can't get it to work.  Part of the problem, I suspect, is that I can't create a folder on my player (a SanDisk Clip+).  I also can't do this in Windows Explorer.  Whilst I can see the Clip+ in Explorer, the option to create a new folder isn't there.
    The error mesag I get in Notpod is:
    "Unhandled exception has occurred in your application.  If you click Continue, the application will ignore this error and attempt to continue.  If you click Quit the application will close immediately.
    InvalidArgument=Value of '0' is not valid for 'SelctedIndex'. Parameter name: SelectedIndex"
    Then, when I plug the Clip+ into a USB port, iTunes thinks it is my iPad - which is because, I guess, Notpod hasn't worked.
    I can drag and drop files from the Music folder where my iTunes tracks are stored onto the Clip+ and they get converted but I'd rather synchronise a Playlist from iTunes if I can.
    Thanks anyone who can help

  • Can I do a clean install of Lion, onto my Mac Book Pro4,1, that is currently running 10.5.8? I have seen U-tube videos on how to do a clean install to Snow Leopard, and another from SL to Lion, but can zero out my HD, and do a clean install to Lion?

    Can I do a clean install of Lion, onto my Mac Book Pro4,1, that is currently running 10.5.8? I have seen U-tube videos on how to do a clean install to Snow Leopard, and another from SL to Lion, but can zero out my HD, and do a clean install to Lion?

    See this article.

  • I currently run Windows 7 on my iMac using the Parallels software on a Virtual Machine. I now wish to use Windows through bootcamp. How do I remove windows from the Virtual Machine

    I currently run Windows 7 on my Imac through a Virtual Machine format with the Parallels software. I now wish to remove Windows from the VM restore the Hard Drive to a single partition then install windows 7 using bootcamp. How do I go about it

    The virtual machine isn't a partition on your hard drive, it's just a file. You can delete the vm by going into Paralells preferences or just drag t to the trash. Bootcamp will partition your hard drive for a Win 7 install.

  • What Firefox version choices do I have for using Firefox on new laptop running Win 7 64-bit, and how do I move bookmarks from current laptop running Firefox 3.5.13 to new laptop?

    Currently running Firefox 3.5.13 on laptop using Windows XP pro sp3 and will want to move my bookmarks to a new laptop. New laptop uses Win 7 pro 64-bit OS. I have read too many conflicting reports about Firefox and Win 7 and understand that Firefox is working on a true 64-bit version. What are my choices for a stable web browser for new laptop and which particular version of Firefox is recommended and the pros and cons of that suggestion? (I believe one can run Firefox 32 bit version in the 64 bit environment, but is that the best choice?) I have not installed Firefox on new laptop yet and am eager to dump IE. This is being posted from my old laptop. Thanks ...

    http://www.microsoft.com/windows/compatibility/windows-7/en-us/Details.aspx?type=Software&p=Mozilla%20Firefox&v=Mozilla&uid=3&l=en&pf=0&pi=0&c=Communication%20%26%20Internet&sc=Web%20Browsers%20%26%20Plug-Ins&os=64-bit
    If you go to this link you will be assured by Microsoft and Win7 "new" app checking and making sure that all drivers and software you have is compatible with Win7 64 bit. And in this article it states that Firefox version 3 IS compatible and designed for 64 bit OS, hm mm well as you know that is incorrect!! As of today Mozilla Firefox is not designed for a 64 bit computer. Thank you for your honesty and it saved me a big headache By being upnt and honest. my books!! Great job!!

  • I have a MAC Pro from 2011 currently running MAC OS 10.9.5.  This weekend I cloned the MAC HD drive to a new SSD drive for improved performance.  The clone was completed successfully with no errors.  After the clone completed I successfull restarted my sy

    I have a MAC Pro from 2011 currently running MAC OS 10.9.5.  This weekend I cloned the MAC HD drive to a new SSD drive for improved performance.  The clone was completed successfully with no errors.  After the clone completed I successfully restarted my system using the SSD as the boot device.  I then successfully tested all of my products, including Photoshop CS6 and all of its plug-ins.  I successfully tested the key features that I frequently use.  Today while attempting to launch Photoshop CS6 a message is being displayed indicating that a scratch disk cannot be found.  All drives are available on the system via the Finder and Disk Utility.  I can access all drives including the old MAC HD which is no longer the boot device.  I've even attempted to launch Photoshop from the old device yet the same error persist.  Is there a way to review/edit/change Photoshop preferences if Photoshop doesn't launch?  I've even restarted my system several times to see if that would resolve the issues.  Does anyone have any recommendations for this issue?  Have you previously address this issue? 
    Thank you Gregg Williams

    Boilerplate text:
    Reset Preferences
    http://forums.adobe.com/thread/375776
    1) Close the program and press Ctrl+Alt+Shift/Cmd+Option+Shift during startup (not reversible)
    or
    2) Move the Folder. See:
    http://www.bugge.com/Family-and-friends/Illy/illy.html
    --OB

  • I have an aluminium Macbook Pro 15" from around 2009 currently running 10.5.8. Apparently I need to be on 10.7.2 to get into iCloud. System Profiler says my machine is Core Duo, but also says it has 2 cores - can I run 10.7.2 on this machine?

    I have an aluminium Macbook Pro 15" from around 2009 currently running 10.5.8. Apparently I need to be on 10.7.2 to get into iCloud. And I can only run 10.7.2 on a Core 2 Duo machine or above? System Profiler says my machine is Core Duo, but also says it has 2 cores - can I run 10.7.2 on this machine? Any feedback welcome.

    Read Lion's general requirements.

  • Requesting Windows Experience Index scores from anyone running WIN 7 on either current-model 13" MBPs... Thanks!

    Requesting Windows Experience Index scores from anyone running WIN 7 on either current-model 13" MBPs... Thanks!

    Hi mchainmchainmch,
    I am sorry, but to get your issue more exposure, I would suggest posting it in the commercial forums, since this is a commercial product. You can do this at http://h30499.www3.hp.com/t5/Business-PCs-Compaq-Elite-Pro/bd-p/bsc-271
    I hope this helps!
    Regards
    MechPilot
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the right to say “Thanks” for helping!

  • I need to update to the latest version of Snow Leapord-currently running v10.6. Because of where we live the slow download speed for such a large file has kept me from downloading the update. What can I do short of hooking up computer elsewhere?

    I need to update to the latest version of Snow Leapord-currently running v10.6. Because of where we live the slow download speed for such a large file has kept me from downloading the update. What can I do short of hooking up computer elsewhere?

    Do you ever visit a friend or realtive with a Mac who has faster internet? Maybe the local library has Macs on a fast line. If so, get a USB thumb drive and put this link on it from your computer:
    http://support.apple.com/kb/DL1399
    Then put this link on the drive:
    http://support.apple.com/kb/DL1429
    When you are at some place that has a Mac with a decent download speed. insert the thumb drive in that Mac and click on the first link ("DL1399") and direct the download to your thumb drive. Now do the same this with the second link.
    The installer files will now be on the thumb drive and, when you get home, drag them from the thumb drive to your desktop. Install the Combo update first.

  • ITunes 10.7 Update returns error (-1003) & remains in App Store despite updating iTunes directly from iTunes webpage several times & currently running latest version 11.0.5 (5)

    I have experienced this problem since purchasing a brand new MacBook in October 2012, basically the App Store permanently displays "1 Update Available" for iTunes 10.7 but clicking the "Update" button only results in the following error "A server with the specified hostname could not be found.(-1003)" so I have always had to go around the App Store & download & install iTunes updates directly from the iTunes webpage.  I am currently running the latest version of iTunes 11.0.5 (5) & what I believe is the latest version of OS X 10.8.4 (12E55) & I simply wish to stop the App Store displaying this update that doesn't work anyway & relates to a year old version of iTunes!!! 
    Note: It may or may not be of importance but the same problem was also happening for iPhoto & iMovie but I was able to locate fixes for these issues which entailed changing a filename in both applications' "Contents" folders from "_MASReceipt" to "_MASReceipt_FAULTY" (although I believe I could have renamed it anything!)  I obviously tried a similar thing for iTunes & App Store separately but unlike iMovie & iPhoto which were fixed immediately the recommended changes were made, these modifications did not resolve the issue which persists to this day & isn't critical but is just annoying!!!

    Search for "iTunes" in Spotlight and make sure you don't have an outdated copy lying around, perhaps on a backup volume.

  • I am trying to apply for a job on line and I am receiving this message t has been determined that you are currently running a "Popup Blocker". In order to continue, please allow this site from within your "Popup Blocker" preferences. How do I fix this?

    Hello,
    I am trying to apply for a job on line and I am receiving the following message "
    t has been determined that you are currently running a "Popup Blocker". In order to continue, please allow this site from within your "Popup Blocker" preferences
    How do I correct this??
    Thanks!

    Open Safari preferences, click on the Security icon in the toolbar, uncheck the pop-up blocker option.

  • Export current running configs from several devices

    We are currently running LMS 4.0 and have been collecting running configs on several of our devices.  Is there a folder that retains the running configs or do I need to run a report and export from the report?  If a report what report do I run.  I have been digging into the interface and I am not finding a solution so any assistance would be great.

    CSM event viewer supports events from the ASA/FWSM virtual contexts ony if each context is discovered in CSM configuration manager with separete mangement IP.
    Please try to discover the contexts as independent devices with separate management IP.

Maybe you are looking for

  • Displaying multiple roles related to a single key value in a single view MVC 4

    Dear Team,          My name is Ajay Sutar. I am newly learning MVC 4, as we are about to initiate a new project in ASP .NET MVC 4. I am using a details scaffolding to display a  single record. but now my single employee have multiple roles. As exampl

  • Mailbox database recovery to alternate location

    Hi, i'm trying to write a script to automatically restore an exchange mailbox database to an alternate location I am using $pg = get-protectiongroup -dpmservername servername $ds = get-datasource -protectiongroup $pg[2]; // 2's the index of the excha

  • Bitrate Balancing for DVD

    Hey guys, I'm trying to fit multiple sermons (about 30 minutes each) on a DVD. I've seen many churches do this, and I feel like the quality is leaps and bounds a head of what I'm producing. I'm currently capturing using a Blackmagic DeckLink (SD-SDI)

  • How to setup face time mac to mac

    how to setup face time mac to mac, does the other mac need a different apple id from the other

  • Method argument names

    Hey, quick question, and unfortunately I think I know the answer. I'm no expert at using reflection, but from what I can tell thus far, it is possible to get the Class name, the names of the fields in the class, and the method names. I need the names