Main/subVI control confusion

hello one and all,
i am a little confused on the best way to approach this.  i have a main and sub VI.  the main VI is the main VI and the sub VI has a complex settling routine and after all the little parameters have settled out, it quits its while loop and returns control back to the main which collects, averages, and manipulates the settled data.
ok, so i want the stop button on the main VI to stop the sub VI while loop in mid stream if need be; to gracefully exit the program.  so i experimented with Notifiers, which worked well with the latter.  but then i need to pass input parameters changes from the main into the sub and then when the sub is finished settling, pass output parameter changes from the sub back into the main.  i tried Notifiers on that and it looks ok with the input parameters but gets pretty damn messy with the output parameters.
so what is the best way to approach and achieve input and output parameter changes while gracefully aborting nicely?  thank you in advance and have a great day.  lucas  p.s. i am using labview 2010 x64 bit under win7.

Take a look at the 'message handler' design pattern.
I'd use queues instead of notifiers, as passing a bunch of parameters would override each other when using notifiers.
Then use a 'message'-type-def-cluster. First part is the message such as SetParamA (use an enum or string), the second part is any data you want to send along such as parameter values (use string or variant + FlattenToString/UnflattenFromString or the variant functions). I did demonstrate this using events here.
You will need to code your message handler ('SubVi') to check from time-to-time if a new message is available. This is best modelled as a state-machine, where you either have an 'idle' state in which you wait for the next message or you check for new messages in each iteration and perform 'normal' states when the Dequeue gives you a timeout, otherwise first handle the message.
Felix
www.aescusoft.de
My latest community nugget on producer/consumer design
My current blog: A journey through uml

