Accesing controls (references) from several VI's

Ok I have this small problem:
I have a large program
and have put serveral "advanced settings" in a different VI.
Result
is that the values entered here need to be passed to controls in
different other VI's
The way I use this now is using 1 element
queues to pass the control
value. 
For one VI I can create control
references, call a sub vi and put here the control that can manipulate
the value.
How do I achieve this for multiple VI's? Is
there a way to make control values from ANY running VI available? Maybe
using xcontrols? I have no idea how to achieve this though.
thanks!

Ben wrote:
I will typically use a GUI controller in my apps to accomplish that type of thing.
GUI Controller
I develop an Action Engine  that will cache a cluster of control references when an Init method is invoked. This put all references in a SR that can be accessed from any place the Ae is used.
I add methods to the AE to take care of screen settings associated with changes of state ("Set Visability Edit Mode", "Set Visablilty Login", etc).
I also add a method to return the cluster of refs so I can use them to set-up dynamic event registration in sub-VI etc.
A side benfit of using a GUI Controller is that you have a single point where you can add a "stack" of screen views so functions like "Back" and "Forward" can be added easily. 
So...
trying using a GUI Controller.
Ben
This an excellent method for achieving what you want. A variation of it would be to use LVOOP instead of the AE. The two approachs are essentially the same but with some thought on the definition of the classes I imagine you can create a general purpose base class to handle most of the common aspects. Customizations can be achieved using derived classes.
Further adding to Jeff's comments about the up front hit in the schedule. When done right you will see the benefits of shorter schedules for future projects. The first time is the hardest sell to management. However once you get a couple of successes under your belt future requests will be much easier since you now have a track record of benefits achieved by using reusable code libraries.
Message Edited by Mark Yedinak on 03-30-2010 08:55 AM
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

  • Get Control Reference From Connector Pane

    I am trying to get a reference to a control associated with a specific index on the connector pane. I see that there is a method to assign a control to a terminal but not get control from a specific terminal. I know I can list all controls on the connector pane, but this doesn't tell me specifically where they are.
    Edit: I see there are private methods for getting and setting properties which may have this info, but because these are undocumented and they are properties of a VI which is binary, I can't reverse engineer.
    CLA, LabVIEW Versions 2010-2013
    Solved!
    Go to Solution.

    GregFreeman wrote:
    The disconnect I had was that the array of controls that the connector pane property node will return has null refnums for unwired terminals, but there are still references for every terminal on the pane.
    For learning about the terminals on an object, a good tactic is to drop the object on a diagram and select Visible Items > Terminals:
    If you see completely enclosed terminal rects (like in the subVI terminals), then reading the "Terminals[]" property of the object will return all of them, even the null data type ones. So for the subVI, you can see that there are 12 distinct terminal rects, so that's how many terminals the object has. But on the built-in function, there are only 6 enclosed terminal rects. So reading the "Terminals[]" property on the subVI will return 12 items, and reading it on the function will return 6.
    Jacobson wrote:
    Good find on the example VI...
    I wrote it (along with about 400 other VIs in the examples folder), so it was pretty easy to find.
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • Help!: Control reference seamingly "lost" in run-time execution mode

    Hi!
    The Facts:
    LabView 6.1 PC under NT.
    I've been using "Vi loader" technique since a few month s to distribute a LabView application on severals PCs without having to re-compile it each time. My application uses more than 500 VIs so I can't build it directly. The directories/Vis of the application are simply copied on the target PC and run through the Vi loader technique instead of using the development environnement.
    The problem:
    Since the last release of the my application, differences between the application running in development mode or run-time mode have appeared:
    One VI reading a .ini file does not act the same way if runned in the developpment environnment or
    runned in the run-time environnment. This VI uses control-references from its front-panel and passes them to sub vis. In run-time execution those references seems to be perverted: the sub-vis get them but can't access their properties like Label Name, Values,...
    All works perfectly fine if the VI is runned in the environnment developpment.
    Moreover the same sub-vis called with other control references in other VIs work fine.
    Question:
    Has anyone seen any behavioral difference between run-time execution and development environnement execution?
    Are there any differences in the linkage process between those 2 execution ways?
    Is there any labview Feature that would automaticaly "de-allocate" references at run time and would do so "too early"?
    Is there any know problem with poly-morphique VIS in run-time execution mode.
    That's all, any idea, lead, wellcome!

    Hi Andrew!
    I've allready had a look at the "Problem with VI Loader technique". It only deals with top vis not working (ie broken) when called from loader in Run-Time mode because of ill declared vi.lib path.
    It's "unfortunately" not my problem: My VI is not broken, it's kind'a working, but not as it does in development environment execution mode.
    If NI people are reading this, I would like to send them the VI and it sub-VIs to understand if something has been perverted .
    The problem is seen on all three target PCs.
    Moreover, a new one has appeared: in run-time mode, the standard "file dialog" vi called to prompt the user for a file with a given extension pattern sends back the file name with the extension "double dotted" (exemple: anything..data
    instead of anything.data).
    About the first problem, does any know why a Ctrl Refnum would loose its parent information (name, value...) in run-time execution mode?
    Bye!

  • Main VI stops when using control references.

    Hi, This is my first question on this forum. I've created an engine simulation VI which uses control references. The main VI has a data acquistion loop and control references. The control references link to another VI that runs an equation loop which continuously calculates engine speed base on data collected in the main VI. The control references work but the main VI data is collected and updated only once when the main VI starts. If I remove the control references from the main VI the daq loop runs fine. Thanks in advance for your help.
    Mike

    Joe,
    Thanks for the response. I do not load the subvi dynamically. I have attached a similar vi to show what I'm trying to accomplish. The DAQ vi reads the input and calculates the power. The power is sent to the "engine momentum sub" vi where the speed, as a function of time, is generated and sent back to the DAQ vi. I created the sub vi to clean up and isolate the DAQ vi from the subvi. I wanted the sub vi to run at a certain speed (by adjusting the wait time)and not affect the DAQ vi. If you input a value of 10 into the DAQ vi and then start it you will see the speed ramp up to 100. While the DAQ vi is running, I need to be able to change the input which would cause the power to change and in turn change the speed. I thought the control r
    eferences were the way to go. In my real DAQ vi, I have many more inputs, all which do not update after the first reading. I considered putting the DAQ functions in another subvi and reading the outputs through control references but that seemed too cumbersome.
    Thanks again,
    Mike
    Attachments:
    DAQ.vi ‏27 KB
    Engine_Momentum_Sub.vi ‏33 KB

  • Reference to control different from reference panel- controls[]

    Hi, I get references to all my objects on front panel from the properties panle->controls[]. In my program I use an Event case and the reference to the contol passed from the Event Case is different fom the reference obtained by panel->controls[]. I need this to be the same since I want to use this reference to search for match in ref array from panel->controls[] get the array index of thet control

    Do you have tabs\arrays\clusters?
    The references from controls in those (and possibly other structures) are not returned when you use the Controls[] property.
    You have to go over all the references and if any of them is one of these structures you need to cast it to its specific class and extract its Controls[] property to get to the controls in it. This needs to be done recursively until there are no more structures.
    I seem to remember seeing a VI somewhere that did this (maybe OpenG?), but I can't seem to find it. Maybe someone else knows.
    Try to take over the world!

  • Creating a dynamic event from a control reference

    Does anyone have an example of creating a dynamically driven  event from a control reference?

    Hi 4BoysDad,
    There is a good example that can achieve what you're looking for in the example finder.  It is called "Dynamically Register For Events.vi".  It will be under
    <labview>\examples\general\dynamicevents.llb\Dynamically Register for Events.vi
    Regards,
    Che T.
    Applications Engineer
    National Instruments

  • Finding vi running in subpanel from a subpanel control reference?

    I've poked around considerably and cannot find a way to take a control reference to a subpanel control and get the vi reference for the current vi running inside the subpanel.
    I know I can save this locally inside the vi containing the subpanel (from the invoke node call to insertvi), but I'm wanting to do this externally from an app that just has references to all the controls.
    Any help would be greatly appreciated.
    Thanks

    If I'm interpreting you correctly, you would like to find the VI reference of the subpanel VI based off one if it's control references that has been passed to some external application from the VI that contains the subpanel VI?  See the attached VIs for an example if this is the case.
    "VI with subpanel" passes a control reference to "SubVI" which can then get the reference to the "VI in subpanel".
    I grabbed the original files from here:
    http://digital.ni.com/public.nsf/allkb/0B11E4964685B49F862571430000091E?OpenDocument
    Trey B
    Applications Engineering
    National Instruments
    Message Edited by Trey B on 07-24-2007 11:30 PM
    Attachments:
    VI in subpanel.vi ‏27 KB
    VI with subpanel.vi ‏29 KB
    subVI.vi ‏8 KB

  • Returning VI reference from control object reference

    Dear All
    I was wondering if there is anything that acts like inverse of "To more specific class" ? I mean it returns the VI reference from a reference to one of its control object? I think it is like moving upward in the hierarchy!!
    Is there any way to implement that?
    Best ragards
    Afshin
    Solved!
    Go to Solution.

    The property OWNER allows you to climb up the tree.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Cluster of control references: want to access the control value

    I want to be able to save and set control values that are saved (XML). I have my controls on about 5 sub vi's. So I thought it'd be a good idea
    to put all the control references in a cluster from the several sub vi's and save and read from one point.
    I can get the cluster values (i.e. the references to the controls), but how to proceed from here? If somebody has a better idea it is very welcome.
    I have also read Ben's nugget here, but it deals with references to controls in a cluster, not references to a reference of a control in a cluster

    Thank you for reading that Nugget!
    I use a GUI Controller in many apps so I can grab refs in sub-VI's.
    Here are some screen shots of them in use.
    The first "GUI Cnt" is a wrapper around the AE and invokes the action "Set Analysis mode" then another call let me get a cluster of the refs so I can choose based on the name.
    This image shows what that action does.
    THis is what happens when going into collection mode.
    That is a small set of what you will find in my image gallery Feel free to browse (yes I know there is a lot of Olivia in there ) and ask if anything catches your interest.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • References from nested clusters

    Hi,
    Currently our station can test only one product at the time, but we modified the wiring so now we can attach 2 units to the same station. A new application must be written to handle the new scenario. The test has to be executed several times on both the units. The execution is sequential so unit1 first then unit2.
    I have created a CONTROL cluster with the following elements
    - bool: boolean button (means unit enabled/disabled)
    - PARAMS cluster: various text rings. This cluster is disabled and greyed out once the user enabled the starter.
    - MEASUREMENT graph
    Rules:
    - the unit can not be enabeled if any of the text rings is unconfigured.
    - the test must be interrupted immediately for the given unit if the enabled button is pressed during the test (when the user disable the unit runtime). So a reference to this button must be used and continously monitored.
    - the test must be interrupted immediately for both the units if the stop button is pressed during thet test
    - after a test is completed the results must be evaluated and the unit must be disabled if the measured values are outside of the limits.
    now... This would be a very easy task if I would have one unit only. I would just create the neccessary control references drive them to the measurement VI and here we go.
    But its getting inconveniently complex when I have control 2 units. I can not treat the control elements in an array (so like an array with 2 CONTROL clusters) because then I can not disable the PARAMS clusters independently.
    I dont see an easy way to add 2 of the CONTROL clusters to a new cluster (so treat them as one cluster), I am not sure how to get the references in this way. (if I combine them into one cluster its pretty easy to get propertynode/value for any of the elements, but I need control refs)
    So I handle both clusters as an independent control on the front panel, so I have add lot of duplicatinos to handle both units in the same way. I find this very inconvenient and error prone, plus it complicates the block diagram 
    I am wondering what would be right approach to handle these type of problems.
    (I have tried to create reentrant VIs but I gave up because I had to communicate too much between my main VI and the reentrant VIs. That made the code hard to follow)
    I use LV2012, but the attachment in LV8 so hopefully everybody can open it
    Thanks
    Attachments:
    Cluster.vi ‏16 KB

    Well... if I create a reference to the main cluster then I can use the controls[] property which will give me back 3 references in an array. First the button, second the params clusters, third the graph (maybe the order is different, it doesnt matter for now). But when I drive the params cluster reference to another property node it does not offer me a controls[] property, so I can not access the contents of the cluster itself. I may could use some sort of a cast function, but its really counter-intuitive.
    I always have to know the order of any of the given clusters and if I change the order my code will mess up instantly. And hell, should why should I refer to my objects as control[][0], control[][1] etc instead of a real name.
    Not sure if this can be resolved in the current LabVIEW environment...
    The workaround I made is that I have created a cluster in which each element are references. I drive the button, graph and params cluster references into it and as I have two units to control I made an array of this cluster.
    Not sure if you agree but this is overcomplicating the code and I had to create an extra cluster just to access to the references of my original clusters. Pain in the back.
    Let me know your thoughts!
    thx.

  • Get All Controls References

    Hi all
    If somebody know how can i get all controls references of VI (including controls that founds in Tabs and Clusters). I need generic method, because i haven't information about VI (reference to VI i get only at run-time).
    Thanks, Nadav

    To include the controls on Tabs, pass the array from my previous answer into a for loop, use auto-indexing. Place a Class Specifier Constant in the loop, right click on it and set it's type to a Tab Control. Place a "To More Specific Class" function below the constant, and wire the constant into the top.
    If the control from the array that you pass in is a Tab Control, "To More Specific Class" will NOT return an error. Use a case statement and use the No Error case to expose the Tab Control properties. Return the "Pages" property (an array) and pass this into a for loop. Connect a property node to the indexed pages, then select Controls On Page to return an array of controls ON EACH PAGE. You need to set up a shift register and use build array to return all of the controls from all of the pages. Make sure you close the Page Reference.  You can concatenate the array of Tab Control Page items with your original FP Controls.
    Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
    If you don't hate time zones, you're not a real programmer.
    "You are what you don't automate"
    Inplaceness is synonymous with insidiousness

  • Currency Translation not working with "Time Reference from Variable"

    We have created several Currency Translations using RSCUR with a fixed "Key Date".  All have been working fine until we got the request to allow a variable date for the exchange rate date.  I have built a variable on 0DATE which I am putting a default date value into using user exit.  This default date is the SAME date as the fixed "Key Date" which we have been using.  Unfortunately when we use the "Time Reference from Variable" option and use this new variable, no currency conversion is taking place, instead it only shows the original currency values.  I am 100% sure that my variable is getting a value and it is the same date we are using for the fixed "Key Date" value so both methods should be using the exact same exchange rates.  The documentation that I can find states:
    ●      Time reference: The time reference for the currency translation can be either fixed or variable.
    If the time reference is fixed, the time at which the exchange rate is determined is independent of the data. You have the following options:
    ○       You can establish that the time reference be determined upon translation.
    ○       You can select the current date.
    ○       You can specify a fixed date as the key date.
    ○       You can specify any variable that exists for InfoObject 0DATE.
    ○       You can establish that the query key date be used. This is determined in the query settings.
    In my case I am only switching from option "You can specify a fixed date as the key date"=(Key Date) to "You can specify any variable that exists for InfoObject 0DATE"=(Time Reference from Variable).
    What am I missing?  Any help is appreciated.

    I neglected to mention that we are calling this currency translation through a WAD button using the SET_CURRENCY_TRANSLATION command.  I did do a test by applying the currency conversion within query key figure.  This seems to work.  So it appears the issue is with how the WAD is processing the variable, not the query.  When I display the variable in a drop down item within the WAD it does have the default value that I have assigned in user exit.

  • Data acquisition with control references

    I'm a new LabView user and I would like to acquire data in a subVI and display that data in the main VI. I think that I need to use control references and refnums, but I just haven't been able to figure it out. I would GREATLY appreciate any help I could get.
    Thank you!

    From your description I would guess that the "subVI" has a loop in it that repeatedly reads the FP hardware, and the indicator is inside the loop. Right?
    The thing to do is move a lot of the logic in the subVI up to the Main VI--or add the Main's added logic to the subVI, whichever is easier. In the first case, the subVI would go away, in the second, the subVI would become the Main VI.
    If you're confused, post your code in V6.0 format and I'll show you what I mean.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • How do I get an activeX object reference from a LabVIEW ActiveXContainer ref?

    How do I get an activeX object reference from a LabVIEW ActiveXContainer ref?
    I'm trying to control an ActiveX object (a Web Browser) from another VI and need to get the object reference programmatically. I can get the LabVIEW ActiveXContainer reference, but am lost on how to get the reference for the object _inside_ the container.

    Hi Lee,
    The reference to the container is actually also accessing the object inside the container. Use the Property Node and Invoke Node to access properties and launch methods for the object. I've attached a small example that passes the reference to a SubVI and invokes a method inside the SubVI.
    - Philip Courtois, Thinkbot Solutions
    Attachments:
    WebContainer.zip ‏21 KB

  • How can i use labview.tl​b to control Labview from an external applicatio​n?

    Hi,
    I've been told by a labview engineer that i could use the file
    labview.tlb located in the labview install folder to control labview
    from an external application (in my case, a C# app). I'm using Labview
    6.1 under Windows 2000. This article confirms that:
    "ActiveX and LabVIEW"
    http://zone.ni.com/devzone/conceptd.nsf/webmain/54​01BE584FBAEECE862567C2006D36C7?opendocument
    But i've not been able to find out how to use this file to achieve
    what i want. I just want to be able to open/close labview, open/close
    a vi, start/stop a vi, hide/show a vi from a C# application. The above
    web page talks about activex but i really don't see the realtion
    between activex and that labview.tlb file.
    Is there so
    mebody around who knows how to use that file? Why does NI
    tell us that it's possible to do what i want to do but doesn't explain
    how (or hides this info very well)?
    Thanks

    Hi,
    > Hi I am fighting a similar problem and so far I found this: Calling
    > LabVIEW from C++ Using ActiveX
    >
    > http://sine.ni.com/apps/we/niepd_web_display.DISPL​AY_EPD4?>p_guid=B45EACE3E21356A4E034080020E74861&p​_node=DZ52051&p_submitted=N&p_rank=&p>_answer=&p_s​ource=External
    Thanks for the link, i actually already found this link before. I've
    found yesterday how to use Labview.tlb, just add it to the references
    of the project, it was probably too easy for me at that time:-) But
    now, i'm still stuck as there is no doc about using the interfaces and
    classes of this activex to control labview.
    The example given on your link is made is C++ and for some reasons,
    the wrapper generated for Labview.tlb when i added it to my c# project
    doesn't seem to expose the same
    interfaces and classes as the one used
    in the C++ example. I therefore can't use the C++ example in C#.
    I've tried to do something like:
    LabVIEW.ApplicationClass a = new LabVIEW.ApplicationClass();
    Just this line causes labview to launch but then immediately throws an
    exception: "Query interface for interface LabVIEW._IApplication
    failed".
    Does somebody knows how to use that control in C#/VB.NET ?

Maybe you are looking for

  • Help needed in tibco Configuration with OAS 10.1.3

    Hi, I am trying to using OAS 10.1.3 and with Tibco JMS Provider. I have deployed the MDB that gets messages from Tibco JMS Provider. Now here is the issue I am getting the following errors any ideas on what might be wrong: WARNING: Code-source C:\Ora

  • ITunes TV Season purchase, 3 errors in downloading

    Error Message received: There was a problem downloading "Cold Blood / Doctor Who / Doctor Who". An unknown error occurred (-50). Please check that the connection to the network is active and try again.    How do I fix this so I can download the 3 mis

  • Where can I find the file Photoshop .exe in CS6/Windows 7 please?

    Where can I find the file Photoshop .exe in CS6/Windows7 ?  It is not in the usual place.

  • Keynote, hyperlink to hidden slide problem

    I'm currently making a keynote that on one picture has a hyperlink to a slide. When the keynote is finished I don't want the presentation to show the slides that my hyperlinks are referring to. But if I try to hide the slide the hyperlink is linked t

  • I get a message stating to close out Adobe Bridge

    I also am having a problem trying to download CS6.  At 42% it simply prints out an error message asking me to close out AdobeBridge.  But I have and it's not open and I've shut down my machine but I can't get around this problem.  I found another per