<?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 Re: shift register array in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/shift-register-array/m-p/3157304#M910231</link>
    <description>&lt;P&gt;Thanks.&amp;nbsp; I did get it to work with your hints.&amp;nbsp; I built the indexed array as you originally showed without the shift register, then passed the 2nd and 3rd elements to the shift register, added a second and third element so the sum would be passed two more times, then built the output array.&amp;nbsp; I may try tinkering with it more to allow for any size arrays but for now I got it to work with any 6 element array.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks again&lt;/P&gt;</description>
    <pubDate>Sat, 27 Jun 2015 00:40:10 GMT</pubDate>
    <dc:creator>mike28440</dc:creator>
    <dc:date>2015-06-27T00:40:10Z</dc:date>
    <item>
      <title>shift register array</title>
      <link>https://ni.lithium.com/t5/LabVIEW/shift-register-array/m-p/3157277#M910214</link>
      <description>&lt;P&gt;I need to create a program that will take a six element array, and using shift registers have it output an array that keeps the first element the same, then adds the second and third elements together, then adds the second through 6th element.&amp;nbsp; So if the input array is 2, 12, 10, 5, 20 and 25, the output array will be 2, 22 and 72.&amp;nbsp; I am thinking that using shift registers and a for loop would work, but I cannot get it to work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for any help&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2015 22:49:49 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/shift-register-array/m-p/3157277#M910214</guid>
      <dc:creator>mike28440</dc:creator>
      <dc:date>2015-06-26T22:49:49Z</dc:date>
    </item>
    <item>
      <title>Re: shift register array</title>
      <link>https://ni.lithium.com/t5/LabVIEW/shift-register-array/m-p/3157282#M910216</link>
      <description>&lt;P&gt;I am not sure whay you would want a loop or a shift register. &amp;nbsp;Index the array, add the appropriate elements, and Build Array.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lynn&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/c588a9c0fd38f905d51a6481fd44253a9bda11f6/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31363931303969374443374345423730343531394233442f696d6167652d73697a652f6f726967696e616c3f763d6d70626c2d312670783d2d31" border="0" alt="Array manipulation.png" title="Array manipulation.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2015 23:00:56 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/shift-register-array/m-p/3157282#M910216</guid>
      <dc:creator>johnsold</dc:creator>
      <dc:date>2015-06-26T23:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: shift register array</title>
      <link>https://ni.lithium.com/t5/LabVIEW/shift-register-array/m-p/3157288#M910218</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/326299"&gt;@mike28440&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I need to create a program that will take a six element array, and using shift registers have it output an array that keeps the first element the same, then adds the second and third elements together, then adds the second through 6th element.&amp;nbsp; So if the input array is 2, 12, 10, 5, 20 and 25, the output array will be 2, 22 and 72.&amp;nbsp; I am thinking that using shift registers and a for loop would work, but I cannot get it to work.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;First you say that using shift registers is a requirement ("need!"), but later you say that you "think" you need a shift register? Which one is it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is this for school as an exercise to learn about shift registers?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are just looking for a simple non-scalable solution, use Lynns code above.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need a scalable solution that works on any size input array and does the operation according to some defined rules, tell us what the rules are.&lt;/P&gt;
