Deleting columns in 2D array

Hello All,
I hope someone can help me. I have come across a hurdle in the programming of my application.
I have an 2D array of 8x20 size. This data I have to show it in a multicolumn listbox. But I don't want to show all the data. From the front panel user will make the selection from the given options, which parameters he wants to display. I have attached the VI in which, from the cluster I sort the true indices and only keeping those parameters I have to delete all other columns. From the size of true indices am creating particular case for handling those parameter.
I have able to create only for size 1. Please find the posted VI and tell me any simple solution to this problem. I have tried searching various array function to sort out this problem.
Am using LabVIEW 2011 professional development.
Thanks & Regards,
Manisha 
Solved!
Go to Solution.
Attachments:
Test.vi ‏49 KB

Hope this helps as a starting point,
regards,
Marco
Attachments:
Test-2.vi ‏15 KB

Similar Messages

  • Excel & ActiveX: Insert arbitrary columns from 2D array and create graph problems

    Hi there,
    I want to insert data from either a 1D or 2D array from LabView into Excel and create graphs.
    I used the information from the following example:
    http://www.ni.com/example/28934/en/
    and was able to create a new Excel file (I'm using Excel 2010), writing data from an 1D array to a column in excel by creating a while loop and using the first element of the array to write it to a specific cell. I use the counter of the loop to write to the next cell when the loop starts over and always delete the first value, which I write to the cell, from the array until it is empty.
    Now I also would like to write a 2D array - so the first column in Excel should be the first column from the array and so. Here I cannot use the loop counter directly as Excel only counts 1,2,... for the rows, but uses A,B,... to count columns. Also I do not know in advance how many columns my 2D array will contain, so creating a lookup table like (A means 1, B means 2,...) is not really an option (except there really is no other way). Is there a possibilty to convert numbers into letters or some way to 'explain' to the program that column 2 in the array means column B in Excel for example, or is there a way to insert new columns?
    I figured out how to add new Worksheets and as I also need to create a certain number of Worksheets and I know that on standard 3 sheets are present when creating the file, I use the 'add' methode to create every new worksheets before worksheet 3 - I could use the same methode to create new columns in Excel, but so far I didn't find a methode to do so. Or is there a way to enter the whole 2D array at once?
    Then I'd like to create a graph (in case of the 1D arrays a bar plot, when using 2D arrays a 3D plot) to view the data. I found this example:
    http://www.ni.com/newsletter/51339/en/
    -> as I do not have the toolkit I'd like to do it using ActiveX directly, so I tried to do things like shown under the headline 'DIY ActiveX/.NET'
    I tried to load the snippet to a new Excel file but got the error message 'microsoft.office.interop.excel.dll not found' and hence the code is not working. That confuses me a little as I would guess when this dll is not present I cannot access Excel from LabView at all, though my understanding of what I'm really doing so far is quiet limited. ;-)
    Also - as far as I understand from the snippet - when creating a new chart object I should be able the create methodes for it, however when I do a right click on the chart object of an ActiveX Worksheet symbol there are none listed.
    To explain my problems better I added a snippet showing my two problems: The inner of the two while loops shows how I import a 1D array. In the outer loop I seperate the columns. I know that currently this is not working as all data end up in column A of the Excel sheet - so I would need to convert the number of the outer counter to A, B,... or find a different solution.
    Moreover on the snippet I placed an ActiveX Worksheet Property with the Chart Object - as I can see the difference to the Chart Object in the example code from the last link above is the color. However I'm not sure what that means and how to change/ solve this.
    And just to make sure - I know this way the VI does not run as the Chart Object is placed completely wrong - I just did it, so it is included in the snippet.
    I'd be thankful for any suggestions,
    Thanks!
    Solved!
    Go to Solution.
    Attachments:
    ExcelAreaScan.png ‏60 KB

    Hello everyone and thanks for the answers.
    I only have the LabView Student Edition available here - is the toolkit included in it too. How can I check if it is installed/ available and in case it is installed - where can I find it?
    Today I had time to take a look at the example
    Create via ActiveX Labview a XY Scatter plot graph on an excel sheet
    It almost does what I want in terms of creating a graph. The only problem I could not fix, is that in this example a sheet is created where only the graph is present. i'd like to add the graph to a previously created worksheet. Today I tried get this working but it seems I stilll don't really understand what I'm doing, I'll post a snippet of my code as soon as I can access the PC with LabView on it again.
    I also took a look at the other example for inserting 2D attays - it seems to be what I need, I just had no time so far to test it, I'll post an update when I could test it.
    Thanks for the help so far!

  • Getting sum of each column in 2D array

    hi,
    i want to get sum of each column from 2D array. i did public static void main(String[] args) {
              double sum=0.0;
                   int[][] arr={
                             {1,2,8},
                             {2,2,3},
                             {2,2,5},
                             {1,2,8},
                             {1,1,9},
                             {2,2}
                   int i=0,j=0;
                   int len=arr.length;
                   while(j!=len){
                        sum=0;
                        for(i=0;i<arr.length;i++){
                        sum+=arr[i][j];
                        System.out.println("sum is:" +sum);
                        j++;
         }but it doesnot work for jagged array...somebody please help!
    thankx                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Stop assuming the rows in your matrix are all the same length. Arrays know how long they are. Use that information to determine if the current column exists in that row.

  • Remove specific row and column from 2d array

    Hi,
    I would like to know how to remove the specific row and column from 2d array.
    for example, I have the original 4x4 array as below
    2 -1 -1 0
    -1 2 0 -1
    -1 -1 2 0
    -1 -1 -1 3
    let say that i want to remove row 2(bold) and column 2(bold), and the new 2d array should get as below
    2 -1 0
    -1 2 -1
    -1 -1 3
    Thanks.

    You can't remove elements of an array, it's fixed at a certain size once created. What you can do however is make a new array and only copy the things you want. Something like:public static void main(String[] args) {
        Integer[][] bar = new Integer[5][5];
        for (int i = 0; i < bar.length; i++) {
            Integer[] baz = bar;
    Arrays.fill(baz, i);
    System.out.println(Arrays.toString(baz));
    Integer[][] muu = new Integer[5][4];
    removeColumn(3, bar, muu);
    for (Integer[] mee : muu) {
    System.out.println(Arrays.toString(mee));
    Integer[][] smuu = new Integer[4][5];
    removeRow(3, bar, smuu);
    for (Integer[] mee : smuu) {
    System.out.println(Arrays.toString(mee));
    public static <T> void removeRow(int row, T[][] a, T[][] result) {
    if (row >= a.length) {
    throw new IllegalArgumentException("no row at " + row);
    for (int a_r = 0, result_r = 0; a_r < a.length; a_r++) {
    if (a_r == row) {
    continue;
    System.arraycopy(a[a_r], 0, result[result_r], 0, a[a_r].length);
    result_r++;
    public static <T> void removeColumn(int col, T[][] a, T[][] result) {
    for (int i = 0; i < a.length; i++) {
    if (col >= a[i].length) {
    throw new IllegalArgumentException("no column at [" + i + ", " + col + "]");
    for (int a_i = 0, r_i = 0; a_i < a[i].length; a_i++) {
    if (a_i == col) {
    continue;
    result[i][r_i] = a[i][a_i];
    r_i++;

  • Remove Enable, Disable and Delete columns from searchUser.do

    Hello,
    What jsp form do I need to modify to remove the enable, disable and delete columns from the searchUser.do page? I edited tjspSearchUserResultsTiles.jsp but that didn't seem to do it.
    Thanks

    Hi,
    TableGenerator.jsp is the general jsp so you shouldn't modify it.You need to extend tcSearchUserAction.java class aand create a custom class.You need to over ride populateColumnHeadings and populateTableData.
    I won't suggest this approach until you are very much familiar with struts development and oim classes.
    Regards
    Nitesh

  • Delete duplicate in a array

    hello,
    i'm a student and i want to know how to delete duplicate in an array.
    I explain i have an array and i want to delete all the value which appears more than one time.
    you can see an exanple in attachment, with some explanation.
    i use labview 8.5, and if someone can help it will be great.
    And escuse me for my english, i'm french and i don't speak english very well.
    Solved!
    Go to Solution.
    Attachments:
    array.png ‏28 KB
    arrayok.png ‏29 KB

    Here is a 2D version. You will have to keep in mind if one array is longer than the other that the array will automaticlly add zero to the array to make it the same length.
    Tim
    Johnson Controls
    Holland Michigan
    Attachments:
    delete duplicates 2D.vi ‏12 KB

  • Insert element in selected column of 2d array

    Hello
         How to insert value in selected column of an array
    In my program i am reading the CAN data from channels using
    CAN read Channel API, the recent data read from the CAN channels
    will be displayed in the indicator "Channel Data" 1D array, the
    size of array depends on the number of channel selected for
    monitor. i want to save all channel data.
    i want to insert the first element of "Channel Data" array to
    first column of "All Channel Data" 2D array, the second element
    to the second column of 2D array...
    i attached my VI
    how to do this give me an idea.
    thanks
    sk
    I am using LabVIEW 7.1
    Attachments:
    err2.zip ‏89 KB

    For 2D arrays, you must insert entire rows or columns at one time.  You cannot insert just one element.  Why?  Lets say for example you have a 2 x 3 array (2 rows with 3 columns).  If you insert an element in row 3 (a new row) column 1, what goes into columns 2 and 3?  You just messed up the integrity of the array, and Labview doesn't allow that.  What you need to do is gather data for all columns in the new row and insert the entire row.  The Insert Into Array function is used with the row number wired to Row Index and nothing wired to column index.  You can gather all your data, build a 1D array and insert that array into a new row in the 2D array.
    - tbob
    Inventor of the WORM Global

  • Retain field order on form when adding/deleting columns

    If I move my html around to change the layout of the fields on an AddForm.aspx and then I start adding and deleting columns, the ordering of the ff## changes and I can have problems. 
    Its fine if I've only added new columns...what I've done is create an AddForm1.aspx to get the fresh ff##'s at the end of the list.  I copy them over to my AddForm.aspx
    If I add and delete columns, then I can have problems.
    The ff## may be renumbered when making an AddForm1.aspx and copying the new fields might create an error because of dupe ff##'s.
    If I use AddForm1.aspx,  I lose my layout of the fields on my form AddForm.aspx.
    I have been successful finding the ordering of the columns on AddForm1 and renumbering on AddForm.
    But this is pain and error-prone.
    What do people do to get around this dilema?
    thx
    Rich

    Hi,
    By default, we can change the order at the Lists content type settings page.
    I suggest you provide more information about your requirement(screenshot) to make others easier to find a solution for you.
    More information:
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/31a5030b-9494-4057-b4ad-485435fdceb0/sharepoint-designer-2010-reorder-fields-for-newform-edifform-viewform?forum=sharepointgeneralprevious
    http://kalsing.blogspot.com/2006/11/create-custom-list-form-for-sharepoint.html
    Thanks,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Dennis Guo
    TechNet Community Support

  • Insert columns of one array into another

    how can one insert columns of an array into another array at every odd place of that array in which insertions are to be made? In short, columns of one array to be inserted into another array bt possibly in between the already initialised array. 
    Solved!
    Go to Solution.

    here's an example, feel free to ask question if it's not clear for you.
    hope it helps
    When my feet touch the ground each morning the devil thinks "bloody hell... He's up again!"
    Attachments:
    insert.vi ‏20 KB

  • How to perform delete operation on Delete Column In Advance Table?

    Hi All,
    I have to add a delete column in seeded page(Advance table).
    For that I have followed jdev tutorial.Now after clicking delete image the column is not deleting also it is not throwing any error except mine.
    Please Help.
    Regards,
    SHD

    Hi AJ,
    In the seeded table there is a seeded column correct.Where it is using above parameter.But while I am using same parameter it is doing nothing.
    For deleting is it necessary to extend VO or EO?
    Here is my code in pfr
                                    String recordNumber = pageContext.getParameter("record");
                                    OAException mainMessage =
                                    new OAException("Are you sure you want to delete this employee"+recordNumber);
                                    OADialogPage dialogPage =
                                        new OADialogPage(OAException.WARNING, mainMessage, null, "",
                                    String yes = pageContext.getMessage("AK", "FWK_TBX_T_YES", null);
                                    String no = pageContext.getMessage("AK", "FWK_TBX_T_NO", null);
                                    dialogPage.setOkButtonItemName("DeleteYesButton");
                                    dialogPage.setOkButtonToPost(true);
                                    dialogPage.setNoButtonToPost(true);
                                    dialogPage.setPostToCallingPage(true);
                                    dialogPage.setOkButtonLabel(yes);
                                    dialogPage.setNoButtonLabel(no);
                                    java.util.Hashtable formParams = new java.util.Hashtable(1);
                                    formParams.put("compElementId", recordNumber);
                                    dialogPage.setFormParameters(formParams);
                                    pageContext.redirectToDialogPage(dialogPage);
                                } else if (pageContext.getParameter("DeleteYesButton") != null) {
                                    String recordNumber = pageContext.getParameter("record");
                                    Serializable[] parameters = { recordNumber };
                                    OAApplicationModule am = pageContext.getRootApplicationModule();
                                    OAApplicationModule compElementAM = (OAApplicationModule)am.findApplicationModule("xxCompElementsAM");
                                    if(compElementAM==null) {
                                        compElementAM=(OAApplicationModule)am.createApplicationModule("xxCompElementsAM","xxmycompany.oracle.apps.per.selfservice.competency.profile.server.xxCompElementsAM");
                                    compElementAM.invokeMethod("deleteRecord", parameters);
                                    MessageToken[] tokens =
                                    { new MessageToken("compElementId", recordNumber) };
                                    OAException message =
                                    new OAException("Are you sure you want to delete this employee"+recordNumber);
                                    pageContext.putDialogMessage(message); regards,SHD
    Edited by: SHD on May 6, 2011 3:31 AM

  • How to delete columns from a 2D array

    Hi guys,
    I read a matrix from a text file and I want to delete the first and last columns of the matrix. I've been trying to do it with delete from an array function but it doesn't do it the way I want. Any suggestions?

    Keep in mind that by default, 2-D LabVIEW arrays are row-based. So though you might be thinking that the first indexing input for the 'index array' primitive is for columns, it is actually for rows. You can either select the second input for the 'index array', or, if you are like me and think better in columns, you can transpose the array before you operate on it. I recommend getting used to the order of the inputs for the array tools and forcing yourself into the LabVIEW convention, as it gets complicated if you need to invert an array before you operate on it, and then again after so that the array returns to row-centric order, which is what all the rest of the LV array tools are expecting
    Good luck!
    Wes Ramm, Cyth UK
    CLD, CPLI

  • Delete column in a datagrid

    Hi All,
    I was trying to delete a column in the data grid .
    Explanation : The data grid has 16 columns filled with data
    , when a specific column is selected and the "delete button(this
    button is under the datagrid) is clicked I should be able to delete
    the column , and the subsequent columns should move to the left
    (for example : if I select column 7 and click delete button ,
    column 7 should be deleted and column 8 should move left in place
    of the column 7).
    Can anybody please help me on this issue.
    thanks

    "rtalton" <[email protected]> wrote in
    message
    news:gh68h2$8c9$[email protected]..
    > You'll need to read up on the ArrayCollection methods in
    the help docs
    > (getItemAt, removeItemAt, etc.) and decide what works
    best for you
    > scenario.
    I think you'd have to loop through the array collection and
    remove that
    property off all the objects, assuming it's a dynamic object.

  • Combine Columns From Separate Arrays Into One Formatted Table

    What I'm trying to do is make two WMI queries with 2 different classes for a list of machines and then patch the columns together into one single array that is formatted as a table with columns and rows. I seem to keep banging my head against the wall and
    I can't help but feel that the answer is simple. I can certainly create an array that contains all 3 columns (such as in the commented out part) but no matter which angle I go at it, it always seems to end up as all the data in one single row in each column
    rather than a nicely formatted table. I've even tried constructing separate custom objects and adding the different objects to the array but that's obviously not working. Below is the code of the last thing I tried. I need someone to bash it to death and tell
    me the (most likely obvious) thing that I'm doing wrong. Thanks!
    $failedos = @()
    $failedcs = @()
    $ccs = get-adcomputer -property operatingsystem -filter {name -like "*-CC*"} | select name | sort name
    $cs = foreach ($cc in $ccs){$cc.name | % {if ($c=get-wmiobject -computername $cc.name -class win32_computersystem -ErrorAction SilentlyContinue){$c | select @{Name="Name";Expression={$_.Name}}, @{Name="Model";Expression={$_.Model}}} else {$failedcs += "$_"}}}
    $os = foreach ($cc in $ccs){$cc.name | % {if ($o=get-wmiobject -computername $cc.name -class win32_operatingsystem -ErrorAction SilentlyContinue){$o | select @{Name="OperatingSystem";Expression={$_.caption}}} else {$failedos += "$_"}}}
    #[array]$osprops = @{'Name'=$cs.Name;'Model'=$cs.Model;'OperatingSystem'=$os.OperatingSystem}
    $result = @()
    Foreach ($Line in $cs) {
    $MyCustomObject = New-Object -TypeName PSObject
    Add-Member -InputObject $MyCustomObject -MemberType NoteProperty -Name "Name" -Value $Line.name -Force
    Add-Member -InputObject $MyCustomObject -MemberType NoteProperty -Name "Model" -Value $Line.Model -Force
    $result += $MyCustomObject
    foreach ($Line2 in $os) {
    $MyCustomObject2 = New-Object -TypeName PSObject
    Add-Member -InputObject $MyCustomObject2 -MemberType NoteProperty -Name "OperatingSystem" -Value $Line2.OperatingSystem -Force
    $result += $MyCustomObject2

    Any help?
    $ccs = get-adcomputer -property operatingsystem -filter {name -like "*-CC*"} |
    select -ExpandProperty name | sort
    $Result =
    Foreach ($CC in $CCs)
    $Object =
    New-Object PSObject -Property @{ Name = $CC
    Model = 'Failed'
    OperatingSystem = 'Failed'
    Try {
    $Object.Model =
    get-wmiobject -computername $CC -class win32_computersystem -ErrorAction Stop |
    select -ExpandProperty Model
    $Object.OperatingSystem =
    get-wmiobject -computername $CC -class win32_operatingsystem -ErrorAction Stop |
    select -ExpandProperty Caption
    Catch{}
    Finally { $Object }
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

  • Working in MUD: after deleting column whole table gets lost

    Good morning community,
    we do have a problem with the obiee admin tool.
    we just migrated to version 11.1.1.6.6.
    Now a colleague of mine worked with the MUD. He checked out the RPD-file and wanted to delete a column from a table within the presentation layer. Then he checked in this change again. He Uploaded the file to the server and everything is working fine.
    Now the problem:
    When he checked it out again, he saw that the full table was "deleted", but not only in the presentation layer, also in the business modell and the physical layer.
    He opened the RPD file locally and there everything was okay.
    Our first idea that the admin tool lost the link of these tables to the project couldn't be confirmed.
    So we are asking you :-)
    Maybe someone of you had this problem too and can explain how he solved it.
    Thank you and have nice day,
    Sven

    Hi Sven,
    Then he checked in this change again. He Uploaded the file to the server and everything is working fine.It should not be the case please confirm below
    1. Uploaded means ? directly moved to MUD server instead of doing checking or from MUD to system where BI installed (NQSconfig.ini) ?
    2. I'm sure he deleted the table instead of column (track it from MUD History in file option -->)
    3. Link will break when (Tables in BMM & Physical ) a fact table is deleted so automatically associated dims will go off
    4. Get the latest version . XXX (from MUD server) then change it to .rpd and deploy to get rid of issue
    thanks,
    Saichand

  • How to delete rows from 2D array in this case...

    Hello. I'm just begging adventure with labview so please for patient. I created a program whitch suppose work in following way:
    2D Input array is array created by FOLDER BROWSING subVI. It works in this way,that browse folder and looking for txt files whose contanins measurment data. In my case subVI founds 4 files,and from theirs headers read information about what kind of data are in file also their's path. In this way is created 2D Input Array. subVI named PLOTS FROM PATHS ARRAY make picture with polar/XY plot. It's create only those plots and legends on one picture as many files(their paths) is setted to the program by output array. I made this subVI in that way and I would not like to change it. 
    My problem is that in even loop (witch check for any change by user) program suppose to relay anly those rows(files) for which checkbox are marked, e.g. marking anly 1 and 4 box, program should chose from input array row 1 and 4 only and pass them to output array,then  PLOTS FROM PATHS ARRAY subVI makes a picture only with 1 and 4 plot and legend only for plot 1 and 4. The best solution would be some relay witch is avtivated by logical signal. It lost to me ideas how to solve it, I'm just in blaind corner...
    I tried to use delete from array but I don't know how to do use it properly in this program,becease it can be only before or afeter for loop. Below is scan of front panel and also main problem. Please set me up somehow to solve this problem. 
    Regards 
    Solved!
    Go to Solution.
    Attachments:
    plots selector.vi ‏17 KB
    problem.PNG ‏18 KB

    I have attached a vi. Is this the one that you need?
    Anand kumar SP
    Senior Project Engineer
    Soliton Technologies Pvt Ltd
    Attachments:
    plot selector modified.vi ‏14 KB

Maybe you are looking for

  • How to replace an App purchased by another Apple ID?

    There is a free app purchased from an abondoned Apple ID while other apps are from the current Apple ID.  So, I want to download the free app again with the current Apple ID.  But there are data with the app, so deleting it and download again means t

  • Free of Cost   sales  error during billing

    Dear all, i am facing the problem while doing Free of Cost sales  ,   i have created a seperate document order type for FOC  with the sd document category  as  "C" and  and  doc prcing porcedure  as "C"  .  and in billing document   i have also inclu

  • Setting up new computer, eliminating Parallels and VM

    My late 2007 MacBook pro (OS X 10.5.8) has a virtual WIndows XP machine using Parallels.  It came with iLife software and is backed up to an external hard drive using Time Machine.   It's losing some functionality (optical drive, keyboard) so I bough

  • Help please on Jvm

    I had downloaded two books called java virtual machine specification 1st edition and second edition for the following purposes: i want to create my own virtual machine to run on AVR microcontrollers or minicomputers according to their instruction set

  • Lost settings of SQL Developer

    Hi Buddies; I'm using SQL Developer, and inadvertently, I changed the configuration. By this, I mean, initially when I enter to SQLDeveloper I got the window with the conections at the left, and at teh right i got the windows to execute queries or to