How to build a table inside a loop

Hello world

I have a fundamental question on labview. I would like to create a table in a loop 'for' in this way:

inside the loop, if a condition named 'A' is true, then I add a new value to the first column of the table.  Otherwise, I have create a new column and start adding values in this column when the condition 'A' is checked, etc.

I put an example of a VI when the 'A' condition is "improving the loop + 1 is not divisible by 5" and the values in the tables are to increase the loop + 1. The loop stops when the increment = 25.

In this example, I have a single column with the values [1 2 3 4 6 7 8 9 11 12 13 14 16 17 18 19 21 22 23 24]

while I wish I had a table of 5 columns:

1 6 11 16 21

2 7 12 17 22

3 8 13 18 23

4 9 14 19 24

Note that this is just an example. More generally, the table may contain columns of different lengths.

Thanks for your response

Andrew

Try to watch this VI I wrote, it takes a 1 d array and puts it into a 2D array based on a threshold. I think it's a pretty good example on how to insert a table of works. I hope it helps

Tags: NI Software

Similar Questions

  • How to build a table of TDMS file open

    Hello

    Examples NI TDMS - Express write data .vi (time domain), I can build a PDM file with 2 channels (sine and square waveforms) data, which are stored as test.tdms.

    Using Express read .vi data (time domain), 2 channels of waveform data are read. How to build a table later? How to separate the 2 channels of data in the tables 1-2 and manipulate the data using table functions?

    For example,.

    I want to collect 100 from index100 between channel 0 and their average. I want to take 50 samples from the channel 50 1 index and double each element.

    Thank you for your help.

    Bing@NCL

    Hey Bing.

    You can perform operations on different channels in the 2D table using the table to index. This will allow you to choose the channel to operate on, then you can perform the operation inside a loop on each element. In the included code snippet, I used a shift register to find the total cumulative values in channel 0 and then divided by the number of samples.

    I recommend you read some tutorials LabVIEW and bases of knowledge on topics that are related to yours. These could help a lot.

    I hope that my suggestions help,

    Chris

  • How to build a table using incoming data stream?

    I'm programming in VBAI but use LV as my Interface of Inspection. The VBAI program will go into a finite loop (x 1000) and the digital indicator with dbl vaule of food in front of the LV Panel if the value double is in order.

    In LV, how to build a table (index 0-999) with this stream?


  • How to build the table with all the combinations of a source table?

    Hello

    I have a 2D array that contains the list of the power user-defined settings. The number of PSs (table rows) is not fixed. For example - 3 PSs:

    Stage of Min Max name

    PS1 3.0 3.6 0.3

    PS2 0.9 1.2 0.1

    PS3 1.7 1.9 0.1

    I need to build, from this list, a table of all the combinations as below:

    PS1 PS2 PS3

    3.0 0.9 1.7

    3.0 0.9 1.8

    3.0 0.9 1.9

    3.0 1.0 1.7

    3.0 1.0 1.8

    3.0 1.0 1.9

    3.0 1.1 1.7

    3.0 1.1 1.8

    3.0 1.1 1.9

    3.0 1.2-1.7

    3.0 1.2-1.8

    3.0 1.2-1.9

    3.3 0.9 1.7

    3.3 0.9 1.8

    3.3 0.9 1.9

    3.3 1.0 1.7

    3.3 1.0 1.8

    3.3 1.0 1.9

    3.3 1.1 1.7

    3.3 1.1 1.8

    3.3 1.1 1.9

    3.3 1.2 1.7

    3.3 1.2 1.8

    3.3 1.2 1.9

    3.6 0.9 1.7

    3.6 0.9 1.8

    3.6 0.9 1.9

    3.6 1.0 1.7

    3.6 1.0 1.8

    3.6 1.0 1.9

    3.6 1.1 1.7

    3.6 1.8 1.1

    3.6 1.1 1.9

    3.6 1.2 1.7

    3.6 1.2 1.8

    3.6 1.2 1.9

    How to build this table programmatically?

    (Note also that the number of rows in the source table is not fixed).

    Thanks in advance!

    Hi Berezka,

    using a magic of automatic indexing:

  • How to build a table in a master/slave relationship?

    Hello NOR community,

    I can't build a table in a master/slave relationship. I want two paintings to be built for a fixed amount of iterations, once press the 'pressurization '. (This data acquisition would occur only once per program). I am new to Labview so I apologize in advance for my layout disorder.

    I want the slave program to create two tables and analyse the slope of pressurization to arrive at the same time as the master's program and the master program to continue to acquire data of pressure.

    Master slave relationship is even necessary here? How to pass a variable (pressure main once a loop without getting stuck in a nested loop situation?

    Here is a small example, just to show an idea (many things is not optimal in this example!). Based on your VI you have attached, you miss a lot of basic concepts of LabVIEW, you go through online training.

  • How to build a table of measured data permanently

    Have a good day for everyone,

    I have a problem about the construction of a table permanently. I tried to find the solution for a long time, even if it's a task really simle.

    I want to build a table permanently, virtually:

    I like to read data from a measuring devices and I would like to sotre it one by one, at all times. I made a simple VI to present one where my problem is. The random generator represents the data given the measuring device.

    At currently I am able to store data only 1. When I want to store then that it is crushed.

    Thanks for anyone who can help me.

    Hi LIG.

    no need for a structure business when you can use autoindexing:

    Also, the code snippet shows how to convert a number in your reading string. You probably prefer tanks instead of integers...

  • How to build a table of clusters?

    I am building a mapping application room of the robot, Mindstorms NXT using LabVIEW for LEGO MINDSTORMS.

    The VI attached shows the initial computer segment.  The IR sensor is driven by stepper motor, and the range and Angle of the measures are carried out at intervals of 1 degree.  Data coordinating cylindrical (range, Angle) are then converted into Cartesian coordinates (X, Y), and it is my desire to collect each (X, Y, Angle) in a cluster, and then create a table of cluster to give me a file that will be transmitted through Bluetooth, the NXT to the computer where it will be displayed.

    On the fron Panel, I created a cluster 3 of the housing and on the block diagram, I created a table with a data type of cluster 3 pins and the array index wired to the loop index.  However, I get erroes everytime that I plug the cluster and the big picture.  My intention is that the table will index every cycle of the While loop.  What I am doing wrong?

    Thank you once again, Ethan (or appear to have been applied permanently to my case).  Anyone who purchases of LabVIEW for LEGO MINDSTORMS has too much trouble I feel?  Why the product is provided with no step by step user documentation?

  • Build a table of a loop for.

    Hi all

    I have a vi that reads from a file and manipulates data using the loop. I'm taking each element and multiplying by a constant and convert it to I32. I would build to a new array with the new values. I have attached the vi and a sample data file to read.

    Please suggest if there are the best ways to do this.

    Thank you.

    You can multiply with the constant table and use table instead of multiply with each item.

  • How to build a table that can be filled in by the user?

    I am building a form where the user can easily add a quantity to order a size. I was not able to do other than the addition of a text field for each option. You can create a table that would do the same thing (see my example below)? Better yet, is it possible to get it altogether? Any ideas appreciated!

    Small

    Med

    Large

    XL

    Total

    A style

    Style B

    Hello

    You already have a good start to generate the table. All you need to do is change the cells of static text in a numeric field or text field. You can do so by dragging a numericField library of objects and place it inside the cell.

    Once you have the digital field in place, you can change the properties, police, alignment, currency, validation, etc. Then copy and paste the field in similar cells and change names, e.g. A_small, B_small etc.

    The field 'Total' digital could have a Formcalc in the calculate event:

    $ = A_small + A_med + A_large + A_xl

    It is based on a static table where design you all the lines that will be accessible to the user.

    You can also configure dynamic tables where the EBU can add extra lines. There are many good examples using the LC and the forums.

    Good luck

    Niall

  • How to build a table of TDMS files 2D

    Hello

    I'm doing a picture 2D on a group of channels in a PDM file, so that I can see is similar to the way Excel displays the file in a table format. Next, I would deal with more of the 2-D array elements. I can not turn it into a table using the DDHN reading VI that I get the error-2532, cannot convert to the specified format. I thought that treat the file as a table 2D channels would work, but apparently it is not.

    Thank you

    Omar

    OK, your culprit is the first channel (time).  This is a timestamp, while other channels are double.  So you can follow this code in order to read all channels in a 2D array.  From there, you can convert to a string.  You can read the string hour separately if you wish.

  • How to create a table in a stored procedure

    Please help me to answer the following question...

    How to create a table inside the stored procedure... I want a detailed explanation... Please help me

    Please see this link:
    http://tinyurl.com/cmq5vo

  • How the repeating table inside a control valve?

    Hello

    Does anyone know how to make the repeating table inside a control valve in LabWindow CVI? I see that there is option for a Panel to scale content in resizing, but not available for a tab control. Any ideas?

    Thank you very much!

    Weiming

    I don't know, I understand what you're trying to do, but you can set ATTR_SCALE_CONTENTS_ON_RESIZE on each tab panel.

    GetPanelHandleFromTabPage (panelHandle, PANEL_TAB, 0, & tabPanel);
    SetPanelAttribute (tabPanel, ATTR_SCALE_CONTENTS_ON_RESIZE, 1);

  • How to stop a flat sequence (or timed sequence) which is inside a loop for

    The problem is this, I have a loop that repeats 10 times and inside this loop, I have a flat sequence (or timed sequence) with four images, each of this chassis to evaluate a different condition of a vector that I introduce.

    What I woud like for example is:

    I'm a fifth County of the loop for and in the case that part 2 does not meet the condition, the sequence of dish (or timed sequence) stops and starts the loop again but this time for the number of number 6.

    I would appreciate your response.

    You can't stop a sequence structure.  This is how they are made.

    What you should consider to get rid fo structures sequence and to change a state machine architecture.  There are many examples in LabVIEW, as well as on the Forums.  The big advantage of the state machine is that at the end of each State, it examines the conditions and determines which State then run. And that is exactly the description of the problem you are experiencing.

    Lynn

  • How to fill a table with table loop

    I am a loop of an object array and that I loop, calling a function and this function returns 6 elements

    < CFLOOP from ="1" =' #ArrayLen (zz) # ' index ='k'>

    < cfdump var ="#zz [k] .getLine () # '> < p >

    < / CFLOOP >

    The cfdump above returns something like:

    [empty string]

    Street name1

    [empty string]

    [empty string]

    Ville1

    State1

    Zip1

    [empty string]

    Street name2

    Apartment AA

    [empty string]

    City2

    State2

    Zip2

    name of the Street 3

    Margenthaller Hall

    Suite 202

    City2

    State2

    Zip2

    etc.

    I need to insert these results into my table address while loop.

    When I did the following (see below), each repeated 12 times obtained record (don't know why)

    < CFLOOP from ="1" =' #ArrayLen (zz) # ' index ='k'> < cfdump var ="#zz [k] .getLine () # '>

    < name cfquery = 'test' datasourece = 'MyDNS' >

    INSERT INTO MyAddr (street1, street.2, street3, city, state, zip)

    VALUES ('#zz [1] .getLine () #', ' #zz [2] .getLine () # ', ' #zz [3] .getLine () # "," #zz [4] .getLine () #',' #zz [5] .getLine () # ', ' #zz [6] .getLine () #')

    < / cfquery >

    < / CFLOOP >

    Is there a way? to insert as I already had the address properly all loop but don't know how to use the result in the insert statement.

    Can anyone help?

    Where this table comes in the first place?

  • How can I write time to build the table in just a few seconds?

    Hello world

    I am able to use "elapsed time" to send a time stamp to "build the table" using the output of 'elapsed time to text.  But after 59 seconds, it gives then a minute.  In the excel file, it is as follows:

    0 00:00:59

    0 00:01:00

    0 00:01:01

    I want to continue to 60, 61 seconds and so fourth.  When I try to connect to an another Subvi, it gives me a connection error.  Any help would be greatly appreciated?

    Thank you

    Ferriol

    I guess that's the Express VI, you can use the output of the time elapsed (s) instead of the number of seconds passed.  If you want a string, use the Format String VI, or build an array of DBL to add to the rest of your data.

Maybe you are looking for