3D table organization fomr a 1 d array in a for loop

Hello-

I am currently using a program OR opening multiple files (http://zone.ni.com/devzone/cda/epd/p/id/818). As a side note, I noticed that the files are automatically organized by name once records are returned from the Subvi. Will be called BxCy where x is a number and y is a number to two digits (e.g., B2C34) and within each file, I load a 1 d table which I extracted the files, I am loading.

I want to do is organize the output so it has the structure of

Page C1

Line B1 [(table 1 d)]

Line B2 [(table 1 d)]

...

Line Bn [(table 1 d)]

Page C2

Line B1 [(table 1 d)]

Line B2 [(table 1 d)]

...

Line Bn [(table 1 d)]

and so on.

My first question is that I'm not 100% sure that the file names will be organised by name in the lu multi-fichier VI so is there someone who can check it out? Second, even with what I would like to know if there are effective methods to achieve this. Should I just use two tables index to classify based on their number of anc C B? This seems to slow down and I saw on other positions the function array reshape could speed up the process but I'm not sure how to proceed. I don't have access to the structures of inplace (I don't know if I just forgot to install this module, or if it was not included in my subscription LabVIEW).

The program that I joined is in LabVIEW 2009 SP1 and I'm on a Windows 7 64-bit machine.

Thank you in advance!

J

  • You did not include the subVIs. Please do.
  • Never convert a path to a string, unless you do something specific OS. Use 'strip path' work on the name of the file as strings, then convert back to a path using "build path" if necessary.
  • To create a 3D tables 1 d array, you need two stacked FOR loops. Pages in the loop external and rows in the inner loop and outoindex in the output in loop tunnels. You will automatically get a 3D Board.
  • It might be much easier to use the "list of files" with a motif of "B * C *" for example. Is the number of the page always 1 and the numbers of two line numbers (padded with a zero not significant as appropriate)? In this case the sorting will be correct.

Tags: NI Software

