キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

How to make calculation based on hex display?

解決済み
解決策を見る

I am trying to convert a float number to hex, then get the sum of each byte. Please see attached pic, e.g. 30.5 convert to 403E 8000 0000 0000 using hex dispaly. I want to get the sum of each byte, 40+3E+80+00+00+00+00+00, how could I do it in the labview.

 

Any help will be greatly appreciated!

 

Stephen

0 件の賞賛
メッセージ1/5
3,352件の閲覧回数
解決策
受理者 stephenzhou74

I didn't try, but I think you can use "String to Byte Array" and then add the array elements.

 

Hope this helps,

Daniel

 

0 件の賞賛
メッセージ2/5
3,348件の閲覧回数
Thanks a lot! It works!
0 件の賞賛
メッセージ3/5
3,340件の閲覧回数
You can eliminate one more step by typecasting the dbl directly to an u8 array.
Message Edited by altenbach on 05-08-2010 04:58 AM
0 件の賞賛
メッセージ4/5
3,321件の閲覧回数

One thing to take care:

The sum of the U8 array might easily be > 255, so the U8 containing the sum might overflow. To prevent this you might have to transform the array to U16.

 

0 件の賞賛
メッセージ5/5
3,289件の閲覧回数