<?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: single ASCII char to byte in LabVIEW</title>
    <link>https://forums.ni.com/t5/LabVIEW/single-ASCII-char-to-byte/m-p/393365#M196330</link>
    <description>&lt;DIV&gt;The cast operation provided above gives you the ascii-code of the character. So "53" for string 5 is correct (char 5 = 0x35 = 53d).&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;The conversion just converts the string to a number. This means instead of a string you now have a numeric value with the same value.&lt;/DIV&gt;</description>
    <pubDate>Wed, 19 Jul 2006 14:01:39 GMT</pubDate>
    <dc:creator>becktho</dc:creator>
    <dc:date>2006-07-19T14:01:39Z</dc:date>
    <item>
      <title>single ASCII char to byte</title>
      <link>https://forums.ni.com/t5/LabVIEW/single-ASCII-char-to-byte/m-p/393314#M196300</link>
      <description>&lt;DIV&gt;Is there a straight-forward way to convert a single ASCII char to a byte.&lt;/DIV&gt;
&lt;DIV&gt;I know that I can convert a string to an array of bytes.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;In text-based code, I would simply AND the char with 0x0f, but the booleans do not allow string inputs.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;I am sure that this has been asked before, but I just spent about ten minutes and couldn't find a directly related thread.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Any ideas are appreciated.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Wed, 19 Jul 2006 12:48:50 GMT</pubDate>
      <guid>https://forums.ni.com/t5/LabVIEW/single-ASCII-char-to-byte/m-p/393314#M196300</guid>
      <dc:creator>jspaarg</dc:creator>
      <dc:date>2006-07-19T12:48:50Z</dc:date>
    </item>
    <item>
      <title>Re: single ASCII char to byte</title>
      <link>https://forums.ni.com/t5/LabVIEW/single-ASCII-char-to-byte/m-p/393327#M196308</link>
      <description>&lt;DIV&gt;This should work.&lt;/DIV&gt;</description>
      <pubDate>Wed, 19 Jul 2006 13:09:03 GMT</pubDate>
      <guid>https://forums.ni.com/t5/LabVIEW/single-ASCII-char-to-byte/m-p/393327#M196308</guid>
      <dc:creator>becktho</dc:creator>
      <dc:date>2006-07-19T13:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: single ASCII char to byte</title>
      <link>https://forums.ni.com/t5/LabVIEW/single-ASCII-char-to-byte/m-p/393340#M196315</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;P&gt;Thanks for the try, but I am still in the dark ages of 7.1.&lt;/P&gt;
&lt;P&gt;I should probably mention that on all future posts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The way that I do it right now is just use the string conversion of decimal string to number for just one character.&lt;/P&gt;
&lt;P&gt;Is that the best way?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps it is my old "cycle counting dinosaur" mentality, but that just seems inefficient for a single byte.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2006 13:25:47 GMT</pubDate>
      <guid>https://forums.ni.com/t5/LabVIEW/single-ASCII-char-to-byte/m-p/393340#M196315</guid>
      <dc:creator>jspaarg</dc:creator>
      <dc:date>2006-07-19T13:25:47Z</dc:date>
    </item>
    <item>
      <title>Re: single ASCII char to byte</title>
      <link>https://forums.ni.com/t5/LabVIEW/single-ASCII-char-to-byte/m-p/393341#M196316</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;No problem - so a picture should help you..&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;IMG src="http://forums.ni.com/attachments/ni/170/196316/1/ScreenShot016.png" /&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;Message Edited by becktho on &lt;SPAN class="date_text"&gt;07-19-2006&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;03:30 PM&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2006 13:29:52 GMT</pubDate>
      <guid>https://forums.ni.com/t5/LabVIEW/single-ASCII-char-to-byte/m-p/393341#M196316</guid>
      <dc:creator>becktho</dc:creator>
      <dc:date>2006-07-19T13:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: single ASCII char to byte</title>
      <link>https://forums.ni.com/t5/LabVIEW/single-ASCII-char-to-byte/m-p/393361#M196327</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;P&gt;When I run the cast with a string constant of "5", the output is 53.&lt;/P&gt;
&lt;P&gt;When I run a string conversion, I get 5.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;They both consistently take about 120 ms for 1,000,000 conversions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any idea why the incorrect value?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2006 13:56:59 GMT</pubDate>
      <guid>https://forums.ni.com/t5/LabVIEW/single-ASCII-char-to-byte/m-p/393361#M196327</guid>
      <dc:creator>jspaarg</dc:creator>
      <dc:date>2006-07-19T13:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: single ASCII char to byte</title>
      <link>https://forums.ni.com/t5/LabVIEW/single-ASCII-char-to-byte/m-p/393364#M196329</link>
      <description>&lt;DIV&gt;Duh&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;The cast is to the numeric&amp;nbsp;value (0x35, 35d) not the value represented by the ASCII char.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;I guess I will stick with the string conversion.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Thanks&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Wed, 19 Jul 2006 14:01:02 GMT</pubDate>
      <guid>https://forums.ni.com/t5/LabVIEW/single-ASCII-char-to-byte/m-p/393364#M196329</guid>
      <dc:creator>jspaarg</dc:creator>
      <dc:date>2006-07-19T14:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: single ASCII char to byte</title>
      <link>https://forums.ni.com/t5/LabVIEW/single-ASCII-char-to-byte/m-p/393365#M196330</link>
      <description>&lt;DIV&gt;The cast operation provided above gives you the ascii-code of the character. So "53" for string 5 is correct (char 5 = 0x35 = 53d).&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;The conversion just converts the string to a number. This means instead of a string you now have a numeric value with the same value.&lt;/DIV&gt;</description>
      <pubDate>Wed, 19 Jul 2006 14:01:39 GMT</pubDate>
      <guid>https://forums.ni.com/t5/LabVIEW/single-ASCII-char-to-byte/m-p/393365#M196330</guid>
      <dc:creator>becktho</dc:creator>
      <dc:date>2006-07-19T14:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: single ASCII char to byte</title>
      <link>https://forums.ni.com/t5/LabVIEW/single-ASCII-char-to-byte/m-p/393369#M196332</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;Sorry - I misunderstood your first post obviously. If you just want a numeric value instead of a string, the conversion function is the way to go. There is not really an alternative to that.</description>
      <pubDate>Wed, 19 Jul 2006 14:03:54 GMT</pubDate>
      <guid>https://forums.ni.com/t5/LabVIEW/single-ASCII-char-to-byte/m-p/393369#M196332</guid>
      <dc:creator>becktho</dc:creator>
      <dc:date>2006-07-19T14:03:54Z</dc:date>
    </item>
  </channel>
</rss>

