<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic nested for loops outputs in single array in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/nested-for-loops-outputs-in-single-array/m-p/1829481#M626444</link>
    <description>&lt;P&gt;hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; I have a while loop which has to stop after 5 iterations,in which i have 2 for loops in a while loop.Each for loop has to run 2 times each. The output of each for loop has 2 values and one value coming from the first iteration of while loop so total 5 values.Now i want to store all these values in a single 1-D array format,which i am not able to do. i am unable to store all the values in a single array .Can anyone guide me in doing this&lt;/P&gt;</description>
    <pubDate>Sat, 07 Jan 2012 06:34:44 GMT</pubDate>
    <dc:creator>Samineni</dc:creator>
    <dc:date>2012-01-07T06:34:44Z</dc:date>
    <item>
      <title>nested for loops outputs in single array</title>
      <link>https://ni.lithium.com/t5/LabVIEW/nested-for-loops-outputs-in-single-array/m-p/1829481#M626444</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; I have a while loop which has to stop after 5 iterations,in which i have 2 for loops in a while loop.Each for loop has to run 2 times each. The output of each for loop has 2 values and one value coming from the first iteration of while loop so total 5 values.Now i want to store all these values in a single 1-D array format,which i am not able to do. i am unable to store all the values in a single array .Can anyone guide me in doing this&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jan 2012 06:34:44 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/nested-for-loops-outputs-in-single-array/m-p/1829481#M626444</guid>
      <dc:creator>Samineni</dc:creator>
      <dc:date>2012-01-07T06:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: nested for loops outputs in single array</title>
      <link>https://ni.lithium.com/t5/LabVIEW/nested-for-loops-outputs-in-single-array/m-p/1829483#M626445</link>
      <description>&lt;P&gt;You could resize the output array or use a shift register in the second for loop instead of indexing, make sure you append the new value to the old array.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jan 2012 07:10:31 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/nested-for-loops-outputs-in-single-array/m-p/1829483#M626445</guid>
      <dc:creator>.aCe.</dc:creator>
      <dc:date>2012-01-07T07:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: nested for loops outputs in single array</title>
      <link>https://ni.lithium.com/t5/LabVIEW/nested-for-loops-outputs-in-single-array/m-p/1829533#M626458</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/180622"&gt;@Samineni&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; I have a while loop which has to stop after 5 iterations,in which i have 2 for loops in a while loop.Each for loop has to run 2 times each. The output of each for loop has 2 values and one value coming from the first iteration of while loop so total 5 values.Now i want to store all these values in a single 1-D array format,which i am not able to do. i am unable to store all the values in a single array .Can anyone guide me in doing this&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I am not sure what you mean by "nested For loops." &amp;nbsp;Nested in the while loop or one For nested inside another, which is the traditional term. &amp;nbsp;The attached VI probably will not give you your expected results, but it will give you an idea of how to use indexing and shift registers to build arrays, which is your main question.&lt;/P&gt;
&lt;P&gt;It would help if you could attach a VI so we can get a better idea of your code. &amp;nbsp;You are not very clear in your original post regarding your design.&lt;/P&gt;
&lt;P&gt;Keep in mind, there are actually two programs in the attached VI which is the reason for two stop buttons, but this was just to demonstrate different methods, not be familiar with your design.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jan 2012 16:28:12 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/nested-for-loops-outputs-in-single-array/m-p/1829533#M626458</guid>
      <dc:creator>MoReese</dc:creator>
      <dc:date>2012-01-07T16:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: nested for loops outputs in single array</title>
      <link>https://ni.lithium.com/t5/LabVIEW/nested-for-loops-outputs-in-single-array/m-p/1829607#M626477</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Samineni wrote:
&lt;P&gt;&amp;nbsp;&amp;nbsp; I have a while loop which has to stop after 5 iterations,&amp;nbsp;&lt;SPAN&gt;,in which i have 2 for loops in a while loop.&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That means it actually should be a FOR loop, right?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/180622"&gt;@Samineni&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Each for loop has to run 2 times each. The output of each for loop has 2 values and one value coming from the first iteration of while loop so total 5 values.Now i want to store all these values in a single 1-D array format,which i am not able to do. i am unable to store all the values in a single array .Can anyone guide me in doing this&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If both inner for loops spin exactly twice, couldn't you place all code is a single FOR loop? Or are they nested too?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;So, do you want to append 5 elements to a 1D array with every iteration of the outer loop (final size 25 elements), or do you want to overwrite a 5 element 1D array with every iteration of the outer loop (final size 5 elements)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What should be the order of the five element sets?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As you can see, a text description is typically not sufficient to unambiguously describe a VI. it would be significantly easier for all of us if you could attach a simple draft of your code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jan 2012 20:48:04 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/nested-for-loops-outputs-in-single-array/m-p/1829607#M626477</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2012-01-07T20:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: nested for loops outputs in single array</title>
      <link>https://ni.lithium.com/t5/LabVIEW/nested-for-loops-outputs-in-single-array/m-p/1829609#M626478</link>
      <description>&lt;P&gt;Maybe something like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;IMG src="http://forums.ni.com/ni/attachments/ni/170/626478/1/BuildingArrayInLoops.png" border="0" alt="" title="" align="center" /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jan 2012 20:44:42 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/nested-for-loops-outputs-in-single-array/m-p/1829609#M626478</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2012-01-07T20:44:42Z</dc:date>
    </item>
  </channel>
</rss>

