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

Page 188

Advertising
background image

API Library of Routines

Appendix B

DTL_PUT_FLT

B-57

Puts a floating point value into a byte array. You can use this array to write
to a data item whose PLC data type is FLOAT and whose coprocessor data
type is RAW.

C Syntax

#include <copro.h>

unsigned DTL_PUT_FLT (in_val, out_buf)

float in_val;
unsigned char *out_buf;

Parameters

in_val

The control-coprocessor floating-point value.

out_buf

Specifies an array of four bytes that will receive the floating-
point value.

Returns

Status

Symbolic Name

Meaning

0

DTL_SUCCESS

Operation successful

41

DTL_CNVT

Data conversion error (BASIC only)

Description

Use the DTL_PUT_FLT to convert a control-coprocessor float to a 4-byte
array in IEEE 32-bit binary format and place it into the byte array.

C Example

unsigned status;

unsigned char untyped_data[50];

float flt_val;

.

.

.

status = DTL_PUT_FLT (flt_val, &untyped_data[10]);

DTL_PUT_FLT

Advertising