Similar Messages

  • Main "Play Control" volume changes on its own when I open and close WinDVD or Winfast

    Main "Play Control" volume changes on its own when I open these programs, and when they're closed the main volume resets to where it was before the program was opened.
    Surely I'm not the only one who has had this problem before.. I've had the problem with both Creative soundcards I've owned, before and after different drivers installations.
    It can be very irritating and can potentially lead to damaged speakers if I'm not paying close attention to what my various volume knobs are set at before and after I open these programs.
    I appreciate any and all input, thankyou.

    I had to edit to reflect its Mavericks 10.9

  • Help My Main Sound Control Is Gone!

    The main sound control feature at the top of the white bar thingy that can make the computer's main sound go up and down is gone from the white bar at the top of the screen. I don't know what happened to it! How do I get it back? Please help!!!

    Go to system preferences, click on sound and at the bottom of the page you should see a checkbox for "show volume in menu bar" make sure its checked

  • Generating Event with Subvi Control on Main Vi

    We are creating a code in which on pressing set up button( present on main vi front panel ) we are calling one subvi as pop up window which further contains some boolean controls and every boolean control has further one subvi associated with it, when we press on that button a window comes that has several numeric and string control, what we want is after entering all values on numeric and string control and after pressing ok button, these val;ues should get updated to the sequence list present on main vi front panel, i have tried to do this using queue but what we want is that on pressing ok button( present inside subvi) we need to generate a event on main vi that it should dequeue elements to the list only when that ok button is pressed, i have tried to do it using value signalling property node but this is not working, i am not getting how to do this or there if there is any other better way to do this
    I have attached the code for reference.
    Attachments:
    Automation.lvproj ‏9 KB

    A better way to do this would be to enqueue the state that the event case is calling from the instrument state.  Then you don't have to poll the global variable and worry about signaling the event.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    queue up state.PNG ‏9 KB

  • Using Control Reference to change subVI control - sub VI also called using a container

    Hello
    I am in need to update a control inside a sub VI that is also called inside a container in the main VI.
    Please see the project attached.
    My goal is simple -
    Change the "Main VI calling sub VI-Container.vi " panel's "FGV state"
    once the state changes, it needs to be propagated to the sub VI that is called within the container
    The sub VI's (sub VI called is "Check Time FGV.vi")  "FGV state" also needs to change when the main front panel's control
    How do I accomplish this ? just a FYI - the sub VI being called is at "C:\Projects\User Examples\Check Time with FGV\Check Time FGV.vi"
    Also my stop button functionality is broken, not sure why.
    Thanks for your help.
    Attachments:
    Check Time.lvproj ‏6 KB

    OK you have a few problems.  Lets address the Stop button first:
    Add a value change event for the stop button and put the stop button in that case.  Wire the button out of the event structure to the conditional terminal of the while loop.  WHAT IS HAPPENING:  You press "Stop" but the event structure is still waiting for an event so the loop never iterates.  Get rid of the wait.  the CPU will not be hogged unless you are generating events at warp speed.  No user can generate events that fast! so the loop will not be greedy.  The event structure does wait for an event it does not poll for them by running contineously.
    Now your subpanel.  You do know that the FGV runs once when you invoke the run method on it right?  You can change the contol value all you want but the vi won't do anything about it because the vi is not running.  And even if the vi WAS running changing the value of a control that is read once (outside the loop) would not cause the value on the wire inside the loop to change at all.  Does that clear up some of why what you are attempting will not work like that?
    Jeff

  • Create subVI Control from Reference Name Bug

    If you connect N references to a sequence structure and create a subVI from this structure, the first N-1 controls will have the name of the original control (desired), but the last one will not. It will have the name of the generic type of the control this reference is pointing to. Of course, if N = 1, that means that the created control will have the generic name.
    Illustration:
    In the diagram above, subVI 1 has been created from a sequence to which a reference to "Numeric Control" was connected. Here is the FP of that subVI, as created by LV:
    subVI 2 was created from a sequence to which both references were connected. Here is the FP of that subVI:
    This does not seem to depend on the type of the control. If I add a graph:
    the created subVI looks like this:

    Kind of an extension of this bug, but not exactly the same. Might be due to the same cause though
    If you create a subVI incorporating Property Nodes (not recommended in general for performance reasons, but not a killer either), the subVI will obviously have references to the corresponding controls as controls and references to the controls will appear in the calling VI:
    Before:
    After:
    (it never ceases to amaze me how bad the cleanup/auto-routing algorithm developed by NI is :-)
    Here is the corresponding FP of the created subVI:
    This time, never mind the names of the original controls, they will be ignored, no matter how many different controls there is.
    (I am not even mentioning the well-known feature that if instead of enclosing the property nodes you just enclose the wires coming from the "Value" node, the subVI's controls will read "Value, Value2", etc, where the type of the "Value" controls will in general have absolutely nothing in common).

  • Clearing subVI controls when opened

    Hello,
    How can I get my subVI to clear all the controls on the front panel when I call it. I have customized the window appearance (under VI properties) to "show front panel when called" and "close afterwards if originally closed" as was suggested in a previous post but do not see a "reinitialize all values to default" option for runtime execution. THanks.

    jilla wrote:
     i could not figure out how to create an invoke node for the whole vi, tho.
    Open a VI reference wired to "current VIs Path" and hookup an invoke node. Select desired method.
    (See uper part of image)
    Or even simpler....
    Just place an invoke node from the "Application Control Palette"
    First right-click in the header of the node and select "select Class -> VI server -> VI -> VI.
    Now select method "default Values -> "Reinitailize all to defaults"
    (See lower part of image)
    Message Edited by altenbach on 01-26-2007 02:37 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    ReinitDefaults.png ‏5 KB

  • Main parental control and Entourage

    I set up my child's e-mail with parental controls in Mail. As expected, the messages from "unauthorized" senders are forwarded to my e-mail address. But I use Entourage and I can't figure out how to authorize the appropriate messages. Do I have to switch my account to Mail as well?

    Parental control only works with Mail. I wish Apple documented the Parental features better.

  • Button on main timeline control movieclip

    Hello,
    I have a stop on my main timeline. At the stop I have a movieclip play. In the movieclip I will have a video play. After the video plays I have a button for the user to continue play until the end of the movieclip. Once the movieclip is done I want to resume back to a specific frame in my main timeline.
    I can't figure out how to make this work. Anyone have any ideas?
    Thanks in advance,
    Paul

    Ned,
    Thanks for the reply and the help.
    I actually got everything to work the way I need it to. I simply had my button in the movieclip continue play then at the end of the last frame, applied a little voodoo and I was all smiles after I tested my Movie. Here's what I did...
    x_btn in movieclip (not on main timeline) -
         x_btn.addEventListener(MouseEvent.MOUSE_DOWN,mouseDownHandler10);
         function mouseDownHandler10(event:MouseEvent):void {
                  gotoAndPlay(41);
    last frame in movie clip -
         MovieClip(root).gotoAndStop(130);
    Paul

  • Reference to control on main front panel fails when subvi front panel is closed?

    Hi All,
    I'm experiencing an odd bug. In my code, I use a subvi to control a piece of hardware. This subvi has controls for all of the functions of my hardware.
    I'm changing the value of one of these controls from my main front panel by running a reference to a knob on my main front panel into the subvi, grabbing the value of the knob with a property node, and then updating the value of the subvi control using a signaling property node.
    This works fine when my subvi front panel is open but fails to work at all when the subvi front panel is closed.
    I'm new to labview , so any help is appreciated.
    Thanks,
    Arpan
    Solved!
    Go to Solution.

    What is your LabVIEW version?
    Front panels that are not shown are typically not updated and might not even be loaded into memory.
    The presence of certain code elements (e.g. property nodes) often forces the front panel to be in memory even if it is not shown, but I haven't studied it in a long time so there might be subtleties. Maybe somebody from NI can give more details.
    If it does not work unles the FP is open, open the front panel minimized to avoid distraction.
    Can you attach some code? Maybe there are better ways to do all this anyway.
    LabVIEW Champion . Do more with less code and in less time .

  • Subvi containing controls should use already existing window

    Hello,
    I am building a User Interface that has several levels (main vi, several
    second and third level subvis. The second level subvi contains
    controls, so it opens a new window when called,
    but it should clear the already existing window of the main vi, use this
    window and restore the main vi after completion.
    The third level subvis add some more controls to the second level subvis',
    so they should use their window, but without clearing the second level subvis.
    How can this be done?
    Thanks
    Thomas

    I change my main screen controls and indicators all the time using references. I had to, since my one project had almost 100 controls and indicators (on tab controls) for the user to input data. With that many controls and indicators, direct wiring to subVIs would have been such a mess.
    But... back to what you want. Basically, you open a reference to the VI that you want to access controls/indicators on and use Invoke nodes to Set Control Value or Get Control Value. Don't forget to close your reference when you're done with it.
    I have included my library that I use for these functions so you can see how I do it. Have fun.
    Rob
    Attachments:
    Panel_Ref_Lib.zip ‏104 KB

  • How to know if a wire is connected to a control (in the case of subVI)?

    Hello,
    I would know if it is possible to know if a wire (in the caller VI) is connected to the subVI control ,or not.
    - There is any function to test a control to know if it is wired in the caller VI, or not ?
    OR
    - Do I test control defaults values and determine if a wire is connected ?
    I hope my question is understandable =)
    Rob
    Solved!
    Go to Solution.

    Hi
    I am not sure if this is of any help. But if click on a connector in the connector pane. You can specify some options. I often use the "is required" option for important input data. If a connector of this type is not wired. An error and a broken arrow will be the result. The VI will not run before the problem is corrected.
    Message Edited by Coq rouge on 05-04-2009 10:51 AM
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)
    Attachments:
    sample.PNG ‏12 KB

  • Waveform Graph passed as output of subvi does not refresh in the main vi

    I have a subvi that collects data in batches and displays the batch in a waveform graph. Then I make this waveform graph as output and call it in the main subvi to display the graph. The problem is that in the subvi the graph refreshed at each batch and plots the batch (which is how I want it to behave) while in the main vi it does not display anything.

    Your indicator is outside the while loop, so you wont get anything until the while loop finishes!
    Also your subVI is inside a case structure, the output of which is set to 'default if unwired' (which means empty array) so anytime your case structure is true, your values will be wiped. If this is intented, please excuse me.
    Beginner? Try LabVIEW Basics
    Sharing bits of code? Try Snippets or LAVA Code Capture Tool
    Have you tried Quick Drop?, Visit QD Community.

  • Play Control issue - only getting a system beep when adjusting main volu

    Whenever I double-click to get to "Play Control," there is a 'Main Play Control" slider to the left-most side. However, when I adjust this slider, I get a 'beep' from the computer instead of from the speakers.
    I have:
    Windows XPAudigy Gamer
    Any help would be appreciated. Thanks.

    vmo70 wrote:
    Whenever I double-click to get to "Play Control," there is a 'Main Play Control" slider to the left-most side. However, when I adjust this slider, I get a 'beep' from the computer instead of from the speakers.
    I have:
    Windows XPAudigy Gamer
    Any help would be appreciated. Thanks.
    already tried right-clickin'? well, i use mediasource, no "problems" like that

  • I'm new to flash and need help with some controls

    I'm builidng a site that has a portfiolio of work to display.
    When the visitor arrives at the portfolio page he (or she) is
    faced with a split panel. The right panel displays a summary of a
    client and the work. The left panel displays the work examples
    attributed to that client. By clicking forward and backward arrows
    in the right panel, the visitor can call the summaries of the
    different clients. Landing on a client page 'opens' a separate swf,
    called using loader component, that contains the portfolio of that
    client's work into the left panel
    1. I want forward and backward arrows located on the main
    movie in the left panel to control the progress of the loaded swf,
    rather than using forward and backward arrows on the loaded swf.
    2. I want to prevent the forward and backward arrows in both
    panels from clicking beyond frames in the Portfolio area of the
    timeline.
    3. I want the backward arrow to be innactive on the first
    frame, and the forward arrow to be innactive on the last frame.
    I have no problems making the arrows work on the main movie
    controlling the client summaries. What I don't know how to do is
    make them control the movement of the loaded swf, or #2 and #3.
    Any help will be greatefully appreciated. Thanks in advance,
    Art

    "Art Lazaar" <[email protected]> wrote in
    message news:[email protected]...
    > Tralfaz,
    >
    > Thanks for your response. I must be missing something
    very simple here, but I
    > can't make this work no matter what I do. Let me see if
    I understand some of it:
    >
    > On my main movie I put the fwd_btn and rew_butn
    codes...do I put these on the
    > actual buttons, or in an actions time line? When I put
    them on the buttons, I
    > get an error report saying they need to be in an 'on'
    event handler. I thought
    > that's what 'onRelease' was.
    >
    > On my loaded movie, I place the 'one.swf' code. I'm not
    sure what you mean by
    > placing the code inside a loop, I don't seem to be able
    to find a reference to
    > using 'loop' anywhere. When I use an 'onEnterFrame', I
    presume I do that with
    > onEventClip(enterFrame). When I do that, if I run the
    'one.swf' by itself, i
    > get an error report saying onEeventClip is for movies
    only. But there's no
    > error report when it loads from the main movie. What
    happens tho' is it loops
    > continuously, even if there are stops() in it.
    >
    > Boy, am I confused ;)
    >
    > I am really baffled by this seemingly simple little
    task. Your help is
    > gratefully appreciated.
    >
    > Art
    >
    >
    >
    Hi Art,
    There are different coding methods, depending on where you
    put code..
    1) Frame code
    Click on a frame of the timeline to enter frame code
    2) Attached code for movieclips and buttons
    Click once on a movieclip or a button then enter attached
    code
    To make an onEnterFrame event for a movieclip, first chose
    either frame code or attached code method. I personally rarely ever
    use
    attached code because it hides code in places that can be
    hard to find. Almost all my coding is frame code, but it's a
    personal
    choice.
    Frame code method to make an onEnterFrame for the main
    timeline..
    // put this code into a frame on the main timeline
    this.onEnterFrame = function()
    // do something once per frame at the frame rate
    checkMyButtons(); // once per frame we will check on the
    button status
    OR
    Attached Code method to attach an onEnterFrame event to a
    movieclip
    // click once on the movieclip (don't dbl click it .. stay at
    the root timeline level)
    onClipEvent(enterFrame)
    // do something once per frame at the frame rate
    Those two types of code are not interchangeable. One type
    must be entered into a frame and the other style must be attached
    to a
    movieclip or you will get errors.
    Then there is the DOT syntax way to write frame code that is
    equivalent to attaching code..
    myMovieClip.onRelease = function()
    trace("release");
    myMovieClip.onPress = function()
    trace("press");
    myMovieClip.onDragOut = function()
    trace("drag out");
    tralfaz