&lt;P&gt;If you cannot get it to work (as you say), feel free to attach your broken code and maybe you learn something from our advice. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2015 23:28:08 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/shift-register-array/m-p/3157288#M910218</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2015-06-26T23:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: shift register array</title>
      <link>https://ni.lithium.com/t5/LabVIEW/shift-register-array/m-p/3157289#M910219</link>
      <description>&lt;P&gt;Sorry I was not entirely clear.&amp;nbsp; While yours does it, It needs to calculate the 22, and then add 22 to the rest of the elements in the array.&amp;nbsp; So it leaves the first element of the array alone, then calculates 22 then adds 22 to the rest of the elements.&amp;nbsp; I think that is why shift registers are necessary.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2015 23:29:09 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/shift-register-array/m-p/3157289#M910219</guid>
      <dc:creator>mike28440</dc:creator>
      <dc:date>2015-06-26T23:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: shift register array</title>
      <link>https://ni.lithium.com/t5/LabVIEW/shift-register-array/m-p/3157291#M910221</link>
      <description>&lt;P&gt;Well, originally you said that the desired output is [2,22,72] and that's exactly what Lynns code does.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want something else, please tell us what the output array should look like! How many elements? What values? Or should the output be a scalar?&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2015 23:35:13 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/shift-register-array/m-p/3157291#M910221</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2015-06-26T23:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: shift register array</title>
      <link>https://ni.lithium.com/t5/LabVIEW/shift-register-array/m-p/3157296#M910225</link>
      <description>&lt;P&gt;What you appear to be describing now still does not require a shift register.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As &lt;STRONG&gt;altenbach&lt;/STRONG&gt; has asked, please give a complete and precise description of what the rules are.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lynn&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2015 23:39:49 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/shift-register-array/m-p/3157296#M910225</guid>
      <dc:creator>johnsold</dc:creator>
      <dc:date>2015-06-26T23:39:49Z</dc:date>
    </item>
    <item>
      <title>Re: shift register array</title>
      <link>https://ni.lithium.com/t5/LabVIEW/shift-register-array/m-p/3157297#M910226</link>
      <description>&lt;P&gt;Yes, it is for a class, but we can use any resources available, and I have not seen anything in the forums close to this kind of thing.&amp;nbsp; So it should look exactly like Lynn's output, but a shift register is required.&amp;nbsp; So far all I have been able to do is create the input array and wire it to the register.&amp;nbsp; If know if I wire it directly and run it through a for loop with N=3 the output array will just display 2, 10 and 12.&amp;nbsp; I have been trying different ways of it trying to do the sum and that is the part I am having trouble with.&amp;nbsp; I agree without the shift register it would be much easier and Lynn's code would be exactly what is needed.&amp;nbsp; I have attached the vi with the progress of getting the array sizes.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2015 23:46:02 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/shift-register-array/m-p/3157297#M910226</guid>
      <dc:creator>mike28440</dc:creator>
      <dc:date>2015-06-26T23:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: shift register array</title>
      <link>https://ni.lithium.com/t5/LabVIEW/shift-register-array/m-p/3157298#M910227</link>
      <description>&lt;P&gt;There is no restriction on what kind of loop is used.&amp;nbsp; I have been trying it with a for loop, but that is not required.&amp;nbsp; The requirements are:&lt;/P&gt;
&lt;P&gt;Use shift register&lt;/P&gt;
&lt;P&gt;take the elements of a 6 element array, and the output will be a 3 element array.&amp;nbsp; The first element will be the first element of the orignal array.&amp;nbsp; The second element is elements 2 and 3 added together, and the third element is the result of element 2 added to the rest of the elements in the original array.&amp;nbsp; So exactly what your solution without the shift regiister was doing.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2015 23:52:13 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/shift-register-array/m-p/3157298#M910227</guid>
      <dc:creator>mike28440</dc:creator>
      <dc:date>2015-06-26T23:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: shift register array</title>
      <link>https://ni.lithium.com/t5/LabVIEW/shift-register-array/m-p/3157301#M910228</link>
      <description>&lt;P&gt;OK. &amp;nbsp;Since it is for a class I will not do any more code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Comments.&lt;/P&gt;
