Use a 2d array to populate a drop-down list box and return a different value.

I am very new to Labview. I tried to write a VI which reads in 3 columns of data from a spredsheet excel (.csv) as an array of strings. I was able to understand it and then isolated the 2nd and 3rd column to transform data in double format. I want to do is use a list box dropdown refrence the 2nd column of data and find the 3rd so that it can be multiplied by my waveform in post processing. I want to make it easy for the user to configure the sensitivity of the gauge. I enclose my VI and an example of data that I'm reading in. Please give me a helping hand.

Thank you

montoya51


Tags: NI Software

Similar Questions

  • How to populate a drop-down list box itemEditor

    Hi all

    I have a DataGrid where one of the columns is a drop-down list box. I use a component itemEditor for the drop-down list box. I guess that's the best practice? I have an arrayCollection collection in my application I want to use in the itemEditor, but I'm not sure how to pass data to the component. Here is my code. Any help you could provide on how to do this would be greatly appreciated.

    Answered my own questions.

    Just need to add the result to my model object and then use it as my dataprovider.

    DOH!

  • Check generate some Comp based on the drop-down list box and the selection list?

    I currently have a dropdown list with the three sizing options in it. Then I have two check boxes, one is ticked ideally would create the model to its normal size composition and if other is checked that it would reverse the widthxheight in the size of the composition. Then below that I have a "Generate" button, I want to be able to click and according to my selections, it creates the model.

    Looks like I need a kind of if then statement, but I'm having a hard time putting the two together. See below what I have so far.

    There may be missing parts, but I have it all working in a decibel pallate currently. I don't have functionality related to a button again.

    Any help would be appreciated!

    (also I don't know how to format the script spread here so apologies for that)

    ---------------------------

    palette controls

    templateGen.VerticalCheckbox = new Object();

    templateGen.HorizontalCheckbox = new Object();

    set the values for controls

    templateGen.comLookup = new Object();

    templateGen.compLookup = 'Template1 ';

    templateGen.compLookup = "Template2";

    templateGen.compLookup = "Template3."

    function templateGen_getHashValues (hash)

    { // {{{

    var ary = new Array();

    for (k hash) {}

    ARY.push (Hash [k]);

    }

    return area;

    } // }}}

    menu "composition".

    var panelGrp1 = templateGen.palette.add ('Panel', undefined, 'Templates Comp');

    compGrp1 = panelGrp1.add ('group', undefined, 'List templates');

    compGrp2 = panelGrp1.add ('group', undefined, 'Orientation');

    compGrp3 = panelGrp1.add ('group', undefined, 'Generate');

    templateGen.compList = compGrp1.add ('dropdownlist', LIST_DIMENSIONS, templateGen_getHashValues (bapple.compLookup));

    templateGen.compList.helpTip = "choose the type of desired here device model. All compositions are 60 fps. « ;

    templateGen.compList.selection = 'Template1 ';

    templateGen.compList.graphics.foregroundColor = darkColorBrush;

    templateGen.VerticalCheckbox = compGrp2.add ('checkbox', undefined, 'Portrait');

    templateGen.VerticalCheckbox .value = true;

    templateGen.HorizontalCheckbox = compGrp2.add ('checkbox', undefined, 'Horizontal');

    templateGen.HorizontalCheckbox .value = false;

    templateGen.generateBtn1 = compGrp3.add ('button', undefined, 'Generate');

    applyBtn.onClick =? ;

    When I work with drop-down menus, I always liked to tie the data they represent (like the width and height of the model in this case) directly to the elements.

    I run the code to really check, but it should work like this:

    -----------------

    Add models to your drop-down list and store the items in a table

    models var = [];

    models [0] = templateGen.compList.add('item','template1');

    models [1] = templateGen.compList.add('item','template2');

    models [2] = templateGen.compList.add('item','template3');

    set a width and height of each element

    models [0] .width = 1280;

    models [0] .height = 720;

    models [1] .width = 1024;

    models [1] .height = 768;

    models [2] .width = 1920;

    models [2] .height = 1080;

    Choose the item that should be selected by default

    models [0] .selected = true;

    applyBtn.onClick = function() {}

    read the width and height of the selected item

    var width = templateGen.compList.selection.width;

    var height = templateGen.compList.selection.height;

    {if (templateGen.VerticalCheckbox.value)}

    swap width and height

    var temp = width;

    width = height;

    height = temp;

    }

    now create your comp here with the given width and height

    }

  • drop-down list dataProvider and an object of value

    I am filling a dropdown menu with values that are stored in an object of value.   I'm pulling the values from the table of a database vai SQLite the SQLResult object and they come as an array of objects of value. This is exaclty what I want, so I refer to those within a property of my object model and shipping and the event carrying this table.   I place the array of objects of value in a collection of table as follows:

    var dropDownListValues:ArrayCollection = new ArrayCollection(event.foodCategoryList);
    

    Try to access it via a drop-down list lists dataProvider property as follows:

    foodCategory.FoodCategory_DropDown.dataProvider = dropDownListValues;
    

    My drop-down list then displays

    [object Object]
    [object Object]
    [object Object]
    [object Object]
    [object Object]
    [object Object]
    

    My dropDownListValues object has the following table:

    [0]
         Foodcatagory = "Grains"
         FoodCatagory_ID = 1
    
    [1]
         Foodcatagory = "Vegetables"
         FoodCatagory_ID = 2
    
    
    
    
    etc. all the way up to index 5
    
    
    

    How can I get the drop-down list to display only the Grains, vegetables... etc.?

    Thank you

    I had to search around for a few hours today on the same subject.

    Basically just set the labelField of the drop-down list the name of the field for its values

    foodCategory.FoodCategory_DropDown.labelField = "Foodcatagory";
    
  • How to change the items in a drop-down list box that is part of an array of clusters

    Hello

    In the attached vi, I have an array of clusters and each cluster contains two drop-down list boxes. How can I edit the items in the drop-down list box 1 for all elements in the array? (All elements of list box 1 has the same elements.)

    By way of illustration, I have also included the case of trivila, for example, edit the items in a separate drop-down list box that is is not part of an array of clusters (combo box 3). Please notify. Thank you.

    Peter

    Right click on the drop-down list box and select Create-> Node-> String() property. Place it on the block diagram. Change to write (right click) and then feed him an array of strings.

  • Select the string table drop-down list box.

    Hi all

    I want to select the combo box list based on a string in the entry, I don't know how to do this. I have a drop-down list box and the value comes from a database, what I want to do is I want to change the value of the selected box based on the existing value in the database drop-down list. for example, A, B, C D I strings in the drop-down list box, and then in my database, I have a field with the string C, I want to change the C to A. I can't enter the value of C in a string format, but I don't know how to be the first position of the drop-down list box in so the order of channels combo box will be C, A, B, d., the value of C

    Thank you

    Then just write a new array of strings, with the elements of the new agenda, to the "[] strings" - property.

    Either you must code something that allows you to create an array of strings with the elements in the order that you want them to be. If there is a reorganization only, you could do something like:

    -Get the array of strings [] from the drop-down list using a property node box.

    -Find the position of the element you want to place first and use "delete from table", which returns the new array and the element removed.

    -Build a new table 1 d of the deleted item and table remaining. Move to the second combobox Strings [] property of a node property.

  • get the index of a selected item in a drop-down list box

    Hello

    If I have a list of strings in a drop-down list box and the user selects one in the drop-down menu, how can I get the index?  I was able to explore the table for the selected channel, but it seems like duplication of effort to create a list and then go back and research it.

    Thank you

    Brendon

    It's easier to change control of the ring or Enum which gives the index as a default value, a drop-down list box gives a string that must be converted. But if you like really graphic and you want to use the drop-down list you can uncheck the "use strings as values" option and enter the index as numbers and then make a string to Decimal conversion.

    /Y

  • How to make a pdf that can send a form to e-mail selected in a drop-down list box?

    I'm trying to be able to create a user of a pdf file I created, select an e-mail from a drop-down list box and then hit send and have it send to this email address that has been selected.

    Thanks for the help!

    Hello

    I don't think (maybe wrong) you can do this in InDesign. At the very least, you could draw the shape in InDesign, but I guess that the interactivity between the selection of the list and the action of mail should be done with Scripting Acrobat or LiveCycle Designer if you have.

    FWIW,

    Loïc

  • How to clear a drop-down list box

    OK, been awhile, here goes:

    I have a combobox non-Edition and 3 radio buttons.

    When I select a radio button, I have reset the items in the list and run:
        category.getSelectionModel().clearSelection();
         category.setValue(null);
    The intent is a new list, nothing pre-selected and invited him to display in the text box (?). And it seems to work at first.

    However, when I select the original square, the first list is restored, and the drop-down list box shows my original selection!

    I would like that the prompt as in other radio buttons. I can not even find where the initially select value is stored! It SEEMS that the selection is cleared, as the value, it's the control renderer displays always a selection, even if the previous list, he showed the guest
         templateToggle.selectedToggleProperty().addListener(new ChangeListener<Toggle>() {
                @Override
                public void changed(ObservableValue<? extends Toggle> ov,
                        Toggle old_toggle, Toggle new_toggle) {
    
                    if (templateToggle.getSelectedToggle() != null) {
                        final String tmplType = ((RadioButton) templateToggle.getSelectedToggle()).getText();
                        Preferences.userNodeForPackage(Evidentia.class).put(Const.O_TMPL_TYPE,
                                tmplType);
    
                        Platform.runLater(new Runnable() {
                            @Override
                            public void run() {
                                category.getSelectionModel().clearSelection();
                                category.setValue(null);
                                category.getEditor().setText("");  << was getting desparate
                                ListManager.getInstance().setTemplateCategoryList(TemplateDao.getInstance().findCategories(tmplType));   << template list is the list behind the combo
                            }
                        });
    
                    }
                }
            });
    Thoughts?

    Published by: edward17 on 8 April 2013 11:20

    Published by: edward17 on 8 April 2013 17:11

    Published by: edward17 on 8 April 2013 17:12

    This looks like a bug: you must file a JIRA for her.

    As you said, the State seems to be correctly updated: getSelectionModel () .getSelectedIndex () and getSelectionModel.getSelectedItem () return the correct value.

    The only solution I can find is to define an explicit Circus on the drop-down list box and call setText (null) on the circus to clear the displayed selection:

    import java.util.HashMap;
    import java.util.Map;
    
    import javafx.application.Application;
    import javafx.beans.value.ChangeListener;
    import javafx.beans.value.ObservableValue;
    import javafx.collections.FXCollections;
    import javafx.collections.ObservableList;
    import javafx.scene.Scene;
    import javafx.scene.control.ComboBox;
    import javafx.scene.control.ListCell;
    import javafx.scene.control.RadioButton;
    import javafx.scene.control.Toggle;
    import javafx.scene.control.ToggleGroup;
    import javafx.scene.layout.HBox;
    import javafx.scene.layout.VBox;
    import javafx.stage.Stage;
    
    public class SwitchableCombo extends Application {
    
      @Override
      public void start(Stage primaryStage) {
        final Map> comboData = new HashMap<>();
        comboData.put("Beer", FXCollections.observableArrayList("IPA", "Stout", "Porter", "Dubbel"));
        comboData.put("Wine", FXCollections.observableArrayList("Cabernet Sauvingnon", "Zinfandel", "Merlot", "Malbec", "Pinoit Noir"));
    
        final ComboBox combo = new ComboBox<>();
        final ListCell buttonCell = new ListCell() {
          @Override
          public void updateItem(String item, boolean empty) {
            super.updateItem(item, empty);
            setText(item);
          }
        };
        combo.setButtonCell(buttonCell);
        final HBox buttons = new HBox(5);
        final ToggleGroup toggleGroup = new ToggleGroup();
        for (String type : comboData.keySet()) {
          final RadioButton button = new RadioButton(type);
          buttons.getChildren().add(button);
          toggleGroup.getToggles().add(button);
        }
        toggleGroup.selectedToggleProperty().addListener(
            new ChangeListener() {
              @Override
              public void changed(ObservableValue obs,
                  Toggle oldToggle, Toggle newToggle) {
                final ObservableList items = comboData.get(((RadioButton) newToggle).getText());
                combo.setItems(items);
                combo.getSelectionModel().clearSelection();
                buttonCell.setText(null);
              }
            });
    
        combo.getSelectionModel().selectedIndexProperty().addListener(new ChangeListener() {
              @Override
              public void changed(ObservableValue obs,
                  Number oldValue, Number newValue) {
                System.out.println(newValue);
              }
            });
    
        combo.getSelectionModel().selectedItemProperty().addListener(new ChangeListener() {
              @Override
              public void changed(ObservableValue obs,
                  String oldValue, String newValue) {
                System.out.println(newValue);
              }
            });
    
        VBox root = new VBox(15);
        root.getChildren().addAll(buttons, combo);
        primaryStage.setScene(new Scene(root, 200, 400));
        primaryStage.show();
      }
    
      public static void main(String[] args) {
        launch(args);
      }
    }
    
  • A. SWF call through a drop-down list box.

    Hello
    I do drag a drop-down list box and provide 3 options of January, February and March. I want to see 3 different. SWF files in the page even when I choose one of these options. Please help me to call movies through combo box selection. Here is my code.

    <? XML version = "1.0" encoding = "utf-8"? >
    "" < mx:Application xmlns:mx = ' http://www.adobe.com/2006/mxml ' layout = "absolute" >
    "< mx:ComboBox xmlns:mx = ' http://www.adobe.com/2006/mxml" > "
    < mx:dataProvider >
    < mx:ArrayCollection >
    < mx:String > January < / mx:String >
    < mx:String > February < / mx:String >
    < mx:String > March < / mx:String >
    < / mx:ArrayCollection >
    < / mx:dataProvider >
    < / mx:ComboBox >
    < / mx:Application >

    Thank you

    I store the file name of the SWF in your combo box dataProvider and then when it changes the load the new swf based on what they have chosen. I wrote an example application that does this.


    http://www.Adobe.com/2006/mxml"layout ="absolute">


    Import mx.collections.ArrayCollection;

    [Bindable] private var swfDP:ArrayCollection = new ArrayCollection([)
    {label: 'Pick a month' ", data:" "},
    {label: "January", data: "january.swf"},
    {label: "February", data: "february.swf"},
    ([{label: "March", data: "march.swf"}]);

    private void onComboChange(event:Event):void {}
    => Checks if swf location, if it then loads the new swf.
    (event.currentTarget.selectedItem.data! = "")? Loader.Load (Event.currentTarget.SelectedItem.Data);
    }
    ]]>

    You will need to change the name of your file, except if they really are named january.swf and what not. I hope this helps.

  • Automatically populate a drop-down list by using another selection from the drop-down list box

    New java/preparation forms so I apologize in advance.

    I currently have a menu drop-down box 1 (Occupation) with three options: "enter your own description/blank", retired housewife. When someone chooses either retirement or anyone at home, I would another drop box 2 (employer) to assign automatically "n/a. . The employer drop box has only two options: "enter your own/blank", N/A.

    Far, I could for that box to fill but only when the person clicks in the box (as if they were about to enter their own text.) Then only it will fill the drop-down list "employer." I would like it auto fill once the person has chosen retired, Virgin or stay-at-home woman without having to enter in the box (just using the arrow to the size of the drop-down list box).

    I currently have a key shot that resets the employer box when a person chooses the option vacuum/enter your own option. I then a JavaScript (only for the housewife now) that only works if you click the box of. Key combination works I want to than the other options work as well. If the client settles on white, the choice of the employer updates automatically empty without having to click in the box of. Any help (including general advice to make my code cleaner) is very appreciated!

    Current script of typing:

    If {(event.willCommit)

    If (event.value == "") this.resetForm (["use"]); of other SetFieldValues (event.value);

    }

    The current upward, mice running JavaScript :

    var v = this.getField ("Occupation") .value

    If (v is "Housewife")

    1. this.getField("Employer").value = "N/a".

    I think maybe I should use event.willCommit in my formula, but I'm not sure how to include it.

    Thank you!

    I would not use the key sequence or MouseUp actions for this, but the action post.

    Just make sure that you set the field option to validate the selected value immediately (under Properties - Options) and then use this code as the custom validation script:

    var employerField = this.getField("Employer");
    if (event.value=="Homemaker" || event.value=="Retired")
        employerField.value = "N/A";
    else employerField.value = employerField.defaultValue;
    
  • How to display the drop-down list box in MS excel by using labview report generation toolkit? pleasepost code block diagram?

    How to display the drop-down list box in MS excel by using labview report generation toolkit? Please post the block diagram of the code so that I can able to generate from the drop-down list box in excel with the menu drop-down...

    Like this. (edition, use the reference forms instead of the reference to the worksheet)

    Ben64

  • Using Wizard of the Action to change the font in the drop-down list box

    Acrobat Pro DC on a MAC under OS X 10.11.6

    I have a form that is mainly created in Indesign (it works for us - I know that others prefer to locate forms purely in Acrobat).

    I have a script I can run through the wizard of the Action (run a javascript script) to change the font in all fields in text form. But being a novice script that I can not understand how to create a similar script that will change the font used by drop-down list boxes (created in Indesign). Is it possible by a script?

    I know I can do it manually through the properties, but if someone can give me a pointer to find a way to do it with a script that would be amazing!

    Thank you

    The script can be changed to:

    for (var i = 0; i)< numfields;="" i++)="">

    var f = getField (getNthFieldName (i));

    If (f.type = 'text' | f.type = "combobox") {}

    f.textFont = "Arial";

    f.textSize = "10";

    }

    }

    But now I have to ask, what are your reasons to use Arial instead of Helvetica?

  • Adobe Acrobat 9: Javascript populated the drop-down list box - response selected array will not save

    I have a combo on one of my forms box that is filled with the help of a Javascript array.  The drop-down list box is filling very well, but when an item is selected in this drop-down list box, the selected item does not save when the user saves the document.  Any suggestions as to what is the problem and how it can be corrected?  I am a loss to know where even to start the search.  Any help is greatly appreciated.

    Thank you.

    Lisa

    It seems that the drop-down list box may be getting filled with code that runs when the form is opened. If so, it will overwrite the value selected, whenever it opens. The solution would be to change the code so that it is not than that. If not, you can post the form somewhere so we can take a look?

  • Need help to parse the xml string to populate the drop-down list

    Here is my: problem

    I have a hidden text field that contains the text of an xml

    <>facilities
    < building >
    < name > Building A < / name >
    < name > building B < / name >
    < name > building C < / name >
    < name > building D < / name >
    < name > building E < / name >
    < name > building F < / name >
    < name > building G < / name >
    < name > building H < / name >
    < / build >
    < / facilities >

    My goal is to read this with JavaScript xml string to populate a drop-down list with values of element (name). Does anyone know how script that?

    Attached is a sample .xdp

    See you soon,.

    Jesse

    Here is an example of change. I put the code click on the button, so you can see it in operation... You can place this code in the event that makes sense for you. I also added another field to show the DOM (this is for debugging purposes and you can remove this field if you want).

    Paul

