Dtl_put_4bcd – Rockwell Automation 1771-DMC_DMC1_DMC4_DXPS Control Coprocessor User Manual User Manual
Page 194
API Library of Routines
Appendix B
DTL_PUT_4BCD
B-63
Puts a 4-digit BCD value into a byte array.
C Syntax
#include <copro.h>
unsigned DTL_PUT_4BCD (in_val, out_buf)
unsigned in_val;
unsigned char *out_buf;
Parameters
in_val
The word value to be encoded into the byte array.
out_buf
Specifies an array of two bytes that will receive the converted
4-digit BCD value.
Returns
Status
Symbolic Name
Meaning
0
DTL_SUCCESS
Operation successful
41
DTL_E_CNVT
DataĆconversion error
Description
Use the DTL_PUT_4BCD to accept a longword integer value in
control-coprocessor format in the range of 0 to 9999. It converts the
control-coprocessor unsigned to a 2-byte, 4-digit BCD value and places
the result in the specified 2-byte array.
C Example
unsigned status;
unsigned char untyped_data[50];
unsigned word_val;
.
.
.
status = DTL_PUT_4BCD (word_val, &untyped_data[10]);
DTL_PUT_4BCD