<?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 How to convert a string to hex in TestStand in NI TestStand</title>
    <link>https://forums.ni.com/t5/NI-TestStand/How-to-convert-a-string-to-hex-in-TestStand/m-p/2944788#M46292</link>
    <description>&lt;P&gt;Hi everyone, I think this is a fairly easy question to answer but I am newer to TestStand.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In one step I am pulling in the Serial Number of a Device (which is alpha and numeric characters) and storing it as a String Local called Local.SerialNumberString. &amp;nbsp;In the following step I need to convert this Local to a Hex value and store it as Locals.SerialNumberHex&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the data representation I need to take place:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Locals.SerialNumberString = ABC123456&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and would like to know of a function that would convert to the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Locals.SerialNumberHex =&amp;nbsp;414243313233343536&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can this be done?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks so much!&lt;/P&gt;</description>
    <pubDate>Wed, 06 Aug 2014 15:17:47 GMT</pubDate>
    <dc:creator>testdesign</dc:creator>
    <dc:date>2014-08-06T15:17:47Z</dc:date>
    <item>
      <title>How to convert a string to hex in TestStand</title>
      <link>https://forums.ni.com/t5/NI-TestStand/How-to-convert-a-string-to-hex-in-TestStand/m-p/2944788#M46292</link>
      <description>&lt;P&gt;Hi everyone, I think this is a fairly easy question to answer but I am newer to TestStand.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In one step I am pulling in the Serial Number of a Device (which is alpha and numeric characters) and storing it as a String Local called Local.SerialNumberString. &amp;nbsp;In the following step I need to convert this Local to a Hex value and store it as Locals.SerialNumberHex&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the data representation I need to take place:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Locals.SerialNumberString = ABC123456&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and would like to know of a function that would convert to the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Locals.SerialNumberHex =&amp;nbsp;414243313233343536&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can this be done?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks so much!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Aug 2014 15:17:47 GMT</pubDate>
      <guid>https://forums.ni.com/t5/NI-TestStand/How-to-convert-a-string-to-hex-in-TestStand/m-p/2944788#M46292</guid>
      <dc:creator>testdesign</dc:creator>
      <dc:date>2014-08-06T15:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a string to hex in TestStand</title>
      <link>https://forums.ni.com/t5/NI-TestStand/How-to-convert-a-string-to-hex-in-TestStand/m-p/2944886#M46294</link>
      <description>&lt;P&gt;It looks like what you are asking for is more than just converting to hex, it looks like you want to convert the characters in the string to their ascii value representation and then convert that to hex.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) Use a for loop Locals.i = 0; Locals.i &amp;lt; Len(Locals.SerialNumberString); Locals.i++&lt;/P&gt;
&lt;P&gt;2) Inside the loop do: Locals.SerialNumberHex += Str(Asc(Mid(Locals.SerialNumberString, Locals.i, 1)), "%.2x")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;-Doug&lt;/P&gt;</description>
      <pubDate>Wed, 06 Aug 2014 16:47:31 GMT</pubDate>
      <guid>https://forums.ni.com/t5/NI-TestStand/How-to-convert-a-string-to-hex-in-TestStand/m-p/2944886#M46294</guid>
      <dc:creator>dug9000</dc:creator>
      <dc:date>2014-08-06T16:47:31Z</dc:date>
    </item>
  </channel>
</rss>

