Rockwell-automation 1771-DMC_DMC1_DMC4_DXPS Control Coprocessor User M Uživatelský manuál Strana 178

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 312
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 177
 
Appendix B

B-47
Gets a floating-point value from a byte array.
C Syntax
#include <copro.h>
unsigned DTL_GET_FLT (in_buf,out_val)
unsigned char *in_buf;
float *out_val;
Parameters
in_buf
Use to specify an array of four bytes containing an IEEE floating-point
value read from the data table as raw data.
out_val
Contains the floating point value. It is assumed that the bytes are read
into the a data area using the RAW data_type.
Returns
Status Symbolic Name Meaning
  
Description
Use the DTL_GET_FLT to converts raw 32-bit IEEE float data, in 4-byte
array, to host-type float.
C Example
float read_val;
unsigned char untyped_data[60];
unsigned machine, iostat;
.
.
.
DTL_C_DEFINE (&machine, “F8:10,15,RAW,READ”);
if (DTL_READ_W (machine, untyped_data, &iostat) == 0)
{
DTL_GET_FLT (&untyped_data [3], &real_val);
}
DTL_GET_FLT
Zobrazit stránku 177
1 2 ... 173 174 175 176 177 178 179 180 181 182 183 ... 311 312

Komentáře k této Příručce

Žádné komentáře