<?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: Hex string to 32 bit float in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/990406#M443192</link>
    <description>&lt;P&gt;Hello Ravens,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apart from getting my problem solved, this thread has been really useful in understanding certain functions like the TypeCast and Swap Words. One glance at the way they are used and the function is clear.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There could be an argument that there is the help file. There are times when you need help to understand "help" files - particularly for functions in the Advanced palatte !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;</description>
    <pubDate>Thu, 24 Sep 2009 08:52:43 GMT</pubDate>
    <dc:creator>MogaRaghu</dc:creator>
    <dc:date>2009-09-24T08:52:43Z</dc:date>
    <item>
      <title>Hex string to 32 bit float</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/983281#M440296</link>
      <description>&lt;P&gt;I am getting data over the serial port as a string of U8 bytes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I convert the string to a sub string which reads 3B43 CD7B which corresponds to a value of 410.0&amp;nbsp;.( Or in other words my conversion should result in this value )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to feed the&amp;nbsp;above sub string to a typecast set for &amp;nbsp;double. But the value reads as&amp;nbsp; 3.27607E-23.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any hints ? &lt;/P&gt;</description>
      <pubDate>Sun, 13 Sep 2009 11:11:44 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/983281#M440296</guid>
      <dc:creator>MogaRaghu</dc:creator>
      <dc:date>2009-09-13T11:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: Hex string to 32 bit float</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/983292#M440302</link>
      <description>&lt;P&gt;Sorry, but something or someone (possibly me) is seriously confused.&lt;/P&gt;&lt;P&gt;To convert the string "3B43CD7B" into a U32 requires a SCAN FROM STRING with a "%x" (hex) specifier.&lt;/P&gt;&lt;P&gt;Outputs 1 and 2 in the pic show that this is done correctly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you cast that to a SGL, you get 0.00298.&lt;/P&gt;&lt;P&gt;I don't know why you would cast it to a DBL, a 4-byte float is a SGL.&lt;/P&gt;&lt;P&gt;If you reverse the byte order, you get a huge (E+36) number, so that's not it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/ef794c37f77104fbb4c53384570c92e7db124d77/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f3433303869324336453331334346394331423031362f696d6167652d73697a652f6f726967696e616c3f763d6d70626c2d312670783d2d31" border="0" alt="Hex.PNG" title="Hex.PNG" align="CENTER" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you take the binary number (00111011010000111100110101111011) &amp;nbsp;apart, according to IEE 754 (standard SGL format), you get:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sign = 0 = positive.&lt;/P&gt;&lt;P&gt;exponent = 01110110 (118) - bias (127) = -9&lt;/P&gt;&lt;P&gt;mantissa = &amp;nbsp;100001111.... = 271 / 512 = 0.529297&lt;/P&gt;&lt;P&gt;Accounting for the assumed MSB makes it 1.529297&amp;nbsp;&lt;/P&gt;&lt;P&gt;2 ^ -9 = &amp;nbsp;0.001953&lt;/P&gt;&lt;P&gt;1.529297 * 0.001953 = 0.002987 &amp;nbsp;(I didn't carry all the digits).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So that conversion is correct.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't see how to get 410.0 from the data you gave us.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Sep 2009 12:16:57 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/983292#M440302</guid>
      <dc:creator>CoastalMaineBird</dc:creator>
      <dc:date>2009-09-13T12:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: Hex string to 32 bit float</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/983293#M440303</link>
      <description>&lt;P&gt;&lt;SPAN style="font-family: Arial, Arial, Helvetica; font-size: 13px; line-height: normal; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px" class="Apple-style-span"&gt;&lt;EM&gt;I convert the string to a sub string which reads 3B43 CD7B&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;--- Perhaps an error occurs there. &amp;nbsp;Perhaps you're pulling the wrong pieces out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Converting 410.0 to SGL results in a value of 43CD0000 &amp;nbsp;Notice the 43CD similarity?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"3B" is ASCII code for ";" (semicolon).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looks like you're not accounting for something in your string.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Sep 2009 12:26:51 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/983293#M440303</guid>
      <dc:creator>CoastalMaineBird</dc:creator>
      <dc:date>2009-09-13T12:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: Hex string to 32 bit float</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/984215#M440710</link>
      <description>&lt;P&gt;&lt;FONT color="#000000"&gt;Hello Steve,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Thanks for the analysis. And trying to typecast a 32 bit to a double was a mistake, that happened over many iterations of different combinations !&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Will collect a few more samples and try out based on the hints you gave. Shall revert shortly.&lt;/FONT&gt;&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by Raghunathan on &lt;/SPAN&gt;&lt;SPAN class="local-date"&gt; 09-14-2009&lt;/SPAN&gt;&lt;SPAN class="local-time"&gt; 09:26 PM&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 15 Sep 2009 02:26:07 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/984215#M440710</guid>
      <dc:creator>MogaRaghu</dc:creator>
      <dc:date>2009-09-15T02:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: Hex string to 32 bit float</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/984515#M440828</link>
      <description>As mentioned your return string seems to start with ";" removing that and removing the space results in "43CD7b" which is wrong, but adding "00" to the end for a total of "43CD7b00" results in 410,961 when typecasted to single according to previous diagram.