Similar Questions

  • Extraction of 2 x 2 table from 10 x 10 array using only for loops

    Hi all

    I have this assignment for "pattern matching" - user enters the Boolean model 2 x 2, and I have to compare and find in the bigger picture of Boolean random 10 x 10.
    I managed to do it with the table palette, but my instructor alert me that for this mission we prohibit this Palace and don't use the "basic" functions
    So I'm trying to track my solution and accurate table 2 x 2 from the big picture, but I fall into the "well-known" problem with loops like I can see while searching in google - I want the loop will depart from different 'i', this allows to extract all tables to another place of the largest array iteration 2 x 2.

    any help is appreciated,


  • CURSOR for loops or an associative array

    I just want to know the advantages and disadvantages of the CURSOR for loops. As a general rule, what guys do you prefer: associative array with CURSOR for loops?


    If you use the CURSOR for loop, is it not difficult to debug?

    PL/SQL Developer, I do not see what values are stored in the CURSOR for loop (in SP master_proc below) as
    There are no variables to watch. Not sure if the TOAD can show these values

    If I had used an associative array (master_proc2 below), I can see the values stored in the table by clicking on "show Collection"variable in PL/SQL developer.




    create table emp2 as select * from emp;
    
    
    create or replace procedure my_proc(p_empno in number)
    as
    begin
    update emp2 set sal=sal+100 where empno=p_empno;
    end;
    /
    
    --Using CURSOR FOR loop
    
    create or replace procedure master_proc
    as
    begin
         for rec in (select empno from emp2 where empno>7700)
         loop
              my_proc (rec.empno);
         end loop;
    end;
    /
    
    -- Using Associative arrays
    create or replace procedure master_proc2
    as
    type v_empno_type is table of number index by pls_integer;
    v_empno v_empno_type;
    
    begin
    select empno bulk collect into v_empno from emp2 where empno>7700;
    
    for i in 1..v_empno.count
     loop
        my_proc (v_empno(i));
     end loop;
    end;
    /

    VitaminD wrote:
    Thank you Tubby. If you are faced with a situation where you MUST use a loop. Then you would go to associative arrays rather than CURSOR FOR loops. Right?

    Doesn't happen too often, but if/when then I would do as I said in my first post. Use the transformation, the collection table in BULK and FORALLs.

    If we use your example posted, I would NOT spend a single table (in a loop mode) value I would be transmitted in the OVERALL picture and treat it with FORALL.

    So, I would still use neither of the approaches that you mentioned.

  • Table 2D cluster table how insert table 2d of strings in an array of cluster?

    I have a cluster with 4 channel 3 elements of the string constants and 1 is a list box drop-down chain.

    I can save the Bay of cluster to deposit without any problem.

    Now, I want to read the file is saved in the Bay of cluster.

    How can I insert a table 2d of strings into an array of cluster?

    rcard53762 wrote:

    I have a cluster with 4 channel 3 elements of the string constants and 1 is a list box drop-down chain.

    I can save the Bay of cluster to deposit without any problem.

    Now, I want to read the file is saved in the Bay of cluster.

    How can I insert a table 2d of strings into an array of cluster?

    It would be useful to have an example of what real cluster Bay look like the typical data. One way to do is by saving the content of the table cluster in a configuration file (.ini extension) and then use the OpenG screws of the Variant Configuration file to store and retrieve data from the configuration file. You can get these screws in the VI package manager.

    Here is an example. The generated configuration file is also attached.

    Ben64

  • Combine two tables 1 d in a 2D array

    Hi all

    Maybe I forget what is obvious, but I can't find a solution to combine two tables 1 d in a 2D array AND (it is the impossible part for me) using the tables columns instead of lines.

    Example:

    Table 1:1, 2, 3, 4

    Table 2:5, 6, 7, 8

    Result: 1, 5

    2, 6

    3, 7

    4, 8

    The 'build array' function seems to add all tables as lines... I guess I could transpose the table, but I want it runs in a Subvi in constructions of different loop and I feel a little uncomfortable with it - I guess one would be left with a completely mixed table. I was maybe blind just to find the right function?

    Cheers, Jessi

    Hi Jessi,

    by default, LV is combining tables in rows. So when you need columns you must transpose the sets or use a different indexing scheme...

  • Creating tables in a nested for loop

    Hi all.

    I was stuck in this problem for quite a while now and I still don't know how to continue. Some outside the entrance would be greatly appreciated!

    I'm doing the following:

    -Take an array of numbers, to check if they are within a certain range (e.g. between 2 and 4)

    -Build two new arrays: one with all the numbers that are inside the beach and the other with the rest.

    An additional condition is that the amount and value of the range conditions will change (for example, it could be between 2 and 4 only / 2, 4 AND 6 and 7 according to the entry)

    To treat this, I created two nested for loops - one that goes on a table that contains conditions of the beach and inside that actually go and check if the values are in the range. I think I did that part successfully, but the next part is confusing to me - how to actually create the tables separated within two loops for?

    My apologies if I did not explain it well. Another method to support this problem is I want to translate following LabVIEW:

    Ranges of table / / [1 5 7 10] exodus-> This means we want to divide numbers based on those who are in (1,2) and (4.5) against those who are not

    Table of values / / [2 3 6 11 3]

    EndOperationDelegate table / / array of values within the range
    Table outValues / / Array of values out of range

    for m = 1:size (ranges)

    for n = 1:size (values)
    If (THE NUMBER IS on the INSIDE of EACH RANGE)
    EndOperationDelegate = [EndOperationDelegate NEWNUMBER]
    on the other
    outValues = [outValues NEWNUMBER]
    end

    end
    end

    Sounds easy enough, but it gets so chaotic with Labview that I don't know what to do. I have attached a reference image - insertion in the array function is not in fact add to the table, it creates a new table. How can I save that for when the nested for the ends of the loop?

    I have seen a few examples with shift registers which lie in a loop and I couldn't successfully that transfers in my block diagram.

    Any help/direction would be greatly appreciated.

    Hello!

    See the following example to understand how you can create a table in the loop For

    In your case, you also can uce conditional terminal to create a table only when then located nearby. It makes the code much cleaner that the structures of the case

    Hope this helps, if not, let me know if I can help you!

    Marcin

  • Parallel for loop 2D table

    Hello

    I don't have any experience with parallel for loops, so I need your help.

    Goal: To do a calculation (average, average) on the rows (or columns) table 2D as quickly as possible. The calculations are independent of each other and I would get a table 1 d with the results.

    I read a few posts on parallel for loops and I would like to find an example for my trivial problem, but I can't.

    Could you help me, it is possible is improve it the effectiveness of the calculation on lines with parallelism in LabVIEW? and it is, could you post an example how to do?

    Thank you

    If the speed issues, do not write your own "average." First of all, it already is in the range of statistics, but then you must be inline your average VI or do the calculation explicitly (as shown below). the size of the array never changes for the duration of the loop, it seems redundant to get the size of the array on each iteration.

    Here's what you could do.

    On my bench, it's much faster than the use of 'mean.vi' of the palette. Average a overhead, Subvi (1) (2) needs to get N with each call and (3) is also an unnecessary error checking.

    (Sorry, I have 32 processors, so the number of instances is set a little high. Modify if needed).

  • How to set a variable in a table to grid 'for' loop

    I'm afraid I'm stuck again!

    The next step in the animation I'm working on, is to set up a Boolean value, 'pierced = false', so that all instances of the attachMovie ("openCircle") have a Boolean "drilled = false' associated with them." Then when someone clicks on one of the instances of the attachMovie ("openCircle"), the Boolean value becomes "pierced = true', but only for that instance was clicked."

    What I've done is to set the (Boolean) variable (highlighted in bold below) in the two 'for' loops through the table in the grid, but it returns an undefined value. Do I need to configure a separate table? (see code below):-

    set up the grid for solid table

    spacing: var number = 5.75;

    Var CDL: number = 20; the number of columns in the grid

    var rows: number = 20; number of grid lines

    var leftMargin:Number = 154;

    var topMargin:Number = 169;

    depth: var number = 100; starting point for the depth

    var drilled: Boolean;

    for (i = 1; I < = lines; i ++) {}

    for (j = 1; j < = cols; j ++) {}

    drilled [rows, cols] = false;

    trace (drilled);

    current = attachMovie ("openCircle_mc", "openCircle_mc" + i + "_" + j, depth ++);

    Current._x = leftMargin + ((i-1) * (spacing + current._width));

    Current._y = topMargin + ((j-1) * (spacing + current._height));

    Current.Row = i;

    Current.Col = j;

    Current.Oil = Math.floor (Math.random () * 1.1);  about 1/10 objects have oil = 1, 9/10 oil = 0

    Open the circle initially invisible, visible on rollover

    Current._alpha = 0;

    {current.onRelease = function ()}

    trace (this.row + "" + this.col);

    current.drilled = true;

    }

    current.onRollOver = function() {}

    This ._alpha = 100;

    }

    current.onRollOut = function() {}

    This ._alpha = 0;

    }

    }

    }

    I would be grateful for any help. Thank you.

    Then, create a two dimension table named drilled so that it exists when you try to fill...

    var drilled: Array = new Array (new Array();

    There might be a problem that you're missing setting the values of the [0, #] components of the table - paintings begin with an index of 0.

  • That the face is lit mode bedside table may be shortened? He remains too bright for too long

    That the face is lit mode bedside table may be shortened? He remains too bright for too long.

    Hello

    No, it is not currently possible to customize the duration for which the screen remains lit mode bedside table.

    If you want to send feedback or feature requests to Apple, you can do so here:

    https://www.Apple.com/feedback/watch.html

  • For loop creates 1 d data table

    Hello, I am building the circuit below, and I'm running into a lot of problems with the loop, creating a table 1 d of data from certain types of data such as the ERROR OUT and the VISA NAME of RESOURCE. I understand why it does this, but I only need the last value in the table (the value of the last iteration of the loop for). This is true for me for the error, resource name of visa, and I was thinking of using the Boolean value that indicates when the for loop.

    Is there a simple way to extract the last value in the table 1-D so that it is correct to pass along trails, VISA and ERROR type?

    You actually create a block diagram, not a circuit.  A circuit is an electrical system including devices and wires.

    If you right-click on the tunnel and choose disable indexing, then you get the value of the last iteration rather than a 1 d table.

    I recommend you watch the LabVIEW tutorials online
    LabVIEW Introduction course - 3 hours
    LabVIEW Introduction course - 6 hours

  • Combining 2D arrays which are FOR output in another 2D array LOOP?

    Each iteration of my table of gererates a 2D of loop, with two columns, several rows, same positions

    Iteration1 Interation2 Iteration3 etc.

    A     B               A     B                A      B

    1      2               3      4                5       6

    7      8                                         9      10

    Desired output:

    A AND B

    1 2

    7 8

    3 4

    5 6

    9 10

    I have tried to put the table to build inside the loop, the loop, played with cancatenate and add options and try to thread

    the result of each iteration of the for loop with auto-index out tunnel enabled (obtain table 3D ). Nothing seems to give me

    what I want. I must be missing something simple. Can you please help? Note that the headers A, B will appear once in the desired direction

    output and data are cancatenated.

    Just a side: each iteration is data read from an Excel sheet. I have several sheets of Excel spreadsheets in a local drive, tested each containing data of a part.

    My goal is to combine data from these Excel spreadsheets and put them in a data file and download them in an equal of Oracle for data mining.

    I'm going on this problem the right way? Should I combine all the data first and then load them in Oracle, or should I download a file to

    a time? I have database connectivity Kit. BTW, when you asnwer the questions, please remember to solve my original problem also

    Thanks again!

    Thank you. I think that should solve my problem.

  • I want to loop through the data from two different tables using for loop where the query should be replaced at runtime, please help me

    I have the data into two table with the structure of similar column, I want to loop through the data in these two tables

    based on some condition and runtime that I want to put the query in loop for example, the example is given, please help me

    create table ab (a number, b varchar2 (20));

    Insert into ab

    Select rownum, rownum. "" sample "

    of the double

    connect by level < = 10

    create table bc (a number, b varchar2 (20));

    Insert into BC.

    Select rownum + 1, rownum + 1 | "" sample "

    of the double

    connect by level < = 10

    declare

    l_statement varchar2 (2000);

    Boolean bool;

    Start

    bool: = true;

    If it is true, then

    l_statement: =' select * ab ';

    on the other

    l_statement: =' select * from bc';

    end if

    I'm in execute immediate l_statement - something like that, but I don't know

    loop

    dbms_output.put_line (i.a);

    end loop;

    end;

    Something like that, but this isn't a peace of the code work.

    Try this and adapt according to your needs:

    declare

    l_statement varchar2 (2000);

    c SYS_REFCURSOR;

    l_a number;

    l_b varchar2 (20);

    Boolean bool;

    Start

    bool: = true;

    If it is true, then

    l_statement: = "select a, b, AB;

    on the other

    l_statement: = "select a, b from bc;

    end if;

    --

    Open c for l_statement;

    --

    loop

    extract the c in l_a, l_b;

    When the output c % notfound;

    dbms_output.put_line (l_a |') -' || l_b);

    end loop;

    close c;

    end;

    /

  • Oracle Business Rule - Table of decision for loop

    Hi Experts,

    I have the scenario where I get the list of values, and I don't have to iterate over the values in the decision table. I can't use the normal return If so , in reason of the restriction of customer "only use table decision." Can someone guide me how to use the for loop in the decision table?

    Thank you

    We can check multiple values of the same element in the decision table. so no need to make a loop.

  • Create arrays of ETL for Siebel

    The script that I have generated some ODI Studio for creating tables ETL in Siebel includes this DDL:

    CREATE TABLE SIEBEL. () S_ETL_INDUS_VER

    INDUST_SIC VARCHAR2 (30 CHAR) NOT NULL,

    NON-NULL, VERTICAL VARCHAR2 (30 CHAR)

    CDC$ _SRC_LAST_UPDATE_DATE TIMESTAMP NOT NULL,

    CDC$ _RPL_LAST_UPDATE_DATE TIMESTAMP NOT NULL,

    CDC$ _DML_CODE VARCHAR2 (1 CHAR) NOT NULL

    )

    ;

    However this table already exists in my DB Siebel 8.1.1.11 as follows:

    Name                                      Null?    Type

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

    INDUST_SIC NOT NULL VARCHAR2 (30 CHAR)

    VERTICAL VARCHAR2 (30 CHAR) NOT NULL

    So I'll need to add additional columns in the existing SIEBEL. Table S_ETL_INDUS_VER. I will use today's date for Last_update_date columns as default. However, what value should I use for CDC$ _DML_CODE?

    I thought about it - 'I', 'U', or '

  • Array.Length in a for loop

    Here's the debate. I like to use array.length in my loop for to keep my own to read code. Is there a huge drawback of this? For example it will speed up things greatly if I store the length in a var once?

    Thanks for any idea!

    Math is eloquent.

    Instead of variable length is more than 20 times faster. So, in conclusion, is without doubt, as the variable setting for the length of the array and then use it in a loop are the way to go, especially on large iterations.

    Here's a comparison test:

    Without duration:

    var st:Number = getTimer();
    for (var i:int = 0; i < 1000000; i++ ) {
    }
    trace(getTimer() - st);
    

    Trace returns something around 12 SC

    With the length of the array:

    var array:Array = [];
    for (var j:int = 0; j < 1000000; j++)
    {
         array.push(1);
    }
    var st:Number = getTimer();
    for (var i:int = 0; i < array.length; i++)
    {
    
    }
    trace(getTimer() - st);
    

    Trace returns approximately 220-224 ms

    This is a clear confirmation of what to use.

Maybe you are looking for