Download Optimus User Manual, Version 1.1 Released March 2015
Transcript
Appendix A: Continued
The RAW four (4) byte integer format contains an array of signed 32 bit values.
Each value has been complemented before promotion to a long. Therefore, the
values are in the range 0x00007FFF = positive full scale to 0xFFFF8000 =
negative full scale. In signed long integer; 32767 to -32768. The values must
be converted to host Endian order.
Unsigned short int nVals = ntohs(* (unsigned short int *)
&strmpkt. nVals) ;
long dataArray[ nVals] ;
Unsigned int loopctl;
Idx = strmpkt. data;
For(loopctl = 0; loopctl ++; loopctl < nVals) {
dataArray[ loopctl] = (signed long) ntohl(* (unsigned long *) tmp) ;
}
idx += 4;
The IEEE 754 values are the result of a conversion of the RAW A/D values;
either into volts using the analog bit weight of the A/D converter or
Engineering Units using the current EU pressure coefficients. The values are
complete and, presuming ideal installation and sufficient averaging, are
accurate to within the system specification.
The IEEE 754 floating point values, from a code standpoint, are simply a
modification of the RAW four (4) byte data. This is an array of single precision
floating point values, the length of the array being the value of short integer
conversion of the parameter strmpkt.nVals.
Unsigned short int nVals = ntohs(* (unsigned short int *)
&strmpkt. nVals) ;
single dataArray[ nVals] ;
Unsigned int loopctl;
Idx = strmpkt. data;
For(loopctl = 0; loopctl ++; loopctl < nVals) {
dataArray[ loopctl] = (single) ntohl(* (unsigned long *) tmp) ;
}
idx += 4;
Appendix A: Host Response Formats, Page 192