Subset of the table

If this isn't really a specific problem of labVIEW, more a problem with my mind does not not as a true programmer to find a solution to a (problem probably straight forward).

I want to process some data (table of numeric values). The data table is replaced each time new data is available, I have this simulated a little in the attached VI. Now here's the tricky part. The processing window is selected by the user. So if the length of the Strip is 5 elements and the user selects a 7 processing window, the table of the first iteration should be stored (this is not hard using a registry of lag...) and the first 2 elements of the table on the second iteration will be added to the table in the first iteration, then the processing will be done on the data.

I hope this makes sense, I have attached a VI of a terrible effort for a solution on my part, but I tried a few different ways in this regard and am getting nowhere nearby. I'm sure that registers to shift and/or nodes size table and deal structures, comments should be the main elements.

Let me know if you need more information.

In the consumption loop, starts with a shift register that contains a table.  Whenever new data are attached at the beginning of the table.  Then iterate over subsets of the table until the length of the array is less than the size of treatment.  See picture attached (similar to the approach posted by stevem181, his answer appeared while I was working on it).

Tags: NI Software

Similar Questions

  • The doc for the function of the subset of the table shows the extensible function

    In LabView 2010 the doc for the function of the subset of the table shows that the function is expandable with indexes and multiple lengths. I can't expand the function for multiple indexes. How can I do this?

    Is the documentation for the function by mistake, or is there another function of a subset of the table somewhere that can do this?

    Subset of table details

    When wire you an array to the function, the function is automatically resized to display entries index for each dimension of the array. If wire you a table 1 d to the function, the function displays the index for an item entries. If wire you a 2D to function, the function table displays the entries index for a line and column, respectively. If wire you a 3D through the nD to the function, the function displays the index for a page entries.

  • Registry update problem with the subset of the table replace

    Hi all

    I'm trying to make a graph of intensity which shows the voltage on each electrode in an array of 64-electrode (giving a grid of 8 x 8) and I'm running into some problems (probably because I'm pretty much a newbie of labview).

    To make this graph, I have a table 1 d with 64 elements, that I need to put in the right place on the graph, so that the chart reflect the actual disposal of the table.
    So I'm writing each of the 1 d array elements at a specific location in a 2D array. I use the function replace table subset and a shift to that register in a loop that has need of an iteration for each element/electrode. However, for some reason, the loop only runs once.

    I use a dummy much smaller range (9 items 1 d in a 3 x 3 array) to get this thing working in the joint, vi, but I guess that the principle should be the same.

    I don't know I'm missing something stupid enough, but I can't understand what

    Susan

    ETA: with how I define the axes x and y now, I suppose a table simple reshape could operate. But, unfortunately, the actual data are too messy for that.

    You have a table 1 d of 8 elements.  Then integrate you into a 2D array which has 8 columns 1 line.  Then you autoindex to the for loop that autoindexes in lines.  Since you have only 1 row, it will be only to go 1 time.

    Your Index table inside with the wired i until the index equals autoindexing.  Eliminate these tables to Index, eliminating the Build table goes from 1-D 2 - D.  Let the autoindex loop on the table 1 d.

  • Write to the table, adding additional rows in the csv file

    Hi all

    I created a program that measure current over time.  It works well, but when I write to the spreadsheet, there are additional lines between the row of data.

    I've created a header file, which is passed into the while loop where the data entered in a table and then entered in the worksheet.  If I simply display the table, there is no additional lines, but when I open the file csv in excel, there are more lines.  I'm pretty new to labview, but everything works the way I want to (it's a simple program) apart from that.

    There is a trolley or jump back in your chain of row data.  You can get rid of that by adding a "trim whitespace" function between the function of "visa read" and "replace the subset of the table.

  • export by programming a zone selected the table in an array of strings

    I am able to select an area of a table programmatically using selstart and property nodes selsize, but once I have selected area I can't export the data into an array of strings. proven value property node. Returns all of the data, not the data, I am interested in. help very much appreciated.

    Hi eword.

    You can use "Subset of the table" to get the part you're looking for.

    Mike

  • Build/update dynamically the table 3D

    Hi all

    I'm having a problem with the dynamic generation of a 3D of the following set of data table:

    x: {1,2,3,4,5}

    y: {1,2,3,4,5}

    Z_1: {1,2,3,4,5}

    Z_2: {1,2,3,4,5}

    Z_3: {1,2,3,4,5}

    Z_4: {1,2,3,4,5}

    Z_5: {1,2,3,4,5}

    where there is (5) Z amplitudes associated with each measurement location.  What I am able to statically (from the above values x and y tables 1 d and 2D table Z) is to create a 3D Board made up of x and is indexed intensity to the graphic format of the 2D tables.  Each page of the table corresponds to each of the 5 Z amplitudes measured at each location.  In the attached VI, the Array Build function works perfectly for the static case where the entire data is available.  I followed the example of a another discussion forum will be subject to the provisions of nest two loops construction 2D array in the inner loop and incrementing the pages on the outer loop. The static situation is resolved.

    However, my goal is to graphically present data he is taken, point by point, to the user.  The other attached VI simulates this scenario, incrementation of x and y positions based on the measure button.  Z matrix indicator shows that the 2D Array (each individual page) is in the proper format.  The construction of the 3D picture is dynamically where I'm having problems.  I tried to build table and replace a subset of table, but none of these functions to produce the desired result.

    In the case of building table, 3D table is correctly based on the first measure: for x = y = 1, 2D array page0 is set Z_1 in position (1,1), page1 has the Z_2 value in the position (1,1), page2 Z_3, etc..  However, on the second measure, as expected, the berries are concatenated page5 have Z_1 values in the (1,1) and (2,2) positions.  This result is properly formatted, however, should the counted array 3D page is limited to 5 (page0, 1, 2, 3, 4).  So ideally, page5 should in this case replace page0.  So build array results in the correct format but concatenation is not desirable.

    The subset of spare board was made with the index of the page (outside of the loop) number to specify the subset of the 3D Board needs to be replaced.  The result was an empty 3D array.

    Thank you any help to solve this problem.

    kmsk wrote:

    Any suggestions on how to handle filling out table 3D of unknown size?

    If the size of the final table has a reasonable upper limit, you can initialize an array of slightly oversized, then keep using the subset of the table replace. It will be much faster and more effective memory than gradually more and more large networks.

    When the purchase is made, you can cut to the final size.

    Aircraft add to a table 3D using 'insert into array' or 'Build array' (favorite?), cause memory frequent shifts and might slow down your code by orders of magnitude in casing of excessive fragmentation of memory.

  • Simple question on the subset of the array

    Well guys, I have a table with a number of 1000, and I want to divide it into 10 tables with 100 numbers

    My question is:

    In the subset of the table, I can put the index and length, in the first subset of table, I put index 0 and length 100, I think it will start at index 1, since 0 does not exist, right?

    then in the next I set 100 index and he will leave the index 101, or I have to put the index 101 to start in 101?

    because the length will always be 100.

    Example:

    1000/10 = 100

    So I have to create 10 tables with 100 numbers each

    Sincerely,

    Eduardo

    LabVIEW arrays are 0 based, so the first element has index 0. 101 item has index 100. So yes, you must specify the 100 index and length 100 for obtaining 101.200.

  • How to speed up the handling of the table

    I need to generate two arrays of samples up to 20 million to simulate a quadrature encoder signals. I start with a table of examples of position and for each sample, I create a table with the representation of a single pulse and insert it in the table final as many times as necessary. I tried to optimize this code in many ways (using "replace subsets of the table" instead of "insert into tables" and leaving as much code as possible out of the loop FOR), but it is always very slow to run (it takes about 15 minutes just to treat about 10% overall on an i5 machine).

    Is there a faster way to handle this table? I read somewhere that "insert into tables" should not be used inside a loop, but when I initialize an array with the total number of samples and use instead "replace subsets of table" to insert samples execution gets even slower.

    See you soon


  • Copy and paste the values in the table

    I have a program that has several bays.  Recently, there were about 80 new values more than I needed to add to each table.  I just finished adding new values to one of the tables - is possible I can highlight and copy this entire block of values I added just so I can then paste it on the other tables?  It seems that I can only highlight, copy and paste a value at a time.

    Do it programmatically.  Copy your table to a new VI.  Subset of the table to obtain the portion.  Add a copy of your other table table to build or Insert in the table.  Copy the tables updated to the original location.

  • generate the subset of the decimal table to an array of Boolean

    I have a decimal table 1 2 3 4 5 6, and I have a boolean with the same table size 0 1 0 1 1 0.

    How can I retrieve the subset of the decimal table of the corresponding "1" position of the table of Boolean (in this case 5 4 2)?

    The value of the Boolean table are editable (casting either 1 00100), so the size of the array decimal subset is not fixed (1, 4).

    (I assume you mean digital Board. "Décimal" is just a specification of formatting and irrelevant for this)

    Try something like the following (the FALSE case has just wired table in the whole unchanged):

    (In case you're dealing with huge paintings, a few performance modifications should be made so that everything goes more in place.)

    (Sorry for the spelling errors, ignore them )

  • How can I find the subset of a table that corresponds to a set of conditions/conditions?

    I have often encountered this problem in LabVIEW, probably the result of my Matlab based thinking on the tables. Suppose I have a 1 d array that consists of a real number between 0 and 2 (for example):

    1.3 0.1 1.9 0.7 1.4 1.5 1.5 0.8 1.3 0.3 1.4 1.4 0.1 0.6 0.1 0.2 1.6 1.6 1.4 0.6 0.1 1.9

    and I want to know the average of the subset of values greater than 0.5 and less than 1.2:

    average ([0.8 0.7 0.6 0.6]) = 0.6750.

    How can I find the subset of the array that satisfies the condition > 0.5 &<1.2>

    For your example (values between 0.5 and 2) If you wish:

    I would do something like this:

    I have generated just a table of 10 random numbers between 0.0 and 2.0

    The following loop sorts the data, using "range and force."
    It then displays the data in the selected range.

    The last step is to take the average

    I have attached the VI if you do not want to use the code.

  • Copy the table

    Hello

    I would like to ask how to copy the contents of a Table to another Table? What is the function?

    If all the cells in a table are compatible, you can get the values with:

    GetTableCellRangeVals (panelHandle, PANEL_TABLE, VAL_TABLE_ENTIRE_RANGE, array, VAL_COLUMN_MAJOR);

    Otherwise you can copy the content into smaller subsets or cell by cell. See using the command for an explanation of "compatible".

    To fill in the destination table, you can use the reverse order of SetTableCellRangeVals

    The largest area you can set (and therefore the lower the number of operations performed on the table) the faster the process.

    You can have a further improvement by hiding the table before this operation.

  • Splitting the tables in the tables more

    Hello world

    I couldn't find a similar problem on the forum, hency my new post. I have a number of paintings in need of splitting.

    Say I have data stored in 4 tables (or columns), appointed IGS, VGS, VDS and IDS. These four columns each have n * 80 cells, where n is the number of measures. What I want to do is to have the n number of times IGS, CGS, IDS and VDS, where each table is only 80 cells long. Thus, when displayed in Excel for example, the first row would look like:

    IGS VGS IDS VDS VGS ID VDS IGS VGS GHI...

    Thanks a lot for help.

    You can start by finding the size of you individual tables, IGS, CGS, IDS and VDS.  I guess they would be of the same size.  Divide size by 80 and that's your hand for loop index.  Use the subset of table VI and shoot 80 pieces of each array element.  Once you have the 80 item chucks you can set up another loop on the berries and build the table 1 d longer with an Array function construction with a CONCATENATE entry-level feature.  Using shift registers and another function of matrix to build to add the following line in the main table.

    I think that's what you wanted.

  • How to convert the string with numbers in the table of Boolean 2D

    Hello

    I have input a string with comma separated numbers 1,192 (starting at 1).

    This string must be converted to a table 2D-boolean. Each number that appears should be true, not true rest.

    The 2D table consists of 4 times of 0.47 Boolean values.

    1.48--> [0.47] numbers [0]
    49.96--> [0.47] numbers [1]
    Numbers 97.144--> [0.47] [2]
    145.192--> [0.47] numbers [3]

    If a '1, 49, 97 145' input string put all [0] [0.3] true.

    How can it be easy/fast resolved?

    Thanks for help

    Break the string of numbers in a table of numbers.  (Spreasheet String to Array).

    In a loop For, index with each issue of this table.  Use in the range and Coerce to see if it is in the range of numbers.  (You can put this in a loop For as auto good indexing through the ranges).  If it's in the range, then use subset replace table to activate the corresponding item in a real.  If this is not the case, do nothing.  Maintain the table of Boolean in a shift register.

    Repeat this step for each number in your table.

    (What is a class assignment?)

  • Leak memory in a simple loop to save data in the table?

    Hello world

    I'm trying to set up a simple code to read a certain amount of data in a table at a fixed sampling rate and put these data in a local variable.  I'll put this on one OR cRIO-9073 using the scanning engine and the data comes from one NOR 9208 with a speed of approximately 250 Hz scanning, even if it is not really important at the moment.

    I made this little test VI which I suspect contains a memory leak, but I'm not able to identify it.  The reason for my suspicion is that when I run the vi on a VMWare virtual machine (LabVIEW 2010 on Windows XP) it claims soon that it is short-term memory.  Of course, the problem is perhaps elsewhere, but I hope that someone more experienced with LabVIEW programming will be able to find all the bugs very easily because it is really a piece very simpel to code. :-)

    I have included a copy of the VI with a screenshot to illustrate.

    Regards, Martin

    PS my code looks a bit awkward, so if anyone has a better solution, I'd be very happy to learn about it!

    Hello Martin,

    I would try a different approach to your problem. Currently you reshape your table each iteration of the loop. This means that the allocator memory of LV must find a new piece of contiguous memory each iteration of the loop. You're probably fragment your memory and so short of contiguous blocks of memory, leading to the release of messages from memory.

    For these types of tasks, I recommend having an array of fixed size that you initialize outside the loop and then use the Replace table subset in the loop for updating the values. This avoids the problem of allocating memory you use in.

    Alternatively, since I assume that you use the local variable to pass data to another loop, you can use a FIFO RT to manage data. A RT FIFO resembles a queue of LV, but it is designed so that you can keep determinism in your application. Set up an acquisition loop that exports data from the 9208 every 4ms in a RT FIFO. Then set up your processing loop to run at a slower pace - say every 200ms. The processing loop reads all the elements of the FIFO until it is empty every 200ms or a number of samples. The RT FIFO is fixed size, if you need to make it large enough to contain at least 200/4 = 50 samples. For more security, you should do several times bigger, maybe 200 samples. You can try different sizes of the FIFO and also to the different periods of your processing loop to your application's specifications.

    Using this method you do not have to create a counter to track items, since the reading of FIFO function can tell you how many items is in the FIFO and also when it is empty.

    I recommend you the example of Communication of FIFO of RT which comes with LabVIEW to get an idea of how to use these functions.

    Gerardo

Maybe you are looking for