Dtl_get_flt – Rockwell Automation 1771-DMC_DMC1_DMC4_DXPS Control Coprocessor User Manual User Manual

Page 178

Advertising
background image

API Library of Routines

Appendix B

DTL_GET_FLT

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

0

DTL_SUCCESS

Operation successful

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

Advertising