Maybe you are looking for

  • I have the audio voicemail on my iphone 6.  I can change it to Visual Voicemail?

    I have a Straight Talk 6 iphone.  It has audio voicemail.  I had visual voicemail on my Straight Talk iphone 5.  Can I change my audio visual on the iphone 6?

  • site design broke with upgrade to FF 9.0.1

    I am owner of a wiki site that worked completely fine until I installed FF 9.0.1. (http://www.pharmacydrugguide.com) The left column is now pressed to display as text in other sections of the page. The site still looks fine in all other browsers. Can

  • How can I remove Security 2011 Solution

    Hi, if mates here, I have tried many guides from the search engine (free antivirus software) and Security Solution 2011 just couldn't be deleted out of my PC.more tips from you?Thanks for your help.

  • Dell Inspiron 17R does not recognize the cd/dvd drive

    I have a laptop Dell Inspiron 17R and sometimes it does not recognize the cd/dvd drive! I tried to update the drivers with the system after the update, Dell detects the cd/dvd drive appeared in my computer and in Device Manager, but after 20 minutes,

  • Confusion of notifications demo

    I'm new to programming BB while I was looking at the demo of app notifications and I cannot understand how to use it.  What Miss me? I create and launch the Simulator, and then run the app in the Simulator and get the screen of text expected that not