&lt;P&gt;1. A shift register is a form of local memory. So, ask yourself what about this problem needs to be remembered?&lt;/P&gt;
&lt;P&gt;2. The input and output arrays are different sizes. It does not make sense to wire the array through the shift register because the shift register will "remember" how big the input array is.&lt;/P&gt;
&lt;P&gt;3. Thinking about comment 1, how will you get the information from the array to put it into the shift register?&lt;/P&gt;
&lt;P&gt;4. What if you applied the same rules but allowed the input array to have any size greater than or equal to 6? &amp;nbsp;This is what is meant by a scalable approach to a problem. The code I posted only works for length 6. &amp;nbsp;For any other length the program needs to be modified. A scalable program works without changes for any size input.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is often very useful to start with a clear set of requirements, which you have now told us. Then plan how you would do the problem with pencil and paper. Then implement that plan in software.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lynn&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jun 2015 00:11:15 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/shift-register-array/m-p/3157301#M910228</guid>
      <dc:creator>johnsold</dc:creator>
      <dc:date>2015-06-27T00:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: shift register array</title>
      <link>https://ni.lithium.com/t5/LabVIEW/shift-register-array/m-p/3157302#M910229</link>
      <description>&lt;P&gt;So what needs to be remembered are certain elements of the original array.&amp;nbsp; That I get.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the tip about not wiring the array to the register.&amp;nbsp; So I guess wiring the array to the loop or just putting the array in the loop would work?&amp;nbsp; Point 4 does not really apply to our problem since it only has to work for any 6 element array.&amp;nbsp; I appreciate that would be a good modification however.&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jun 2015 00:18:41 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/shift-register-array/m-p/3157302#M910229</guid>
      <dc:creator>mike28440</dc:creator>
      <dc:date>2015-06-27T00:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: shift register array</title>
      <link>https://ni.lithium.com/t5/LabVIEW/shift-register-array/m-p/3157303#M910230</link>
      <description>&lt;P&gt;Actually you need to remember the sum of some elements rather than the individual values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have written a version that works without using Index Array. It uses shift registers and will work for&amp;nbsp;any input array of at least three elements.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have another version which is also scalable and which requires no loops and shift registers. &amp;nbsp;I have tested both with 5000+ element arrays and get identical results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lynn&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jun 2015 00:34:35 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/shift-register-array/m-p/3157303#M910230</guid>
      <dc:creator>johnsold</dc:creator>
      <dc:date>2015-06-27T00:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: shift register array</title>
      <link>https://ni.lithium.com/t5/LabVIEW/shift-register-array/m-p/3157304#M910231</link>
      <description>&lt;P&gt;Thanks.&amp;nbsp; I did get it to work with your hints.&amp;nbsp; I built the indexed array as you originally showed without the shift register, then passed the 2nd and 3rd elements to the shift register, added a second and third element so the sum would be passed two more times, then built the output array.&amp;nbsp; I may try tinkering with it more to allow for any size arrays but for now I got it to work with any 6 element array.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks again&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jun 2015 00:40:10 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/shift-register-array/m-p/3157304#M910231</guid>
      <dc:creator>mike28440</dc:creator>
      <dc:date>2015-06-27T00:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: shift register array</title>
      <link>https://ni.lithium.com/t5/LabVIEW/shift-register-array/m-p/3157305#M910232</link>
      <description>&lt;P&gt;Good.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you would like us to comment on your code, please post the VI.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lynn&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jun 2015 00:42:43 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/shift-register-array/m-p/3157305#M910232</guid>
      <dc:creator>johnsold</dc:creator>
      <dc:date>2015-06-27T00:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: shift register array</title>
      <link>https://ni.lithium.com/t5/LabVIEW/shift-register-array/m-p/3157306#M910233</link>
      <description>&lt;P&gt;Actually I am testing it, and it is not quite doing what it should, but it is close.&amp;nbsp; Here is the code if you could give me a hint on what I did wrong.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jun 2015 00:58:42 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/shift-register-array/m-p/3157306#M910233</guid>
      <dc:creator>mike28440</dc:creator>
      <dc:date>2015-06-27T00:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: shift register array</title>
      <link>https://ni.lithium.com/t5/LabVIEW/shift-register-array/m-p/3157309#M910235</link>
      <description>&lt;P&gt;Turn on Highlight Execution (the light bulb on the block diagram toolbar) and watch what the VI does.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Expand the appended array on the front panel. Is that what you want? It is the result of autoindexing at the output tunnels of the for loop.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;IMG src="https://ip1.i.lithium.com/44f110692e622148dddd21ff8c7c0611df89cff2/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31363931313069444133304238453131433333444334332f696d6167652d73697a652f6f726967696e616c3f763d6d70626c2d312670783d2d31" border="0" alt="Appended array.png" title="Appended array.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Reading the Array indicator and indexing the six values out on multiple iterations of the loop when it does not change between iterations is useless&amp;nbsp;and&amp;nbsp;redundant.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Look up "uninitialized shift register" in the Help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lynn&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jun 2015 01:13:52 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/shift-register-array/m-p/3157309#M910235</guid>
      <dc:creator>johnsold</dc:creator>
      <dc:date>2015-06-27T01:13:52Z</dc:date>
    </item>
  </channel>
</rss>

