decode DATA of NF5035

Support forum for development using SNDK and ASDK

decode DATA of NF5035

Postby LEIC » Thursday 9. June 2016, 17:59

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 :

Code: Select all
fred@ ~

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

uint32_t a = 0x44d5c000, b = 0x3f000000;

void main(void) {
       printf(" a = %04x = %f\n", a , (float) a);
       printf(" b = %04x = %f\n", 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
LEIC
 
Posts: 1
Joined: Tuesday 17. May 2016, 11:48

Re: decode DATA of NF5035

Postby mm_dev » Tuesday 21. June 2016, 01:35

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.
mm_dev
 
Posts: 285
Joined: Wednesday 4. May 2011, 07:43


Return to SNDK + ASDK

Who is online

Users browsing this forum: No registered users and 2 guests