Dynamic creation of controls on the fly

Hi,
I want to populate the labview front panel with controls read from an XML Sheet.
Is this possible in LabVIEW????
At the start , I will read the xml and the depending the controls writen in the XML file i will palce them on the LabVIEW front panel.
This feature of creating dynamic controls is easily avaible in other programming languages like VB .
Please help me if such type of feature is avaible in LabVIEW too...
Thanks a lot in advance
Avni

avni wrote:
This feature of creating dynamic controls is easily avaible in other programming languages like VB .
Please help me if such type of feature is avaible in LabVIEW too...
Hi Avni,
Please try searching these forums for the title "Scripting in LabVIEW" & also the lava.org forums for the same; you ll get a lot of ideas.
- Partha
LabVIEW - Wires that catch bugs!

Similar Messages

  • Dynamic creation of control

    Hi is it possible to create control buttons in run time based on the input given by the user.Do any one have the demo program

    Intaris a écrit:  Yes, but that's not strictly creating controls, is it?  It's mimicing controls. It's certainly a nice feature to have when you come up against a fundamental limitation of LV, but I think someone who is not yet aware of the fact that LV in itself does not support dynamic control creation should try first to write code in a way that is compatible with this....
    My point of view is different. When somebody ask a question, for which there is indeed a solution, I'll try to avoid saying "No, there is no solution". I'll balance my reply to take into account "environment" parameters (difficulty, cost, time, compactness...). As a university professor, this is a situation I have to face with my students on a daily basis. And, from experience, I found it is most often more rewarding for everybody to say "Yes you can...but...". It leaves the parter the possibility to decide himself if the solution fits his needs.
    In the specific case of LabVIEW limitations, I also think that it is better to acknowledge the limitation and propose a workaround (= a way to write code that is compatible with the problem) that is most often more efficient than the way the "customer" was considering.
    There are no problem, just solutions 
    Message Edité par chilly charly le 09-18-2008 08:47 AM
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • Dynamic creation of Controls in JSF ??????

    i just started on JSF...I've good experience with ASP.NET....
    I have liked what I've seen so far in JSF.....It's pretty straight forward ...neat clean and simple...
    What I am looking for in JSF is a way to create controls in a page dynamically.... A simple thing like UIRootView.....parent control...add(controltype).. something like that.....
    Is it possible ? ie, can we have a staright forward access to the control tree at some stage of life cycle of a request without having to write view handlers or Phase listeners ?
    Pardon my ignorance....I am just a new guy who is getting sold on the JSF idea ....

    Thanks... but I am not sure if I understand you correctly. can you elaborate on it ?
    also, what's stopping me from accessing the API to do that same thing as ASP.net ? Tree,TreeFactory etc. might be the answer. There's got to be some API which does the management of control tree in the first place.
    Now the quest is to find it and use it.
    Any clues on this front ? Also, maybe this thread will catch the attentoin of someone who can add to the "wishlist" for JSF...It is an useful feature
    for the dynamic world we live in....DON'T YOU THINK ?

  • How do I make one control change the entry list of another?

    I am using LabView 2010 and would like to create a custom control, in which there are two ring controls (among other things).
    The options shown in one ring menu should depend on what option is picked in the other ring menu.
    How does one do that?
    Solved!
    Go to Solution.

    Well the data that goes into the two rings will have to be initialised somehow...  Or by constant array, or by reading them from file.
    If you don't want to change your code, I would defenitly getting the string you want to get from file.
    But still, to update the 2 rings, you will have to update the strings in the 2nd control on the fly.
    FILE : 
    [OPTIONS]
    Option1=...
    Option2=...
    [POSSIBLE_SELECTIONS]
    Selection1.Parent=1
    Selection1.Name=...
    Selection2.Parent=1
    Selection2.Name=...
    This is how you could set up the file.  where options are the items which your are going to put in the first ring.
    Depending on that selection you will go fill out the names in the second ring depening on which parent is selected in the first ring
    Kind regards,
    - Bjorn -
    Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's
    LabVIEW 5.1 - LabVIEW 2012

  • Dynamic Creation of Buttons and Actions HELP

    Hi there,
    I have got a problem (or maybe even two) with the dynamic Creation of buttons. The code below creates the buttons.
    My main problem is, that the parameter created for the button's action isn't propagated to the assigned event handler. I get a null, though the name of the parameter in the event handler and the name of the parameter added to the action are the same.
    Could it also be that I'm always using the same action? I.e. does wdThis.wdGetAddElementAction() always return the same action instance? If yes, how can I create individual actions for each button?
    Any help is appreciated!
    Cheers,
    Heiko
    "    for(int i=rootContainer.getChildren().length; i<wdContext.nodeFeature().size();i++)
                   IPrivateVCT_Feature.IFeatureElement featureElement = wdContext.nodeFeature().getFeatureElementAt(i);
                   IWDTray featureTray = (IWDTray) view.createElement(IWDTray.class, featureElement.getName());
                   IWDCaption header = (IWDCaption) view.createElement(IWDCaption.class, featureElement.getName()+"_Header");
                   header.setText(featureElement.getName());
                   featureTray.setHeader(header);
                   featureTray.setExpanded(false);
                   rootContainer.addChild(featureTray);
                   IWDButton button = (IWDButton) view.createElement(IWDButton.class, featureElement.getName()+"_Button_AddElement");
                   IWDAction actionAddElement = wdThis.wdGetAddElementAction();
                   actionAddElement.getActionParameters().addParameter("featureIndex", new Integer(i).toString());
                   button.setOnAction(actionAddElement);
                   button.setText("Add Element");
                   featureTray.addChild(button);

    Hi Heiko,
    You have done everything correctly....except for 1 line
    in the code...
    Replace the following line in your code:
    actionAddElement.getActionParameters().addParameter("featureIndex", new Integer(i).toString());
    Replace the above line with this code:
    button.mappingOfOnAction().addParameter("featureIndex",i);
    Actually in your code, you are not associating the parameter with the button...
    Note that addParameter(...) comes with two signatures: addParameter(String param, String value) and addParameter(String param, int value). You can use any of them based on yuor need.
    Hope it helps,
    Thanks and Regards,
    Vishnu Prasad Hegde

  • Table Creation on the fly

    Hi,
    I have to run 50 reports last day of every month. Each query will do lot of dynamic calculations which are a time consuming. The whole point is to create excels for each of the report. But since the Application will throw request time out error if time exceeds more than minutes. So we decided to generate the data for each of those 50 reports and store in a temporary table... so that the application will not throw time out error...
    Details:
    Oracle 10g.
    .NET
    # of records in each table: > 700k
    In order to accomplish the above task we have to create temporary tables.. but the question is for every report do we have to create a table on the fly OR create a base table which will have 100 columns which will be a cross product of all the columns selected in all the 50 queries and every row will have a report id..
    OR Is there a better way to accomplish the above?
    thanks in advance

    Thank you.. the only reason i wasnt going for view is i wont be able to have indexes if i want to add some filter while exporting to excel..
    other wise we should be good with materialized views..

  • Better control over the creation of thumbnails

    While i have nothing against the current method of generating thumbnails with ADDT, I feel we need better controls as to how our thumbnails are created. By all means, the current option of generating thumbnails on the fly can remain, but I feel we need a tab on the image upload behaviour that allows us the developers to determine how our thumbnails are created.
    This will mainly happen during the image upload process. For example, in order to get uniform thumbnails, a developer could decide that he wants to crop his thumbnails to a certain size so that they can look good in a gallery. This i feel will come in pretty handy for those who are using Spry to create a photo gallery. At the moment, the one way you can create thumbnails on upload is to create a custom trigger and enter the required code to be executed after the file has been uploaded.
    So this feature will be welcomed i feel by many who are not too happy with the current method of generating thumbnails.

    I agree.
    Well said Emmanuel since the ADDT thumbnails are only created when requested by the display thumbnail server behavior. So some additional flexibility would be welcome. For example, when you do not wish to use the server behavior. Till then, we just have to use a custom trigger and to some ADDT users, thats advanced stuff.
    Cheers.

  • Dynamically  populate  a  record  group  on  the  fly uisng LOV

    Hi,
    I want to create dynamically populate a record group on the fly uisng LOV.
    1. This is how the RG_BANKNAME Record Group object look like
    Object : Record Group
    Name : RG_BANKNAME
    Record Group Query : SELECT NAME, SHORT_NAME FROM C_BANKS
    2. I create the Push Button and when user click it will popup the LOV.
    DECLARE
         rg_id RecordGroup;
         errcode NUMBER;
         status BOOLEAN;
    BEGIN
         rg_id := Find_Group('RG_BANKNAME');
         IF Id_Null(rg_id) THEN
              Message('No such group: ',ACKNOWLEDGE);
              RAISE Form_Trigger_Failure;
         ELSE
              errcode :=POPULATE_GROUP(rg_id);     
              SET_LOV_PROPERTY('LV_NAME', TITLE, 'My Own LOV');
              SET_LOV_PROPERTY('LV_NAME', GROUP_NAME, rg_id);
              SET_LOV_COLUMN_PROPERTY('LV_NAME', 1 ,Title, 'NAME');
              SET_LOV_COLUMN_PROPERTY('LV_NAME', 1 ,Width, 150);     
              SET_LOV_COLUMN_PROPERTY('LV_NAME', 2 ,Title, 'SHORT NAME');
              SET_LOV_COLUMN_PROPERTY('LV_NAME', 2 ,Width, 100);     
              status := Show_LOV('LV_NAME',10,20);
              IF NOT status THEN
                   Message('You have not selected a value.');
                   Bell;
              END IF;
         END IF;
    END;
    My question is do I need to create the LOV Object name call 'LV_NAME'? since I don't have this
    create on my design times, because I thought it can be done dynamically on the fly.
    The problem is compliant that the Lov Id is not valid.
    Thanks
    David
    Edited by: user445990 on May 24, 2011 9:19 PM

    Hello,
    You request is not clear. Do you need to display the LOV or not ? In other words, what is the goal of your record group ?
    Francois

  • Can a Field in an iBooks be Updated on the Fly? (Dynamically)

    I have a very specific question about iBooks Author, and the iBook 2 format. Here is what I need to do... Lets say I have a field (either in a text box, a table, or any other required medium that has a specific piece of data. Can that data be updated dynamically on the fly?
    For example...
    The "field" title is Population of Des Moines, IA. Is there any way that the iBook, when the box is click, or even automatically call to a database that changes that data each day, to reflect updated information?  User Opens on Monday.... 250,000 User opens on Tuesday and the field is now updated with current statistics to reflect births/deaths and now reads 249.950.
    If not in a specific field... can an entire table be show in an ibook that is actually just loaded from a website. For example.. A website has the current population of Des Moines. The iBook displays that cleverly formated webpage within the iBook.
    Any help would be helpful, this is just an example with much, much larger value to my industry.
    Thanks!

    Thanks...That's not a bad thought. Can that be done to automaticly refresh upon opening? The useage case is really to try to get the "document" to reflect any changes made to it, without having to update the entire document. In this case, the iframe would be the main portion of the page, not a supporting element. So having to click would be a little bit of a user distraction. Maybe it's not possible, but just trying to see.
    Has anyone done any behind the scenes magic that they've managed to flavor the Apple sauce like this?

  • Is there a way the user to change the equation in the formular node from the front panel on the fly, dynamically?

    Is there a way the user to change the equation in the formular node from the front panel on the fly, dynamically?

    Try the Parser VIs (also known as LV Mathematics VIs, or simply GMath VIs) located under the Analyze>>Mathematics palette (not in the Base package). You might want to start with the "Eval Formual Node.vi" located in the Analyze>>Mathematics>>Formula palette. There are many differences between these G-based, dynamic formula VIs and the LabVIEW formula node, but these VIs often prove quite useful when your formula changes on the fly. For more detail on the differences, see the LabVIEW Help file (Cntrl-Shift-? from within LabVIEW) under the topic "Mathematics VIs, parser differences with Formula Node".

  • Is there a way the user can change the equation in the formular node from the front panel on the fly, dynamically?

    Is there a way the user can change the equation in the formular node from the front panel on the fly, dynamically?

    Sorry, I don't think so. That would be pretty cool if you could create a property node for a formula node and then enter a formula on the front panel and use it to update the formula. But you can't create a property node for a formula node and the only way of modifying the formula is by typing it into the formula node on the diagram. And you can't modify a diagram of a running VI.
    You could create a VI which is only a formula node with the maximum number of inputs and outputs you expect. Have a button on the calling VI to Edit Formula. When the button is pressed, use a VI server to display the front panel on the formula VI, display a dialog box telling the user how to display the diagram of the formula VI, then stop the calling VI. (You can't edit a sub-VI while t
    he calling VI is running). The user will then need to rerun the calling VI to use the new formula.
    You might be able to do something by calling MatLab or something like that to get an interactive formula window.

  • How to? switch between the following mission control preference "group windows by application" on the fly? OR have both readily available

    Is there any way to switch between the following mission control preference "group windows by application" on the fly?  I would like to turn this feature on and off quickly. OR have both readily available?
    If osx 10.9 does not support this, does any one know if automater can be used to creat a short cut to turn this preferance on and off?
    Current solution (not much of a solution)
    I currently added the preferance control icon for mission control on my dock.

    4u2nv247 wrote:
    Current solution (not much of a solution)
    I currently added the preferance control icon for mission control on my dock.
    Do you mean the general System Preferences icon? ...If so, it's possible to put the icon specifically for the Mission Control pane in the Dock:
    I'm on Mountain Lion and that Preference Pane is in: Macintosh HD > System (not Users) > Library > PreferencePanes > Expose.prefPane
    ...Drag that Expose.prefPane to the right-hand side of the Dock, say, next to the Trash. Then you can simply click on the resulting Expose Prefs icon in the Dock to open its Prefs panel.

  • Creating on the fly dynamic named bind variable names.

    I have an application process which gets called by a Dynamic action and Javascript.
    Everything is working great however I'm using it to drive dynamic charts.
    I could use IF statements at the end of the application process to decide what BIND vairable to fill with the information the process has collected however I'd prefer just to create the BIND variable from the
    name of the submitted information.
    So I have an application level variable called WHICHCHART. this gets populated with text upon calling the application process...so let's say 'chart1' is what it gets filled with.
    What I"d like to have at the end of the application process is just a bind variable waiting called :chart_1.
    So no matter what the value of WHICHCHART it will create an on the fly a bind variable with the same name.

    Ok. I guess this question was more how do you do this..then OH NO there are not other ways to do this.
    So I have a page with a chart region. this chart will have 3 Y Axes which prohibits the use of the default XML.
    So..
    I have the following Javscript:
    function getdata(whichchart) {
      var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=VM_XML_GENERATION',0);
            get.add('WHICHCHART',whichchart);
            gReturn = get.get('XML');
      get = null;
    Which is called when the page loads by a dynamic action:
    getdata('production');
    When the javascript is called as you can see it fires off:
    declare
       chart_series_data VARCHAR(32767);
       type array_cols is varray(7) of varchar2(100);
       array array_cols := array_cols('VM_HOSTS_NUM','VM_NUMBER','VM_PHYS_MEM','VM_VIRT_MEM','VM_CPU_COUNT', 'VM_TOTAL_DISK','VM_PROVISIONED_DISK');
    BEGIN
    --IF :WHICHCHART IS NULL THEN
    --RAISE_APPLICATION_ERROR(-20001,'Chart variable not set');
    --END IF;
    chart_series_data := null;
    chart_series_data := '      <data>'||chr(10);
    chart_series_data := chart_series_data||  '        <series name="Hosts Number" type="Line" color="0x1D8BD1" >'||chr(10);
    for c1 in (SELECT VM_REPORT_DATE LABEL,VM_HOSTS_NUM from TABLE where VM_REPORT_DATE between add_months(SYSDATE,-24) and SYSDATE and lower(VM_DCNAME)=lower(:WHICHCHART) )
    loop
    chart_series_data := chart_series_data || '<point name="'||c1.LABEL||'" ';
    chart_series_data := chart_series_data || 'y="'||c1.VM_HOSTS_NUM||'"></point> '||chr(10);
    end loop;
    chart_series_data := chart_series_data|| '      </series>'||chr(10)||'</data>';
    :PROD_DATA := chart_series_data;
    END;
    The : production variable at the end of this I want to change the name of based on the value I'm sending of WHICHCHART from the javascript. I hope this is clearer now.
    AGAIN this is not really a need. It is a want to be able to create dynamic bind variable names going forward.
    Thanks

  • Dynamic creation of tab control

    Hi,
    Am suppose to create table control for each header record in intenal table.
    ie-
    Header1
    Tab contrl 1
    header2
    Tab contrl 2
    header n
    Tab contrl n
    Though number of records in int table not fixed.
    can anybody please guide me how can this be achieved as for tab control we have to draw tab control container in screen painter first.
    Thanks,
    Sanjay Deshpande

    If you intend to do that, you'd have to create the dynpro dynamically and generate it using the sentence GENERATE DYNPRO, otherwise you won't be able to place N fields dynamically in the screen. (However SAP does not recommend using this sentence in application programs)
    Another option would be the use of OO ALVs instead of Table Controls, with this approach, you'll be able to generate N ALVs (one for each header) by splitting a screen container control in N predefined 'SubContainers' (You can use the CL_GUI_SPLITTER_CONTAINER component)

  • Can I create a dashboard layout on the fly?

    Hi all, I am trying to create a dashboard layout "on-the-fly"
    (dynamically).
    for example: I can create the following layout using MXML
    very easily:
    [CODE]
    <mx:VBox width="100%" height="100%"
    horizontalAlign="center">
    <mx:Canvas id="dashboardCanvas" width="90%"
    height="90%">
    <mx:HBox width="100%" height="100%">
    <mx:Panel title="panel 1" width="50%" height="100%">
    <mx:VBox width="100%" height="100%"
    borderStyle="solid">
    <myDashboarComp borderStyle="solid" />
    <myDashboarComp borderStyle="solid" />
    <myDashboarComp borderStyle="solid" />
    </mx:VBox>
    </mx:Panel>
    <mx:Panel title="panel 2" width="50%" height="100%">
    <mx:HBox width="100%" height="100%">
    <myDashboarComp borderStyle="solid" />
    <myDashboarComp borderStyle="solid" />
    <myDashboarComp borderStyle="solid" />
    </mx:HBox>
    </mx:Panel>
    </mx:HBox>
    </mx:Canvas>
    </mx:VBox>
    [/CODE]
    You can see that I want to build my dashboard up using
    HBox's, VBox's, Panels and the individual custom components
    (myDashboarComp) - keepinng the layout and structure quite simple.
    The above MXML creates a simple Dashboard consisting of the
    canvas (where it all starts - it constructed from -
    "dashboardCanvas"). the canvas has 2 panels within a HBox (so are
    side by side) called "panel 1" and "panel 2". panel 1 contains a
    VBox containing 3 components (displayed vertically) and panel 2
    contains a HBox containing 3 components (displayed horizontally) -
    so very simple.
    However - I want to control this layout externally e.g.
    passing an object or array (some sort of descriptor) to describe
    the layout to my app.
    I then want to loop through this descriptor item and build my
    dashboard using ActionScript rather than MXML to more control and
    flexibility.
    this is the object I have created and have been experimenting
    with in ActionScript:
    [CODE]
    [Bindable]
    public var descriptorObj:Object =
    {item:"dashboard", children: [
    {item:"vbox", id:"vbox1", percentWidth:100,
    percentHeight:100, children:[
    {item:"panel", id:"panel1", percentWidth:50,
    percentHeight:100, children:[
    {item:"vbox", children: [
    {item:"myDashboarComp"},
    {item:"myDashboarComp"},
    {item:"myDashboarComp"}
    {item:"panel", id:"panel2", percentWidth:50,
    percentHeight:100, children:[
    {item:"hbox", children: [
    {item:"myDashboarComp"},
    {item:"myDashboarComp"},
    {item:"myDashboarComp"}
    [/CODE]
    This is as far as I got as I kept hitting hurdles from here.
    Basically - all I want to do is somehow read / loop through
    this object and build my dashboard.
    First of all I was unsure of the best way to loop through the
    object - as I have to do it in order to get the correct layout...
    i.e. the first 3 "myDashboarComp's" are added to the >
    VBox that is added to > "panel1" that is added to the > HBox
    that is added to the > Canvas.
    This is where I ran into my second problem. I managd to loop
    through and read the elements checking there "item" in the object
    and adding them accordingly.... I could loop though and add each
    item to the canvas ok, e.g:
    [CODE]
    private function initApp():void
    for(var i:int=0; i<descriptorObj.children.length; i++)
    var itemType:String = descriptorObj.children
    .item.toString();
    var percentWidth = descriptorObj.children.percentWidth;
    var percentHeight = descriptorObj.children
    .percentHeight;
    addContainer(itemType, percentWidth, percentHeight);
    private function addContainer(conType:String, pWidth:int,
    pHeight:int):void
    if(conType == "panel")
    addPanel(pWidth, pHeight);
    else if(conType == "vbox")
    addVBox(pWidth, pHeight);
    private var newPanel:Panel;
    private function addPanel(pWidth:int, ptHeight:int):void
    newPanel = new Panel();
    newPanel.percentWidth = percentWidth;
    newPanel.percentHeight = percentHeight;
    newPanel.title = "test panel";
    dashboardCanvas.addChild(newPanel);
    [/CODE]
    in the above actionScript the canvas "dashboardCanvas" is
    already set up in the MXML (but is the only MXML container added as
    the rest should be built using the create object "descriptorObj" in
    AS).
    This is my next problem - when I have added a container,
    e.g. a panel the next items e.g. my "myDashboarComp's" should then
    be added to the previously added panel and not to the canvas
    anymore - I need some way of telling the app to add children to the
    last added container and not to the canvas (and each container can
    change type from a panel to VBox to HBox etc....)
    I hope what I am trying to say makes sense, and any help on
    this one would be greatly appreciated.
    I just need pointing in the right direction and some ideas on
    how to continue would be good - and if my thinking / method / ideas
    are actually possible.
    Kind Regards,
    Jon.

    There are several ways to do this. The third chapter in the
    cookbook is a good place to start.
    All things in ActionScript are based on objects. Constructing
    them with the data needed for the ui information you will need and
    then binding that data to your dashboard objects is basically what
    you are going to be doing.
    For me it makes the most sence to have an idea of what
    different types of objects you will be creating and create some
    extended components for those objects. Then when you recieve your
    data, binary or xml, you can digest the configuration settings from
    the layout and populate the constructor for each of your
    components.
    It sounds like you need to organize your layout structure in
    a heirarchy and from that you can walk each branch and create each
    set of things as you parse your data.
    Without a bit more information as to what you are
    specifically doing that is about as far as I can go minus adding in
    some code along some line that I think might work.
    Hope that helps some.
    -D

Maybe you are looking for

  • Converting xml string to valid xml format In biztalk expression shape

    <DocumentElement> <ApplicationStatus> <ApplicationName>XpathDebatch</ApplicationName> <Status>Stopped</Status> <ReceivePorts>RcvRates, </ReceivePorts> <Sendports>SendRates, </Sendports> <Orchestration>xpathDebatch.BizTalk_Orchestration1,</Orchestrati

  • A very small request . . .

    As I understand it, many people requested that the Lightroom Library be renamed "Catalog". If this is true, shouldn't the Library Panel, as well as the module itself, also be changed to "Catalog" for the sake of consistency? I admit this is a very sm

  • Reading Additional info for Material Document (Movement Types 313, 201)

    Hi SAP Gurus, I am currently working on a requirement for Material Document Interface. <u><b>The Requirement is as below:</b></u> (1) The user creates/modifies a material document using MB01/MB03/MIGO for movement types 313 and 201 separately. (2) Th

  • JBDC transaction attribute problem.

    Hi All, We have some methods which will make a call to database to bring some data using SELECT statement. Have set transaction attribute for those methods as NOT SUPPORTED not to open a transaction and lock the table. But, now it is opening a transa

  • Use daq across multiple Labview applicatio​ns

    Is it possible to have daq handoff data to multiple Labview applications running at the same time?  Each application is specific to a certain test setup, but each test setup has its channels run into a couple of scxi cards in one computer/daq card.