Vaisala PMB100 Bedienungsanleitung Seite 14

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 14
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 13
USER'S GUIDE_______________________________________________________________________
14 ___________________________________________________________________ M010035EN-A
The form of coefficients (32-bit signed integer) in the eeprom:
MSB LSB MSB LSB MSB LSB MSB LSB
eeprom: byte_0 xxxxxxxx byte_1 xxxxxxxx byte_2 xxxxxxxx byte_3 xxxxxxxx
long_int: bit_31 xxxxxxxx bit_23 xxxxxxxx bit_15 xxxxxxxx bit_7 xxxxxxxx bit_0
MSB LSB
32-bit signed integer FLOAT (1.0...-1.0)
float=signed_long_int/2^31
In following there is an example of C-program to convert the 32 bit
coefficients to floating point numbers.
unsigned char read_eeprom(addr)
{
/* eeprom read routine */
return(read_data);
}
/*------------------------------------------------------
-------------------- -------------------*/
void read_long_int( char addr, long int *coef )
{
unsigned char *pointer=(char*)coef;
*pointer++=read_eeprom(addr++);
*pointer++=read_eeprom(addr++);
*pointer++=read_eeprom(addr++);
*pointer=read_eeprom(addr);
}
/*------------------------------------------------------
-------------------- -------------------*/
void main(void)
{
long int long_coef=0; /* signed long integer
(32 bit) */
float float_coef=0.;
read_long_int(14,&long_coef);
float_coef=(float)long_coef/0x80000000;
printf("Float is %e\r\n",float_coef);
}
Seitenansicht 13
1 2 ... 9 10 11 12 13 14

Kommentare zu diesen Handbüchern

Keine Kommentare