Front Panel Controller SubVI?

Here is the scenario, I have a main VI that uses an event structure to call various other SubVI's depending on what control is pressed and to update the front panel accordingly.  The front panel of the Main VI is a Tab Control with ~25 controls total.  As you can imagine, some controls should not be enabled until other events happen.  For example, I have a menu ring called "Report Type" of which you can choose 'HTML' or 'Send to Printer.'  Next to this ring is a boolean control called "Open in Browser?" , I want to only enable this boolean control only when "Report Type" is set to 'HTML.'   Likewise I want both the "Report Type" and "Open in Browser?" controls to be disabled if the user has not hit the "Download Data" control to get data from the RT Controller (otherwise there would be nothing to report.) 
These are just a few examples of what I need to do, I have been adding 'Disabled' property nodes throughout my event cases but it is becoming very unwieldy and making my block diagram quite cluttered and hard to understand.  What I want to do is have a 'Front Panel Controller SubVI' of sorts, of which I define about 10 or so various states the front panel can be in and pass that state to the controller SubVI which in turn disables/enables controlls accordingly.  This idea sounds good but so far the implementation seems pretty bad.  I was hoping I could just make a cluster of control references and pass that into the SubVI but LabVIEW 8.2 doesn't seem to allow me to wrap up references in a cluster.  This has forced me to use VI Server to get the references.   What I've been able to come up with using VI Server works, but I can't believe its the most elegant solution.  Basically, for each of the possible states, I iterate over all the controls in the front panel and have a case structure for their Label Text which determins if that control should be enabled/disabled for the given state passed in.  Also, for some reason it seems that it is not grabbing references to ALL of my controls.  There is a menu ring control on the front panel that isn't in the Controls[] array.  I should mention that this particular Control already has a reference node created for it that gets passed to a SubVI, perhaps this is why its not found in the Controls[] array, but this doesn't seem to be very intuititve, or documetned for that matter.
<a href="http://tinypic.com" target="_blank"><img src="http://i37.tinypic.com/fjgwtv.gif" border="0" alt="Image and video hosting by TinyPic"></a>

Thats a very good idea, although I'd probably want to put a case structure around the disable property node and have it only change value when the search array function does *not* return -1, otherwise I'll be disabling things I might want to maintain in an enabled state.
Just before I read your post, another thought came to me and that why use a SubVI, I could just use a parallel loop with queues to send back state information.  Since queues can be blocking, this would not negate my event structure.  I could combine the idea you gave me with this architecture.  Thanks

