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

Similar Messages

  • 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

  • I try to open two sub vi front panel in third - main vi front panel.

    I have two sub vi, and I`d like to see this two vi front panel in main vi front panel window. Does anybody can answer me , If it`s possible?

    Click here for a recent related discussion.
    Or have you thought about using a tab control? You can organize controls in pages and have those controls call sub-VIs with or without displaying the front panel of the sub-VI. See the Tab Control Properties.vi example that ships with LabVIEW.
    From any LabVIEW window, select Help from the window menubar, then Find Examples >> Search, then enter "tab control" (without the quotes) in the box labeled Type a keyword to find:

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

  • 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

  • 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

  • Disable main vi front panel

    Hi,
    I have a main vi and a subvi which is opened from the main vi. Main vi is maximized (takes all screen) and subvi is small one. My desired behavior is: the main vi opens the subvi, main vi must be visible in the background, but it must not collect any event (e.g.. If button on the main vi is clicked when the sub vi is opened).
    I know that can be achieved with setting the subvi to modal, however I do not want to do that (because subvi opens also some other windows, ...).
    Is there any other way to prevent the main vi to collect events while the subvi is opened (e.g. To disable whole front panel at once)?
    Thanks!

    Hi,
    As an alternative to a modal dialog, you can use the VI Server "version" of the modal functionality, by using the FP.IsFrontmost VI property.
    How Do I Configure My LabVIEW Application Window to Always Be on Top?
    Alternatively, you can programmatically "take" focus from your subVI once, when it launces by using the Application / Bring To Front invoke method.
    You can also programmatically give the Focus to the subVI from the main VI, that is a bit more compicated as you need a VI reference to your SubVI (See Calling a VI by Reference). Then you can for example use FP.IsFrontmost again.
    Best Regards,
    T Simon
    National Instruments
    Applications Engineer
    Certified LabVIEW Developer - Certified TestStand Architect

  • 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

  • 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

  • Builded executable doesn't close the main VI front panel

    I created an application with the Application Builder. All of it runs well, except that when the operator ends the program, the front panel of the main vi (the only top-level VI) remains open.
    Moreover, inside the VI window appears the toolbar with only the Run button on (in the VI properties I choosed to hide toolbar and menu bar).
    Is there a way to close the front panel when the program completes execution?
    Roberto
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

    I ussually use the "Quit LabVIEW" function found in the application control palette when application finishes. I use a utility that checks to see if it is running in the development or run time enviroment and only quits LabVIEW if it's in the run time enviroment.
    This wouldn't work to well if you were running other LabVIEW programs though.
    Brian

  • 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

  • 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 can I display a changing variable in a subvi on the front panel of the main vi as the subvi is excuting

    In the document attached the vi on the right is sub to the vi on the left. On the subvi on the right the variable "Field Reading" is continuously updated on the front panel of the subvi as the "for" loop is executed, but only the last value of the variable is updated on the main vi front panel which is what is expected. My question is how can I display the changing value of "Field Reading" on the main vi front panel as the "for" loop in the subvi is running?
    Thank you.
    Solved!
    Go to Solution.
    Attachments:
    Doc2.docx ‏554 KB

    Hopefully I can explain it well enough. It really is simple.
    1) Create an empty global variable and call it something like User Interface References.vi
    2) For each and every control and indicator on your front panel, right-click and select Create/Reference
    3) Place these references wherever you like (I use a series of Event cases to perform my initialisation and these all live in one of these event cases). They can be placed anywhere in the main vi.
    4) For each of the references, right-click and select Create/Indicator
    5) Moving to the front panel, Cut all the indicators and Paste them in the global variable (eg. User Interface References.vi)
    6) Moving back to the block diagram, wire the global variable to each of the references and select the same named global variable.
    All the hard work is now done (until you add another user interface terminal). You should now have something that look as shown below, [except the reference labels would be to the left (not sure why the snippet put them above)]. In my latest program I have 82 references!
    Done. You can now access all your front panel controls and indicators anywhere in your program as shown below.
    You can just select Value in most cases, but in this particular case I wanted to fire off an Event to do some things (log the alarm) as well as just update the value. So, this is another bonus with the method.
    Hopefully this all makes sense. If not, let me know.

  • 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

Maybe you are looking for

  • How do I find and play a audiobook sample on my iPad

    HElp I cannot find or play a sample I downloaded of an audiobook.

  • Can a search engine read the contents of a Library file embedded in a page?

    Can a search engine read the contents of a Library file embedded in a page? Or would SSI be the way to go. I'm creating a large library of text-based information and links, and I want to have much of it modular so I can add a link and all the many pa

  • CVS Diff functionality in Java

    Hi, I've got a requirement for an application to implement a functionality same as "CVS diff " functionality . Is there any way to implement it in Java. If its possible then please let me know. Thnx Sidd

  • Calender to be called in Forms

    Hi , I am new to this forum and new to Oracle forms i have many doubts to be cleared My very first Query is to know what are the steps to be done to invoke the calender to a form my Second one as follows when i select a date from the calender it shou

  • Incorrect results with To-Date Measures

    Hi , I have a report like year Quantity , Quantity -YTD . Though dates are from 1980 to 2030 , i have filtered the dates succh that i have imported the dates greater than or equal to 2008 . So now year should start from 2008 to 2030 . If the report h