<?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 回复： Problem sending 2D array over TCP/IP in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/Problem-sending-2D-array-over-TCP-IP/m-p/1047056#M465403</link>
    <description>I have did some modification for your TCP-transmit.vi, see attached. it should be&amp;nbsp;run normally.</description>
    <pubDate>Sun, 03 Jan 2010 07:59:50 GMT</pubDate>
    <dc:creator>ronke</dc:creator>
    <dc:date>2010-01-03T07:59:50Z</dc:date>
    <item>
      <title>Problem sending 2D array over TCP/IP</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Problem-sending-2D-array-over-TCP-IP/m-p/1047051#M465400</link>
      <description>&lt;P&gt;Hello 2 all !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By using the attached vi's, i'm trying to send and receive a 2d array over tcp/ip, but i get a&amp;nbsp; "out of memory" error from LabView.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where is the problem ?... I've adapted the examples provided by ni, but somewhere there seems to be a problem.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you 4 your time ! &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P.S. I'm using LabView 8.5.1 on Windows XP SP2 &lt;/P&gt;</description>
      <pubDate>Sun, 03 Jan 2010 07:25:53 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Problem-sending-2D-array-over-TCP-IP/m-p/1047051#M465400</guid>
      <dc:creator>AndreiN2014</dc:creator>
      <dc:date>2010-01-03T07:25:53Z</dc:date>
    </item>
    <item>
      <title>回复： Problem sending 2D array over TCP/IP</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Problem-sending-2D-array-over-TCP-IP/m-p/1047056#M465403</link>
      <description>I have did some modification for your TCP-transmit.vi, see attached. it should be&amp;nbsp;run normally.</description>
      <pubDate>Sun, 03 Jan 2010 07:59:50 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Problem-sending-2D-array-over-TCP-IP/m-p/1047056#M465403</guid>
      <dc:creator>ronke</dc:creator>
      <dc:date>2010-01-03T07:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: Problem sending 2D array over TCP/IP</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Problem-sending-2D-array-over-TCP-IP/m-p/1047057#M465404</link>
      <description>&lt;P&gt;Your transmit does not sent the number of bytes before the number of columns. So the datatypes don't match. Fix the Transmit VI in this way:&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/5e31977708a18ca67d0af9d2de55954b14d9a758/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f3838333269343133353038374437414637353543322f696d6167652d73697a652f6f726967696e616c3f763d6d70626c2d312670783d2d31" border="0" alt="TCP-Transmit_BD.png" title="TCP-Transmit_BD.png" align="CENTER" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ton &lt;/P&gt;</description>
      <pubDate>Sun, 03 Jan 2010 08:03:49 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Problem-sending-2D-array-over-TCP-IP/m-p/1047057#M465404</guid>
      <dc:creator>TCPlomp</dc:creator>
      <dc:date>2010-01-03T08:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: 回复： Problem sending 2D array over TCP/IP</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Problem-sending-2D-array-over-TCP-IP/m-p/1047062#M465407</link>
      <description>Thank you very much 4 your quick and great answers ! &lt;A href="http://forums.ni.com/t5/util/emoticonspopuppage" class="emoticon-link" target="_blank"&gt;&lt;IMG src="http://forums.ni.com/i/smilies/16x16_smiley-wink.gif" border="0" alt=":smileywink:" title="Smiley Wink" /&gt;&lt;/A&gt;</description>
      <pubDate>Sun, 03 Jan 2010 10:32:59 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Problem-sending-2D-array-over-TCP-IP/m-p/1047062#M465407</guid>
      <dc:creator>AndreiN2014</dc:creator>
      <dc:date>2010-01-03T10:32:59Z</dc:date>
    </item>
    <item>
      <title>Re: 回复： Problem sending 2D array over TCP/IP</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Problem-sending-2D-array-over-TCP-IP/m-p/1047103#M465438</link>
      <description>&lt;P&gt;Your code still is overly complicated and does unecessary expensive operations (such as formatting) and inflates the data to be transmitted while causing a dramatic loss in precision. Formatting also adds significant amounts of code on both ends for no benefit at all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is no need to format into a 2D array of strings just to scan it back to 2D DBL array&amp;nbsp;at the other end.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First you lose about 2/3 of the DBL precision (at least 10 decimal digits out of 15 are dropped, leaving you with only 5 decimal digits!) while inflating the data to be transmitted by 36%. Formatting and scanning operations are expensive in terms of CPU!&amp;nbsp;Why do all that work for nothing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see, you can flatten the 2D DBL array directly and unflatten it later in the same way. Now the data is bit-by-bit identical (lossless!) on the other end and you transmitted&amp;nbsp;significantly fewer bytes&amp;nbsp;as a bonus.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also note that if you place a small "built array" inside the FOR loop, you don't need to transpose. Again, less code!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe the image can illustrate what I was trying to say. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://forums.ni.com/ni/attachments/ni/170/465438/1/2DFlatten.png" border="0" width="607" height="179" align="center" /&gt;&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by altenbach on &lt;/SPAN&gt;&lt;SPAN class="local-date"&gt; 01-03-2010&lt;/SPAN&gt;&lt;SPAN class="local-time"&gt; 10:43 AM&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 03 Jan 2010 18:43:46 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Problem-sending-2D-array-over-TCP-IP/m-p/1047103#M465438</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2010-01-03T18:43:46Z</dc:date>
    </item>
  </channel>
</rss>