Similar Messages

  • Open and Close Front Panel of SubVI

    Hi all,
    Running LabVIEW 2011 on Windows 7 x64.  I am trying to get a subVI front panel to open from my main FP with the press of a button and then close with a button press in the subVI.  Here is the piece from my main FP that calls the VI and opens the FP 
    Plots is defined in another loop and all of the loops are in a flat sequence.  I did it this way because I want it to start with the first press and not stop my main loop from running.  I have moved the item in the left loop around a lot so I'm not sure if I can run that in the same loop as the event or not.  Either way opening the VI seems to work fine.
    The problem shows up when trying to close the subVI for the SECOND time.  The code is here:
    As I said, the first time I open and close the VI everything works as I expect it should.  I am then able to open it again but now the "blank button" doesn't function and I can't close the window or even open the block diagram to probe anything.  I have been trying to figure this out for awhile, any insite would be greatly appreciated!
    Thanks
    Solved!
    Go to Solution.

    Its good that you found the bug.
    This code may serve as a way for you to compare notes.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Reading main VI front panel in SubVI

    Hi,
    I'm trying to create a subVI that writes a header text file containing info on essential parameters in my measurements. My mainVI front panel has a few dozen controls, some of them contained in a handful of clusters. 
    What I'd want is just to be able to access and read the values at the subVI to construct the string I want to write to the file.
    I wouldn't like to proceed the dumb way, i.e., building an array of clusters or individual controls or references to them and passing that to my subVI (and, obviously not passing each individual control/cluster as a subVI input).
    I figured I'd like to have some kind of refnum of the mainVI frontpanel passed to my subVI and dig use a big pile of property nodes to dig out the info that i need, inside the SubVI. Is this a feasible solution and if so, what's the way to conduct it? If not, what would be a better way?
    As before, I'm using LV7 so in case you answer with block diagram examples, I'd appreciate screenshots of them.
    Thanks,
    Lauri

    Vostokki wrote:
    I'm trying to create a subVI that writes a header text file containing info on essential parameters in my measurements. My mainVI front panel has a few dozen controls, some of them contained in a handful of clusters. 
    What I'd want is just to be able to access and read the values at the subVI to construct the string I want to write to the file.
    I wouldn't like to proceed the dumb way, i.e., building an array of clusters or individual controls or references to them and passing that to my subVI (and, obviously not passing each individual control/cluster as a subVI input).
    Lauri
    Actually that is the preferred way to do. Why you may ask? It is because you decouple the functionality (creating your log file header) from your specific user interface. By doing so you can reuse this VI in other places or applications. By using the references directly this ties the subVI to the calling VI. Unless the subVI is specifically doing something to the UI itself a subVI should avoid accessing data it needs via direct references. It should require the data to be wired in with the appropriate clusters, arrays or whatever your data needs are.
    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

  • Closing front panel of subvi

    I have a main vi that opens many subvi with their front panel (they pop up as a normal windows not like modal). I need to close a subvi by pressing a button on it but I can't find any way.
    Thank you everyone,
    Massimo Ponte.

    You can use vi.lib\UTILITY\VICTL.LLB\Close Panel.vi. Just pass it the name of the VI whose panel you want to close.
    Sylke had a similar problem here.

  • Exporting front panel of subVI to calling VI

    Is there a way to "export" the front panel of a subVI so that it becomes part of the (or a pane of) the calling VI? If so, what is it called? I don't know the right language to search for examples of this concept.
    My problem is as follows:--
    I built a nice, classy interface to a test program that allows the user a great deal of flexibility in controlling the parameters of the device under test and in seeing the impact of those parameters on other parameters. This has about 8-12 control objects, some of which are also wired to act as indicators so that changing one can display on another and vice versa. This interface and its supporting program is big enough that it belongs in its own subVI rather than in the main program. In addition, I built another interface that charts signals from the device under test; this is also big enough that it belongs in its own subVI.
    I would like to have the front panels of both of these VIs be part of the front panel of the main program. That is, the front panel of the main program should "inherit" the front panel of each subVI wholesale. If I need to tweak the interface of one of the subVIs -- for example, to add, delete, or replace controls, indicators, displays, charts, etc. -- I would like to be able to do this without having to wrestle with the main VI and the connector pane between it and the subVI.
    It seems that LabView should be capable of this, but I cannot find any help, guidance, pointers, etc., in the documentation, textbooks, or examples.
    Could someone give me a clue?
    Thanks,
    Hugh Lauer

    So I tried to configure a subpanel, and found it very confusing. It seems that when you put a subpanel control on the front panel, you have to then set up a way to invoke the subVI. Since my subVI has some inputs and outputs on its connector pane, I created a VI reference for it and wired that to the type specifier node of the Open VI Reference node. I then inserted a Call VI by Reference node, so that I could wire up the inputs and outputs of my subVI. Finally, I wired this to the subpanel Invoke Method (Insert VI).
    This is different from the examples I found. In those cases, the subVIs had no inputs or outputs on their connector panes, but rather took all of their information from their front panels.
    I got different behavior on different attempts to run it. The most common (and most recent) behavior is that the subVI front panel opens up a few seconds after the main VI starts, but it is not quite "in" the subpanel. Instead, it is offset about an inch from both the top and left, as if it were a floating window that I cannot move. Also, it has annoying scroll bars on the bottom and right, which I don't want.
    Incidentally, I have two of these subVIs, and I have not yet tried to put the second one into a subpanel.
    What I would really like to do is
    have both subVIs populate their respective subpanels as soon as the main VI starts, but before any work gets done.
    after both subpanels are loaded, run the two subVIs in parallel, one to control the device under test and the other to capture its signals.
    have no scrollbars in the subpanel windows.
    In fact, what would be the best from a GUI point of view is for the two subpanels to be permanently part of the front panel of the main VI.
    Any guidance or insight would be most helpful.
    REgards,
    Hugh

  • Front panel of SubVI locks on 2nd call

    HI!
    I'm calling a SubVI and pass a Boolean Reference to this SubVI. In the SubVI I'm executing a While loop. The stop condition is the value of the boolean control in the VI that calls the SubVI. (Boolean Refnum + Property Node: VALUE connected to while stop condition)
    Mechanical Action of the Boolean in the calling VI is: Switch when pressed.
    For the first time this will be executed it works fine. But the 2nd time the SubVI is called. The Front Panel of the calling VI where the stop button is located will be locked.
    Does anybody have an idea why this happens and how I can solve that problem?
    ANDY

    I tried what you described, using LV 7.1, and I have no problems running the vi over and over again. See the attached examples. Ref1.vi calls Ref2.vi and passes the Boolean reference to it.
    - tbob
    Inventor of the WORM Global
    Attachments:
    Ref.zip ‏21 KB

  • How to display remote front panels of subvis that are already open

    I inherited an RT project that uses remote front panels for nearly all the user interfaces. The host application opens a remote front panel the the top level RT vi, and there are several subvis on the RT system that are opened from that top level vi and thus displayed on the host (i.e. their "Show Front Panel When Called" properties are set TRUE).
    If the Host loses its connection to the RT system when any subvi front panels are opened, and the host application is restarted, it can re-open the top level vi remote front panel, but all the RT subvis that are already open will not display their front panels. I am looking for a way to open the front panels to these subvis from the host application.
    The kicker is, I need to know which subvis are actually running before I attempt to open remote front panels. Is there any way to determine what subvis are actively running (and not just in memory, such as subvis that won't get executed until the top level vi reaches a certain state)? I am thinking that I could create a list of the subvis that I need access to, check to see if any are actively running on the RT system, and then invoke a remote front panel connection with those that are running.
    Does anyone have any ideas as to how I might be able to do so? Or any other suggestions? [and yes, I know that RFP communication is probably not the best way to go, but we're too entrenched in this software to start over with a new system!]

    TurboPhil wrote:
    If the Host loses its connection to the RT system when any subvi front panels are opened, and the host application is restarted, it can re-open the top level vi remote front panel, but all the RT subvis that are already open will not display their front panels. I am looking for a way to open the front panels to these subvis from the host application.
    It might be possible to work around this behavior by placing VI invoke nodes in your top level VI that reference each of your subvis and setting the Wait Until Done invoke method to false.  This should cause the subvi to close when the top level VI closes even in the case of an unexpected restart.
    You can access this invode node in the functions pallet by selecting Application Control » Invoke Node and also selecting Application Control » Static VI reference.    Wire the Static VI Reference to the vi reference input node and double click the Static VI Reference and select the appropriate subvi in the dialog window.  Left click on the Method section of the invoke node and select Run VI. Finally right click on the Wait Until Done invoke method and select Create Constant and ensure this constant is set to false. 
    TurboPhil wrote:
    The kicker is, I need to know which subvis are actually running before I attempt to open remote front panels. Is there any way to determine what subvis are actively running (and not just in memory, such as subvis that won't get executed until the top level vi reaches a certain state)? I am thinking that I could create a list of the subvis that I need access to, check to see if any are actively running on the RT system, and then invoke a remote front panel connection with those that are running.
    You can access this information by using the Real-Time System Manager (Tools » Real-Time Module » System Manager).  This can be used to show what VIs and subvis are loaded into memory and which are running.
    For more information on using this tool please referere to this Knowledge Base article. 
    Message Edited by BLAQmx on 02-18-2008 11:40 AM
    Mark
    LabVIEW R&D

  • Unerwartetes Erscheinen des Front Panel eines SubVI beim Start der Top-Level-Application

    Beim Starten meiner Top-Level-Application erscheint sofort das Front Panel eines Dialog-SubVI, welches eigentlich über die entsprechende Menüauswahl angewählt werden soll. Das passiert nur, wenn sich das SubVI im Speicher befindet. Das unerwünscht erschienene Front Panel zeigt dabei nicht die normale Fuktionalität, lediglich das Schliessen des Fensters ist möglich. Dabei verschwindet das VI jedoch komplett aus dem Speicher (sowohl Front Panel als auch Block Diagram). Danach lässt sich der Menüpunkt anwählen und der Dialog läuft normal.
    Befindet sich das SubVI beim Start der Top-Level-Application nicht im Speicher, läuft alles normal.

    Es könte sein, dass die Eigenschaften für das Sub-VI auf "Öffnen wenn geladen" oder was ähnliches gesetzt ist.
    Schau nach, ob die ganze "Fenstererscheinungsbild" Eigenschaften wie gewöhnt eingestellt sind. Zu beachten ist auch, dass die Sub-VIs individuell im Block Diagram andere Eigenschaften zugeweisen werden können (Rechtsklick auf der Icon im Block diagram)...
    Ich hoffe, dass ich damit ein wenig helfen könnte
    Shane
    Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)

  • Show front panel of subVI on a real-time target

    Hi,
    I'm running an application on a real-time target (14.00). On the main front panel of the application, I have a button who open another VI with the invoke node method but this component doesn't work with Real-Time taget. So, how can I show the front panel without this method ?
    Thank you

    Hint: RT = there should be no GUI.
    RT applications are meant to just run off on their own.  GUI is not part of a real RT system since that adds a non-deterministic process to the system, adding jitter (which is a big no-no in RT).  What you should be doing is making a Windows host application that can communicate with the RT system (via Network Streams, TCP/IP, etc).  The host application acts as the GUI/HMI.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • I have built a VI and then I used it as subvi it works but the front panel of subvi didn't diplay for other options

    Kindly suggest me possible errors
    timmy
    Solved!
    Go to Solution.

    Go to the VI Properties, choose Window Appearance.  The simple route would be to just use the Dialog setting.  But you can play around with the customized settings too.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to run a subVI without poping up normally, but when clicking a button, popup the front panel?

    I know pop-up the front panel of a subVi when called by selecting VI Properties>>Windows apperence.
    But what I need to do is: always run the SubVI inside the parent VI as the nornal subVI do without poping up. But when I click a button"show front panel", the SubVI popup the front panel.
    Is there anyway to do this?
    Thanks,

    ossoo,
             You can use a static VI reference to the subVI and then use the Front Panel Open invoke method to show the front panel when you want. I have attached two VIs that show this. I saved these VIs for LabVIEW 2009 so you should be able to open them up and run them in 2009 or later. Add.VI is the subVI that you are calling. The Caller.VI is just a While Loop that contiually calls the Add subVI. Inside of the While Loop is also a Case Structure with a Static VI Reference (you might need to change the path this is pointing to after downloading the VIs to your computer for this to work) and the Front Panel Open invoke method. You can run the Caller.VI and interact with the main Front Panel as normal and see the subVI but then you can click the Open subVI? boolean button and it will open the subVI's front panel. You can continue to interact with the main front panel and see the values update on the subVI's front panel as well. You can just close the subVI's front panel when you are done viewing it. Does this help?
    Grant H.
    National Instruments
    LabVIEW Product Marketing Manager
    Attachments:
    Caller.vi ‏19 KB
    Add.vi ‏23 KB

  • SubVI does not open (error 3 could not open front panel)

    For the VI I am working in (trail version of Labview 2011), I have created a subVI. At one time I opened this subVI to adjust the connection terminals -which I have done before- and after saving the file and closing it, the subVI remained unadjusted. In fact, I am not able to open the subVI anymore. And when I want to open the file as a VI (e.g. executing the VI in windows), I receive 'load error code 3: could not open front panel.'
    I also cannot preform any tasks such as saving the main program for an older version, because this subVI is present in the program.
    Nevertheless, the VI still works as a subVI in the mainprogram I've written -in the way it worked before I adjusted the connection terminals.
    Is there any way to resolve my problem, without rewriting the whole subVI? The subVI concerning is attached in this post.
    Thank in advance,
    ps. after closing Labview, it sends an internal warning report. 
    Solved!
    Go to Solution.
    Attachments:
    ampweightcenter.vi ‏25 KB

    Hello Stag,
    My name is David and I am an Applications Engineer at National Instruments UK.
    To clarify the problem, when you receive this error are you trying to run the VI as an executable, standalone file in Windows? If this is the case then I think that I know what the problem could be. When using the Application Builder the Front Panels of SubVI's are removed to reduce file size. It is possible to include them so that they may open and the steps to doing so are listed in the attached link:
    http://digital.ni.com/public.nsf/allkb/8F68715444302CAB86256DDD0071C140?OpenDocument
    This link explains why you are receiving this error and how to overcome it.
    I hope that this helps you and do not hesitate to contact me if you require more assistance.
    Regards
    David B
    Applications Engineer
    National Instruments UK

  • How to open remote front panel of vi's within an executable from an executable.

    How do I remotely open front panels of subvi's contained within an executable, where both computers just have LabVIEW Real Time loaded (programs are run as executables)? I want to use the Method: Remote Panel Open Connection to Server to make this work. I have been getting error 1032 "VI Server Access Denied". I do not want to use the web page method (connection is too slow when controlling front panel objects and I can not programmatically exit out (release control of vi) of the web page).
    Ex. 
    PC1: Has executable1 using Remote Panel Open Connection to Server Method etc. code inside. This program will make a call to executable2 (on PC2) to open up different vi front panels (within executable2), so the controls can be changed from PC1. I want to be able to make changes to the vi's running on PC2 from PC1.
    PC2: Has executable2 containing several subvi's.

    Not sure if this is what you are looking for but here is how to launch executables that can interact
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • Conditionally include Front Panel of a Subvi in an EXE

    I want to make two versions of an EXE, one "normal" version and a debug version. I know how to set conditional disable symbols via pre/post build actions (btw. NI: these variables should REALLY be defineable per build specification; even bare command line C compilers are easier to use in that regard than Labview).
    The "normal" version won't show anything but the main vi. The front panels shouldn't even be included in the exe. For the debug version I want to show the front panels on request (I've queues for sending that to the subvis). Simply calling "FP.open" does not work with an compiled exe, because I get a "resource not found" error (the front panel of the subvi is not compiled into the exe). I tried setting show "frontpanel when called" which forces the FP to be compiled into the exe, but then the FP will shortly flash on the screen, even when the first command of the subvi is hiding the frontpanel.
    How can I make a subvi depending on a conditional disable symbol include its front panel into the exe without forcing it to show its frontpanel at the same time?

    There are a number of things which cause LV to keep a FP when building. These include things like open when called (which you understandably don't like), but also various things which statically require the front panel. Things like changing the scrollbar settings or creating a property node for a control on the FP. Personally, my preference is for the latter because you can document it better.
    If you don't actually mind whether the FP is included, you can just do that and be done with it. If you really do mind, you can check whether placing the property node for the control in a conditional disable structure has an impact on this or not. I have no idea whether it does or not, since I don't know exactly how LV will treat the code in the disabled case.
    The other alternative is making two builds and configuring it for each VI:
    The disadvantage here is that you have to manage two builds and do this manually for each VI.
    If you want, there's a related idea on the idea exchange, but it won't actually help in your case, because it's not conditional:
    http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Add-a-property-to-guarantee-that-the-front-panel-of-a-...
    Try to take over the world!

  • It is possible to open the front panel of a subVI more then one time at the same moment?

    I want to open a subvi´s front panel several times with each one operating independently. The subvi has a ring with several variables to choose to show in a graphic. The subvi is called from a button on the Main Front Panel. It is possible to, for instance, open the subvi and set it to show a temperature graphic and click again on the button to call another instance of the same subvi and select pressure for the graphic, keeping both new windows side by side? Will I still be able to access the Main Front Panel?

    Yes you can. You have to use a .vit (VI template file). There's an example here. There's also been lot's of discussion on the subject. I think if you do a search for vit, you'll be able to find additional information and examples.

Maybe you are looking for