<?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: Remove zero in an array and append elements in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/Remove-zero-in-an-array-and-append-elements/m-p/2565663#M774174</link>
    <description>&lt;P&gt;I attached the 2011 version to this email&lt;/P&gt;</description>
    <pubDate>Thu, 19 Sep 2013 04:36:32 GMT</pubDate>
    <dc:creator>tintin_99</dc:creator>
    <dc:date>2013-09-19T04:36:32Z</dc:date>
    <item>
      <title>Remove zero in an array and append elements</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Remove-zero-in-an-array-and-append-elements/m-p/2565605#M774160</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;
&lt;P&gt;I am contiously generate data and I would like to check the bit 17 and then if it is true add 1 to an array and if not zero, then I would like to remove all zeros and just have ones out of the while loop ( when the user click on stop)&lt;/P&gt;
&lt;P&gt;could you please help me on this. I have attached the vi&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2013 02:50:18 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Remove-zero-in-an-array-and-append-elements/m-p/2565605#M774160</guid>
      <dc:creator>tintin_99</dc:creator>
      <dc:date>2013-09-19T02:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: Remove zero in an array and append elements</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Remove-zero-in-an-array-and-append-elements/m-p/2565607#M774161</link>
      <description>&lt;P&gt;Can you upload your VI in 2011&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2013 02:51:02 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Remove-zero-in-an-array-and-append-elements/m-p/2565607#M774161</guid>
      <dc:creator>Ranjeet_Singh</dc:creator>
      <dc:date>2013-09-19T02:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: Remove zero in an array and append elements</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Remove-zero-in-an-array-and-append-elements/m-p/2565663#M774174</link>
      <description>&lt;P&gt;I attached the 2011 version to this email&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2013 04:36:32 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Remove-zero-in-an-array-and-append-elements/m-p/2565663#M774174</guid>
      <dc:creator>tintin_99</dc:creator>
      <dc:date>2013-09-19T04:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: Remove zero in an array and append elements</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Remove-zero-in-an-array-and-append-elements/m-p/2565667#M774176</link>
      <description>&lt;P&gt;The VI you have attached does not have much resemblance to your question. Also, your diagram constant is empty, so we don't really know what typical data looks like.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you even wondered what would happen if you remove the "equal true" and wire directly to the select node? Same thing!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please fill the diagram constant with some typical data so we can see what you have.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Counting is also typically done with integers, not floating point numbers. All you get out of the while loop is the array data from the last iteration. Is this really what you want?&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;tintin_99 wrote:
&lt;P&gt;I am contiously generate data and I would like to check the bit 17 and then if it is true add 1 to an array and if not zero, then I would like to remove all zeros and just have ones out of the while loop ( when the user click on stop)&lt;/P&gt;
&lt;P&gt;could you please help me on this. I have attached the vi&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You seem to check bits at all multiple positions of 17. If you only want to retain the ones, you seem to generate a lot of redundancy and unnecessary intermediary data. All you need is &lt;U&gt;count&lt;/U&gt; the "ones" in a scalar shift register and at the end initialze an array of ones of that size. Right?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="line-height: 15px;"&gt;So please attach a VI that contains typical data. Also tell us what result you expect from it. Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2013 05:08:46 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Remove-zero-in-an-array-and-append-elements/m-p/2565667#M774176</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2013-09-19T05:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: Remove zero in an array and append elements</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Remove-zero-in-an-array-and-append-elements/m-p/2565683#M774178</link>
      <description>&lt;P&gt;Hi Tintin_99,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check the attached vi. It does pretty much what you want to do. I have briefly explained the functionality on the block diagram.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, if you just need the number of 1's in the array, consider implementing what Christian has mentioned above. "&lt;U&gt;&lt;EM&gt;All you need is&amp;nbsp;count&lt;/EM&gt;&lt;/U&gt;&lt;SPAN&gt;&lt;U&gt;&lt;EM&gt;&amp;nbsp;the "ones" in a scalar shift register and at the end initialze an array of ones of that size.&lt;/EM&gt;&lt;/U&gt;"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;regards,&lt;BR /&gt;Nitz&lt;/P&gt;
&lt;P&gt;(Kudos are always welcome, Mark it as a Solution if your problem is Solved;))&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2013 05:53:31 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Remove-zero-in-an-array-and-append-elements/m-p/2565683#M774178</guid>
      <dc:creator>NitzZ</dc:creator>
      <dc:date>2013-09-19T05:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: Remove zero in an array and append elements</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Remove-zero-in-an-array-and-append-elements/m-p/2565697#M774182</link>
      <description>&lt;P&gt;Here's what I had in mind.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is usually much more efficient &lt;U&gt;not to create green arrays&lt;/U&gt;, but do bitwise operations directly on the integer. If we right-shift the number by 17 placed and bitwise AND it with 1, we get a 0 or 1, depending on the original bit 17.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://ni.lithium.com/ni/attachments/ni/170/774182/1/Bit17.png" border="0" alt="" title="" align="center" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2013 06:25:32 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Remove-zero-in-an-array-and-append-elements/m-p/2565697#M774182</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2013-09-19T06:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Remove zero in an array and append elements</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Remove-zero-in-an-array-and-append-elements/m-p/2565725#M774188</link>
      <description>&lt;P&gt;Hi Christian,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This looks really good.:) One question, what if its a 64 bit data instead of 32 bit? I believe the bit wise shift works only for 32 bits and in this case, it has to be handled with multiple shift functions after splitting the data appropriately. Would you still prefer the bitwise shift to the green arrays in such cases?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;regards,&lt;BR /&gt;Nitz&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2013 07:05:04 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Remove-zero-in-an-array-and-append-elements/m-p/2565725#M774188</guid>
      <dc:creator>NitzZ</dc:creator>
      <dc:date>2013-09-19T07:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: Remove zero in an array and append elements</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Remove-zero-in-an-array-and-append-elements/m-p/2565733#M774189</link>
      <description>&lt;P&gt;bitwise shift works equally with U64 data. Do you have evidence that it does not?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2013 07:25:27 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Remove-zero-in-an-array-and-append-elements/m-p/2565733#M774189</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2013-09-19T07:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: Remove zero in an array and append elements</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Remove-zero-in-an-array-and-append-elements/m-p/2565775#M774194</link>
      <description>&lt;P&gt;I'm sorry Christian, I misinterpretted something and had a notion that the logical shift doesn't work for U64 shift. I just tested it now, it works perfectly fine with U64 data as well. Sorry again for the post and thank you for replying.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;regards,&lt;BR /&gt;Nitz&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2013 08:19:16 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Remove-zero-in-an-array-and-append-elements/m-p/2565775#M774194</guid>
      <dc:creator>NitzZ</dc:creator>
      <dc:date>2013-09-19T08:19:16Z</dc:date>
    </item>
  </channel>
</rss>