Maybe you are looking for

  • How can I disable e-mail and text messages when I'm close to or over my data quota ?

    How can I disable e-mail and text messages when I'm close to or over my data quota ? Is this possible? I don't see any options? All I see is this:   Receive confirmations of many account transactions via Email and/or free Text Alerts delivered right

  • Error while creating the backup directory

    I bought a Time Capsule yesterday. As with all of Apple's networking products, it set up like a breeze. Took about 10 minutes. I have two MacBooks running on the network now. I set Time Machine to start working on both of them (one of them has used T

  • How do I change the cmd w (close window) shortcut on OSX Lion?

    Hi, I have a macbook air running on OSX Lion, and I can't find the way to change the shortcut cmd+w... I need those keys for another application without quiting it every now and then, and I can't add or modify any of those controls. Can somebody help

  • Financial Statement Report - Special items in FSE2

    Hi,     I'm trying to rebuild the GL Balance Report using transaction FSE2, but I can't delete or create new "special items" (the red node ones). Anyone knows how to create or delete "special items" at FSE2 to custumize the Financial Statement Report

  • ANNC: Free DW Image Widget

    Loads Images ( even of different sizes ) into a div on your page to create disjointed rollovers, mini galleries etc.. http://www.fourlevel.com/dreamweaver/extensions/loadimage Regards, ..Trent Pastrana www.fourlevel.com