'OK' Boolean within Subpanel subVI (vs. in main code)?

This is my first real need for subpanelling.
I have what I thought was going to be a simple piece of subVI code to implement in a subpanel.  (and maybe I do).
The subVI just consists of a radio button dialog (see attached) with
the idea that I want to get the choice from the user and feed it to the
main program AFTER the user presses 'OK' (the 'OK' boolean is within
the subVI).
The way I tried to address this was to use an invoke node 'Get Control Value' from the control with control name 'Method?'.
The only thing is that the invoke node executes without waiting for the
'OK' boolean to be pressed which under normal run circumstances is
requeired prior to the while loop of the subVI being exited.
The subpanel examples I saw have booleans such as 'STOP' buttons in the
main code and not in the subVI.  Is this the way I will have to do
this or is there a way to do what I want (and it is obvious but just
have not figured it out).
Thanks,
Don
Attachments:
Method_sonix.vi ‏17 KB

This is what your main code should look like.  The key is to wire a True to the Wait until done in the 1st Invoke Node.
Message Edited by tbob on 08-22-2005 02:22 PM
- tbob
Inventor of the WORM Global
Attachments:
SubPanel.PNG ‏24 KB

Similar Messages

  • Stream data from a subvi to the main vi - path refnum

    hello everyone
    sorry my english
    http://forums.ni.com/t5/LabVIEW/stream-data-from-a-subvi-to-the-main-vi/m-p/2205150/highlight/true#M...
    - refnum boolean worked
    - refnum graph worked
    - refnum numeric worked
    how to create a  path refnum? stream data from a subvi to the main vi
    where do I start?
    thank
    Solved!
    Go to Solution.

    Bom Dia Saille,
    Eu acredito que o que você tenha hoje seja isso aqui (Desenho bem simplificado):
    Hoje o que você tem é o Aplicativo do Medidor + USB Driver controlando o seu medidor. Basicamente, sua aplciação está dividida em três camadas:
    Aplicação - Onde estão as funcionalidades principais do programa (interface com o usuário, apresentação de dados, geração de arquivos, etc.)
    VISA - Uma arquitetura de Software para controle de instrumentos. Basicamente, ele se comunica com o Driver USB para poder enviar e receber pacotes de dados através do barramento USB.
    Device Driver - Intruções de SW de baixo nível para controlar um periférico através de um barramento.
    No desenho, eu aponto duas camadas onde você pode tentar atuar para automatizar suas medições:
    Aplicação - Você pode usar o VI Server para controlar o Aplicativo do Medidor (Se este aplicativo tiver sido desenvolvido em LabVIEW, o que eu suponho ser verdade). No entanto é necessário saber se o desenvolvedor do produto permitiu isso (Veja Using VI Server to Pass Data Between a VI and a LabVIEW Executable). Outra alternativa é conversar com o fabricante para ver se ele desenvolveu alguma API (Application Programming Interface) para que você consiga controlar o instrumento diretamente.
    VISA - O LabVIEW Fornece uma API chamada NI-VISA para poder enviar e receber informações através de diversos barramentos (Veja Serial Instrument Control Tutorial)
    É possível acessar o Driver diretamente também, mas eu não recomendo. O resultado não compensa o esfroço!
    Espero ter esclarecido suas dúvidas e espero que você tenha sucesso na sua aplicação!!
    Atenciosamente.
    Felipe Flores
    Engenharia de Aplicações
    National Instruments Brasil

  • Open differents subvis on own main vi.... is it possible?

    Hi Guys,
    I have a litle dude.
    I have a very good application and works well,  i have main vi, it takes differents bottoms to open subvis with differents options or applications, but the problem is when i do the executable file, on xp open 2 files on the tab. One of them is named like exe file, and the another is the name of main file vi. And when i open any subvi, i can see the 2 windows openned.
    I am asking myself if is it possible open the differents subvis on the main vi. Therefore, will open the differents subvis and when close the subvi, will come back to the main vi with the bottoms...
    Only improving... I hope to see any example to do it...
    Regards and thanks for the advises, Fonsi.

    I'm not sure I understand your question perfectly, but if you want to open a window so that you can't access other LV windows at the same time, go to File>>VI Properties>>Window Appearance>>Custom and make it modal. That way, it will stay on top until you close it.
    Another option of having all of them in the same window is calling all the VIs dynamically in a subpanel, but that will probably be more complicated than you like. You can search the LV user manual or help for "subpanel" to find out more.
    To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses.
    In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).
    Try to take over the world!

  • 3d graph in subpanelled subvi changes position

    Having some problems with 'newer' LabVIEW technology.  I have a subpaneled subVI in a tab control page. The subVI uses picture control and 3d surface graph for displaying regions of interest of images selected by drawing a rectangle over the image with the mouse. The first time the page is visited, everything works fine.  When the page is switched, I have code to stop the subVI.  When the page is switched back to the ROI tab page, the 3d surface graph within the subpaneled subVI has now moved its position.  Has anyone seen this before and why might it happen? All other controls stay in the same position.  It is tough to produce a code subset for this but attached shows picture of what is happening.
    I am set to explore the 3d picture control toolkit as a result of my problems here.
    Sincerely,
    Don
    Attachments:
    3d_graph_moves_in_subpanel_subvi_in_tab.png ‏113 KB

    Don,
    So the image that used to be in the subpanel on a page on the tab control moves when you change tabs and change back?  Is that correct?  I haven't heard of anything like that before.  I wrote a small set of test code, but I wasn't able to get that behavior.  Have you tried to unload the VI before switching the VI?  To do this, copy the Insert VI node and then change the operation to Remove VI.  Does this help? 
    Repost if you want more info!
    Andy F.
    National Instruments

  • Show graph that is created in a subVI in the main vi

    Hi Everyone
    I can not, show graph that is created in a subVI in the main vi.
    help!
    Thank you
    Solved!
    Go to Solution.
    Attachments:
    Sub VI.jpg ‏58 KB

    Thank you very much
    Where am I going wrong?
    Is this possible?
    http://forums.ni.com/t5/LabVIEW/show-graph-that-is-created-in-a-subvi/td-p/672249 - solution
    Thank you again, and sorry my english
    Attachments:
    Sub VI.jpg ‏237 KB
    Main VI.jpg ‏177 KB

  • How to pass events from subpanel(s) to the main VI ?

    hi all,
    I found a lot of solutions to pass the events from the main VI to the subpanel(s) but none about passing the events from subpanel(s) to the main VI. In the attached VIs, I just want to generate an event in the main_VI.vi when I click on the button positionned in the subPanel1.vi. How can I do that ?
    thanks.
    Cedric
    Attachments:
    main_VI.vi ‏13 KB
    subPanel1.vi ‏6 KB

    Cedric,
    You could use a queue to transfer the button data to your main vi.
    See the attached files:
    subPanel1mod - Detects a button change and Enqueues the state.
    main_VI mod - uses the Timeout event to poll for data in the queue.
    main_VI mod1 - gets the queue data without having to poll.
    Like your orginals, these files are in LV2010.
    steve
    Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
    question. Give "Kudos" to replies that help.
    Attachments:
    subPanel1mod.vi ‏10 KB
    main_VI mod.vi ‏16 KB
    main_VI mod1.vi ‏15 KB

  • In dreamweaver cs6 12.0, build 5842, there is no syntax coloring on main code view?

    In my dreamweaver CS6, why is there no syntax coloring showing on the main code view window on php or any files? It works in window>code inspector, but this does not have all the same functionality. ther is no preferences icon anywhere that I can see to turn this feature on or off? This used to work until just recently. Nothing on google, but the main basics. I tried checking preferences under syntax coloring and all is okay and shows color. I also reinstalled and restarted PC. I am on a macbook with retina display. on mountain lion with latest updates. CS6 is different than cs5 in menus. Please help soon!

    Thanks for the help. I didn't think the retina did, I just wanted to help clarify what I was working with. I tried changing the external editor also and that got the split design view working again, but still no code coloring gosh darnit.

  • SubVI's in Main VI

    I am new to this group and relatively new to labview, so forgive me if this
    is a repeat post.
    My question is sort of similar to the "duplication of controls" post
    5/9/200. I have two kinds of subVI's that I want to use in a third main VI.
    The two subVI's are for analog input and output and have associated
    indicators and controls respectively. I want to use these in a third main
    VI. My problem is this. I want the controls and indicators that I have
    fashioned for the subVI's to appear in the main VI front panel and as of yet
    I have not been able to get this to happen. Futher, the only way that I can
    get the VI to work is to wire a "duplicate" control on the main VI diagram
    (but this does not take the form that I have fashioned for it in
    the subVI.
    Also, I was using the AO or AI single point aquistion VI with a while loop
    and global logical variable to start/stop all subVI's in the main VI. It is
    hoped that we can do this to avoid using a while loop in the main VI to
    start stop the main vi and the associated subVI's. Is this the most logical
    way to go about his or should I use continuous AO and AI blocks in the
    subVI's.
    I hope that this has not been too confusing. Thanks in advance for any help.
    Jeffrey Nesiba
    NESAC/Bio Assistant
    Chemical Engineering
    Work (206) 543-8073
    Home (206) 324-2472 (206) 320-0401
    [email protected]

    Thanks for all the help. As far as the second part of the question goes:
    "Also, I was using the AO or AI single point aquistion VI with a while loop
    and global logical variable to start/stop all subVI's in the main VI. It is
    hoped that we can do this to avoid using a while loop in the main VI to
    start stop the main vi and the associated subVI's. Is this the most logical
    way to go about his or should I use continuous AO and AI blocks in the
    subVI's."
    I was still wondering if the route I have taken (AO or AI single point
    aquistion VI within a while loop
    and global logical variable to start/stop all subVI's in the main VI) is the
    most logical. Or should I use a continuos AO/AI blocks. The end use is for a
    simple process control mockup for a chemical engineering process control
    class, so computing cycles are not a big issue if that may be concern.
    Finally, I have in the past I have done what Kevin Kent suggested. The
    problem with this is that the controls and indicators that I have fashioned
    for the subVIs don't show up on the front panel on the main VI, rather it is
    the control and indicators that I have just created by following KBK's
    procedure. I/my professor would rather the student be able to use these
    subVIs on a blank diagram and be able to connect them and use them without
    having to delve to deep in to Labview (as they will have little or no prior
    experience using labview). Having the VI/subVI use a preararnged
    control/indicator would allow them to get started a little quicker with
    process control rather than tackle labviews learning curve. Is there a way
    of doing this that I have not discovered? Thanks again for suggestions and
    help.
    Jeff
    Kevin B. Kent wrote in message
    news:[email protected]...
    > "Jeffrey L. Nesiba" wrote:
    >
    > > I am new to this group and relatively new to labview, so forgive me if
    this
    > > is a repeat post.
    > >
    > > My question is sort of similar to the "duplication of controls" post
    > > 5/9/200. I have two kinds of subVI's that I want to use in a third main
    VI.
    > > The two subVI's are for analog input and output and have associated
    > > indicators and controls respectively. I want to use these in a third
    main
    > > VI. My problem is this. I want the controls and indicators that I have
    > > fashioned for the subVI's to appear in the main VI front panel and as of
    yet
    > > I have not been able to get this to happen. Futher, the only way that I
    can
    > > get the VI to work is to wire a "duplicate" control on the main VI
    diagram
    > > (but this does not take the form that I have fashioned for it in the
    subVI.
    >
    > Create your 2 SubVIs (as you already have) , make sure you wire the
    > controls and indicators to the terminals (right click on the icon of the
    > front panel, select show connector, use the wire tool, click on the
    > control / indictor, click on the terminal to use). Open a new vi
    > drop the 2 subvis on the diagram. Right click on the terminals of the
    > subvi and select Create control (or indicator) . This will create a
    duplicate
    > of the control / indicator on the front panel of the main VI .
    >
    > You will have to move them around to suit your needs.
    > Kevin Kent
    >

  • Multiple subvi's in main front panel

    Hello and welcome (it is my first post here),
    sorry if such subject was already risen, however I don't know how to specify it exactly in terms of LV nomenclature (I'm a beginner in LV) what makes it quite difficult to search the forum.
    I need to create an interface with user specified number of input channels (specified during application work, so dynamic loading is necessary). Each channel is to be controlled by subVI. I'd like to load panels of all running input subVI's into some container in a main front panel (similarly to subpanel, but loading multiple VI, not single one). Is there a container capable of this? Is it at all possible in LV?
    Regards,
    kaolpr
    Solved!
    Go to Solution.

    You can use multiple subpanels. Unfortunately the number of subpanels must be set during development. You could create a method of cycling through your various channels. This would involve loading and unloading the multiple subpanels that you do include in the UI.
    Another alternative would be to use a table or something similar. Have your subVIs post updates to the UI code via queues, notifiers or user events. Tables are much easier to manage when your number of elements varies. If you need to have the UI pass information to the subVIs it can also use queues, notifiers or user events.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Changing a boolean inside a movieclip via the main stage.

    I have a movieclip and within it is a bit of actionscript and a couple of different movieclips to make it function like the button on a ball point pen (you click it and it stays clicked until you click it again).
    var booleanClick:Boolean = false;
    var colorTransform:ColorTransform = optBox.transform.colorTransform;
    optHitState.addEventListener(MouseEvent.CLICK, onClickHandler);
    function onClickHandler(myEvent:MouseEvent){
         if (booleanClick == false ) {
              colorTransform.color = 0xB5CDE6;
              optBox.transform.colorTransform = colorTransform;
              booleanClick = true;
         } else {
              colorTransform.color = 0xFFFFFF;
              optBox.transform.colorTransform = colorTransform;
              booleanClick = false;
    I have thirty-some-odd of these ball point pen movieclips on my main stage.
    I want to be able to "clear" all the movieclips so that the optbox color is white and the booleanClick is false with a button that is on my main stage. Currently I've got it working for the optbox color, but when i try to trace out my boolean - it gives me nothing (not even an error).
    var cClear:ColorTransform;
    var optionArray = new Array ( mc1, mc2, mc3, mc4, mc5, mc6 ); // all my ball point pen movieclips are in this array.
    clearButtons.addEventListener(MouseEvent.CLICK, goClear);
    function goClear(e:MouseEvent):void {
         for (var i:int = 0; i < optionArray.length; i++) {
              cClear = optionArray[i].optBox.transform.colorTransform;
              cClear.color = 0xFFFFFF;
              optionArray[i].optBox.transform.colorTransform = cClear;
              trace(optionArray[i].booleanClick + i);
              optionArray[i].booleanClick = false;
              trace(optionArray[i].booleanClick + i);
    I don't want to get deeper into this monster of a project without making sure this is working first. Is my boolean working and just my trace statements aren't worded right or is my method to change the boolean wrong?

    I'm not sure what you are trying to trace (boolean + number?), but try changing it to...
    trace(optionArray[i].booleanClick, i);
    and see if that's more like what you are expecting

  • Multiple SubVI display onto main VI

    Hi everyone,
    Probably a really simple solution to this problem:
    I have 6 SubVI's that I want to use on one main VI, no problem, but I would like to display all 6 SubVI front panel display onto this one main VI. Hope this makes sense!
    I looked at SubPanels and tried to add more VI's to it but it only displayed a single one.
    Any help would be great
    Thanks

    Hi Intel;
    My application had similar GUI requirements, but unfortunately, there is only so much GUI space!  Here are a couple of options that you can use:
    (1) Break up the GUI using splitter bars (if you are using LabVIEW 8.0 or later) and place several subpanels, or forget the splitter bar and simply place several subpanels on the same GUI; or...
    (2) Use a TAB structure, and place a different subpanel in each tab (i.e. if you have 6 subpanels, then use 6 tabs each containing a subpanel); or...
    (3) You can use a single subpanel, and depending on which sub-vi is required to be active, you can write some code to "unload" the existing sub-VI and then "load" the new one.  This is the only way (I am aware of) to have a single subpanel reference multiple VIs.
    Hope this gives you some ideas.  I make use of all three methods in a single program, for example.
    DJH

  • 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

  • Subvi Loading when Main application is opened

    Hello, I have a main application which I would like to sometimes launch a subvi which adds some additional calculations. My problem is that when I load the main application, the subvi loads aswell. I can close it and then it works fine to open and close etc. I have unchecked all the subvinode setup attributes as well as the vi proporties but this does not seem to change things. I have attached a pic of the vi hierarchy and the subroutine shows a red highlighted thread from the main application, not sure what this means. Any help would be appreciated!!
    Attachments:
    Hierarchy.jpg ‏270 KB

    Hi, I have attached a back panel view of the Vi and it's properties, the subvi which I am trying to load is in the case structure. These are the current settings I am using and now it seems to not open the subi when it loads but now another problem. If I use the boolean control to open the vi it trys to open but sits underneath the main vi and does not respond to any actions. Everything works great until I build the application then it goes wonky!!
    Attachments:
    Vi and Properties.jpg ‏449 KB

  • Dataflow problem, queuing in subvi dequeuing in main vi

    ive stuck on a very simple data flow problem here, I'd like to pass data being enqueue in the subvi and dequeue in the main vi consumer loop. Ive attached the vi, since im already stuck on this problem, i was hoping i could learn a few things, specially implementing action engine in this situation  
    thanks.
    Solved!
    Go to Solution.
    Attachments:
    Counter Main.vi ‏16 KB
    counter subvi.vi ‏11 KB

    Your subVI doesn't make any sense since your loop will always exit after the first iteration and you always initialize your counter to 0 every time you execute it. That is one issue.
    Your code also suffers from multiple places that are dequeueing data from the queue. You will get undeterministic behavior since you don't know which dequeue will get the data first. Generally for a producer/consumer architecture using queues one or more loops loops should be enqueueing data to the queue. One and only one loop should be dequeueing data. These loops shuold run in parallel to each other. In your code you will only run your subVI whenever you press the start button and as stated you will always post a value of 1 to the queue. What you would need to do is have your subVI run independently once it is started. Use the "Start Asychronous CAll" to start your subVI when the Start button is presed and then let it simply run. Have it post the counter to the queue. Your lower loop in the main VI should dequeue the values and display them. You do not need the Wait in that lower loop since that is the purpose of the dequeue. That loop will be idle if there is no data present and will only run when data is in the queue.
    In the upper loop of your main VI remove the dequeue and enqueue. You don't need them since the subVI is all that is needed to post the data to the queue.
    Try this:
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • How to handle event from subVI in the main VI?

    Hello,
    I'm doing some measurement. During the measurement I want the user to see some activity dialog - that's easy to do. Before the measurement starts I dynamically run VI (EX_Progress.vi) that shows some activity and then I do the measurement (in my example simulated by random number generation) . After the measurement is done (or error occurs) I can dynamically abort the activity indicator. But on the other hand I want to give to the user chance to abort the measurement manually via the activity dialog by STOP button. There are some ways how to do it via global variable and check every iteration in the main VI it's state but isn't there some better way? Would be nice to run event in the main VI when the user pushes the STOP button in the Progress VI. Is it possible to achieve this using register events? I tried but don't really now how I'm not familiar with this technique.
    Thanks in advance
    Message Edited by ceties on 11-26-2007 01:34 PM
    LV 2011, Win7
    Attachments:
    Ex.zip ‏374 KB

    OK, here's an example using User Events. It doesn't directly have the main VI listen for the Button press event in the subVI. Instead, it has the main VI listen for a custom User Event that the subVI fires every time there's a button press. You could theoretically directly listen to the button press directly from the Main VI, but you would have to somehow get that control's reference to the main VI. That would require storing a copy of it in a global or some such method. This method I will show here is very common and is definitely worth learning.
    For more info on User Events, refer to the LabVIEW help. You can learn more by clicking any of the User Event VIs and selecting Help from the shortcut menu.
    (I didn't set the subVIs front panel to open automatically, so you'll have to do that yourself to see anything from this demo...)
    Message Edited by Jarrod S. on 11-26-2007 02:51 PM
    Jarrod S.
    National Instruments
    Attachments:
    Example.zip ‏25 KB

Maybe you are looking for

  • Muse not working

    I just paid you for Adobe Cloud...why is Muse not working?

  • When downloanding in safari it keeps quiting unexpectedly.

    when I am downloading....like trying to download another program....my safari quits unexpectadely. I have also had this problem when I was trying to login to another website. I can't even download another web browser so that I can visit my employers

  • How to get the field's type in the database with jdbc?

    How to get the one filed's type(varchar,int,long...etc) with jdbc?? Can u help me?? It's best that giving a sample code..

  • Agent Assignents in Workflow Customizing

    Hi All, I have a doubt regarding agents assignments in workitems. In our scenario, When ever a engineering change order is created, it triggers a workflow item to 3 users inbox automatically (in SBWP) for the approval. Can anyone tell me where exactl

  • Color bars in capture window?

    I'm currently trying to log and capture from a Cannon miniDV ZR700 via fire wire400. Although I can control the camera, all I see in the capture window is color bars? Am I missing something. I've done this before, I've also seen this before but for t