취소
다음에 대한 결과 표시 
다음에 대한 검색 
다음을 의미합니까? 

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,351 조회수
솔루션
승인자 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,347 조회수
Thanks a lot! It works!
0 포인트
3/5 메시지
3,339 조회수
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,320 조회수

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,288 조회수