Could that be the problem?

/Y</description>
      <pubDate>Tue, 15 Sep 2009 13:30:09 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/984515#M440828</guid>
      <dc:creator>Yamaeda</dc:creator>
      <dc:date>2009-09-15T13:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Hex string to 32 bit float</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/984528#M440833</link>
      <description>You will need to verify the format of the data that you will be reading and parse it correctly. As you can see from this example there is other information being returned from your device besides the raw data. What type of device are you communicating with? Do you have the spec for it? This would be a good place to start.&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by Mark Yedinak on &lt;/SPAN&gt;&lt;SPAN class="local-date"&gt; 09-15-2009&lt;/SPAN&gt;&lt;SPAN class="local-time"&gt; 08:43 AM&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 15 Sep 2009 13:43:06 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/984528#M440833</guid>
      <dc:creator>Mark_Yedinak</dc:creator>
      <dc:date>2009-09-15T13:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: Hex string to 32 bit float</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/984771#M440922</link>
      <description>&lt;P&gt;Yes of course knowing the type of instrument is a good place to start. It is a EM6400 energy manager from Conzerv( now Schneider). I am attaching the data format details &amp;nbsp;it returns to a query. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am also attaching the full U8 byte array returned by the instrument from where I am trying to "strip" the data value corresponding to 410.0 ( when I captured this is what the instrument was displaying ). &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by Raghunathan on &lt;/SPAN&gt;&lt;SPAN class="local-date"&gt; 09-15-2009&lt;/SPAN&gt;&lt;SPAN class="local-time"&gt; 12:25 PM&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 15 Sep 2009 17:25:11 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/984771#M440922</guid>
      <dc:creator>MogaRaghu</dc:creator>
      <dc:date>2009-09-15T17:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: Hex string to 32 bit float</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/984779#M440927</link>
      <description>&lt;P&gt;It's hard to tell from that doc what you're doing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How are you extracting the string to convert from the string it's supplied in?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks to me like you're extracting 4 bytes from an offset that's off by one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IOW, you're starting at offset 10 when it should be 11, or something.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I suggest you try changing that procedure and seeing what happens.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2009 17:25:27 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/984779#M440927</guid>
      <dc:creator>CoastalMaineBird</dc:creator>
      <dc:date>2009-09-15T17:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: Hex string to 32 bit float</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/984795#M440935</link>
      <description>What is the query that you are sending to the device? From reading the manual, which is not very clear about communications with the device, it can return either a single data element or a block of registers. You should find out exactly what the query you are sending is returning. Perhaps you could send a different query that would return only the piece of information that you want. You may also want to contact the instrument manufacture directly to get better information regarding protocol for communicating with the device.</description>
      <pubDate>Tue, 15 Sep 2009 17:42:34 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/984795#M440935</guid>
      <dc:creator>Mark_Yedinak</dc:creator>
      <dc:date>2009-09-15T17:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: Hex string to 32 bit float</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/984839#M440964</link>
      <description>&lt;P&gt;Raghunathan,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your current code reads two registers at unknown address ?&amp;nbsp; Modify your code to read&amp;nbsp;4 registers starting at the same address and post the resulting array of bytes.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2009 18:32:37 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/984839#M440964</guid>
      <dc:creator>Wayne.C</dc:creator>
      <dc:date>2009-09-15T18:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: Hex string to 32 bit float</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/985043#M441068</link>
      <description>&lt;P&gt;I also wish that thier manual / web site had little more on communication procedures...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Though the EM6400 can send upto 20 different values against a single query, just to keep it simple, I am basically trying to read only value - the line to line AC voltage. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The query is this : 0103 0F44 0002 870A&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;01 : EM6400 Modbus ID&lt;/P&gt;&lt;P&gt;03 : Query type number for reading a register.&lt;/P&gt;&lt;P&gt;0F44 : Address where the Line Voltage is stored. (3908 decimal)&lt;/P&gt;&lt;P&gt;0002 : Number of registers to read. Two 16 bit registers for one 32 bit Single precision value&lt;/P&gt;&lt;P&gt;870A : CRC value&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I know that the above is correct from a third party Modbus checking software ( SimplyModbus 6.3.6), which when used to query the EM6400 with the above query, results in a response of 410.0, which is correct.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As to support from Conzerv, all they can tell is to buy thier ConPad software. This forum is far better.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2009 23:46:14 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/985043#M441068</guid>
      <dc:creator>MogaRaghu</dc:creator>
      <dc:date>2009-09-15T23:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: Hex string to 32 bit float</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/985048#M441071</link>
      <description>&lt;P&gt;Have you tried my suggestion?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems possible that you're extracting the string with an offset that's wrong by one.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2009 23:53:17 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/985048#M441071</guid>
      <dc:creator>CoastalMaineBird</dc:creator>
      <dc:date>2009-09-15T23:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: Hex string to 32 bit float</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/985056#M441078</link>
      <description>&lt;P&gt;Steve,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am yet to try the suggestion. I do feel that it could be a possible way out to try different offsets.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is a large machine and the Modbus link is a small part of it and I will need the machine to try out other possible data reads to check out. Right now other trials are on. And we have issues with LV2009 like charts that do not display minor tick values ; jumble up clusters in a file read / write . We are in touch with NI for solutions and waiting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So now you know that I am not in an enviable position &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; Will keep you posted asap.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2009 00:10:54 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/985056#M441078</guid>
      <dc:creator>MogaRaghu</dc:creator>
      <dc:date>2009-09-16T00:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: Hex string to 32 bit float</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/985395#M441236</link>
      <description>&lt;P&gt;Raghunathan,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The reason I suggested reading 4 registers is because I suspect your register address may be off by 1.&amp;nbsp; Reading 4 would let you see more registers as a test.&amp;nbsp; Another way to verify this is to use NI-Spy to monitor the communications between your third party modbus software and the instrument.&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by Wayne.C on &lt;/SPAN&gt;&lt;SPAN class="local-date"&gt; 09-16-2009&lt;/SPAN&gt;&lt;SPAN class="local-time"&gt; 08:23 AM&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 16 Sep 2009 12:23:30 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/985395#M441236</guid>
      <dc:creator>Wayne.C</dc:creator>
      <dc:date>2009-09-16T12:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: Hex string to 32 bit float</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/989640#M442871</link>
      <description>&lt;P&gt;Hi Steve ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As promised I have been able to get a few more samples and the result values in decimal . Reproduced below is the HEX response byte from the EM6400 and the corresponding decimal result as shown in the SimplyModbus test software :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Response&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Result&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;01 03 04 87 9B 43 73 D3 BD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;243.52971&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6E C8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 17 F0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 243.43274&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ( Giving only values that are different from first row )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 74 B1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C1 31&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 243.45583&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5B B9&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 48 27&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;243.35829&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 42 0B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EF 5C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 243.25798&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4E 5D&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DC 1C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 243.30611&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 44 EB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EE 22&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 243.26921&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;( 01 = Device ID; 03 = query type ; &amp;nbsp;and the last two bytes are the CRC value. Not sure about others)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;Does the above ring any bell ??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2009 10:31:14 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/989640#M442871</guid>
      <dc:creator>MogaRaghu</dc:creator>
      <dc:date>2009-09-23T10:31:14Z</dc:date>
    </item>
    <item>
      <title>Re: Hex string to 32 bit float</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/989653#M442879</link>
      <description>&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, helvetica, clean, sans-serif; font-size: 16px" class="Apple-style-span"&gt;&lt;EM&gt;&amp;nbsp;Does the above ring any bell ??&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's easy enough for YOU to find that out - now that you know the "correct" answers, you can find where the data is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/ce4b6aea58b648558667a728258223c90e8fd110/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f3437333469344531363734304245423936414344372f696d6167652d73697a652f6f726967696e616c3f763d6d70626c2d312670783d2d31" border="0" alt="Picture 2.png" title="Picture 2.png" align="CENTER" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since you know that line 1 (for instance) is 243.52971, that there are 9 bytes in the line, and that 4 of them are accounted for, then you know that it cannot be a DBL, it has to be a SGL (there are no 5-byte floating-point formats).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So type cast a SGL with one of the known values into a U32, and display it in hex.&lt;/P&gt;&lt;P&gt;Find that pattern in your data stream and make a rule for decoding it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2009 10:49:00 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/989653#M442879</guid>
      <dc:creator>CoastalMaineBird</dc:creator>
      <dc:date>2009-09-23T10:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: Hex string to 32 bit float</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/989900#M442971</link>
      <description>&lt;P&gt;Raghunathan,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Byte 1 = Device ID/Address&lt;/P&gt;&lt;P&gt;Byte 2 = Query Type&lt;/P&gt;&lt;P&gt;Byte 3 = # bytes of data&lt;/P&gt;&lt;P&gt;Bytes 4-7 = Data&lt;/P&gt;&lt;P&gt;Bytes 8-9 = CRC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I took your SGL results and type cast them to a U32 and looked at the hex representation.&amp;nbsp; Picture below.&amp;nbsp; Notice that in each case you returned 2 of the 4 bytes correctly.&amp;nbsp; Notice that bytes 4-5 of your returned data matched the two lower bytes of the expected hex data.&amp;nbsp; As I stated previously I'm pretty sure you are using the wrong register address in your modbus query.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://forums.ni.com/t5/image/serverpage/image-id/4752iC4C2AD581160364C/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Example_VI_FP.png" title="Example_VI_FP.png" align="center" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2009 15:30:14 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/989900#M442971</guid>
      <dc:creator>Wayne.C</dc:creator>
      <dc:date>2009-09-23T15:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: Hex string to 32 bit float</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/990241#M443120</link>
      <description>&lt;P&gt;Hi Wayne,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While Steve had pointed the way to find the solution( 1 Kudos) , I was under tremendrous time pressure with other problems. Thanks for the posting with array. I can now work it forward. (Solution!)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2009 01:47:30 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/990241#M443120</guid>
      <dc:creator>MogaRaghu</dc:creator>
      <dc:date>2009-09-24T01:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: Hex string to 32 bit float</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/990264#M443133</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Wayne.C wrote: &lt;BR /&gt;&lt;P&gt;Raghunathan,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Byte 1 = Device ID/Address&lt;/P&gt;&lt;P&gt;Byte 2 = Query Type&lt;/P&gt;&lt;P&gt;Byte 3 = # bytes of data&lt;/P&gt;&lt;P&gt;Bytes 4-7 = Data&lt;/P&gt;&lt;P&gt;Bytes 8-9 = CRC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I took your SGL results and type cast them to a U32 and looked at the hex representation.&amp;nbsp; Picture below.&amp;nbsp; Notice that in each case you returned 2 of the 4 bytes correctly.&amp;nbsp; Notice that bytes 4-5 of your returned data matched the two lower bytes of the expected hex data.&amp;nbsp; As I stated previously I'm pretty sure you are using the wrong register address in your modbus query.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://forums.ni.com/t5/image/serverpage/image-id/4752iC4C2AD581160364C/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Example_VI_FP.png" title="Example_VI_FP.png" align="center" /&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Actually if you look more closely, all 4 bytes are correct, it just formatted that bytes 4-5 are the least significant word and bytes 6,7 are the more significant word.&amp;nbsp; If you do a swap words before typecasting it to a single, it is just fine.&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://forums.ni.com/ni/attachments/ni/170/443133/1/Example_VI.png" border="0" width="300" height="119" align="center" /&gt;&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by Ravens Fan on &lt;/SPAN&gt;&lt;SPAN class="local-date"&gt; 09-23-2009&lt;/SPAN&gt;&lt;SPAN class="local-time"&gt; 10:58 PM&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 24 Sep 2009 02:58:31 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/990264#M443133</guid>
      <dc:creator>RavensFan</dc:creator>
      <dc:date>2009-09-24T02:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: Hex string to 32 bit float</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/990406#M443192</link>
      <description>&lt;P&gt;Hello Ravens,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apart from getting my problem solved, this thread has been really useful in understanding certain functions like the TypeCast and Swap Words. One glance at the way they are used and the function is clear.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There could be an argument that there is the help file. There are times when you need help to understand "help" files - particularly for functions in the Advanced palatte !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2009 08:52:43 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Hex-string-to-32-bit-float/m-p/990406#M443192</guid>
      <dc:creator>MogaRaghu</dc:creator>
      <dc:date>2009-09-24T08:52:43Z</dc:date>
    </item>
  </channel>
</rss>

