Notifications
Clear all

decode DATA of NF5035

2 Posts
2 Users
0 Likes
6,314 Views
 LEIC
(@leic)
New Member
Joined: 8 years ago
Posts: 1
Topic starter  

Hi,

we want to control this device and get result. (NF 5035)
We dont understand the data format.
we read start Frequency command : 20 01 00
Result : 20 00 00 00 00 3F
What can i do for read décimal value of 500 Hz?

We try some methode on your post but nothing work. We try the topic where address is under.
viewtopic.php?f=8&t=953

our code test is :

fred@ ~

$ cat test.c
#include <stdio.h>

uint32_t a = 0x44d5c000, b = 0x3f000000;

void main(void) {
       printf(" a = %04x = %fn", a , (float) a);
       printf(" b = %04x = %fn", b , (float) b);

}

fred@ ~
$ make test
cc     test.c   -o test

fred@ ~
$ ./test
 a = 44d5c000 = 1154859008.000000
 b = 3f000000 = 1056964608.000000 

Thanks for give me an answer.

Hervé Lagosanto
LEIC


   
Quote
(@mm_dev)
Reputable Member Admin
Joined: 13 years ago
Posts: 330
 

You cannot use the value directly unfortunately. First you need to reverse the byte-order, then you need to do a bitlevel conversion to float (using the normal cast operator will do a numeric conversion), check the linked post for an example.


   
ReplyQuote
Share: