Returns, Description, C example – Rockwell Automation 1771-DMC_DMC1_DMC4_DXPS Control Coprocessor User Manual User Manual

Page 172

Advertising
background image

API Library of Routines

Appendix B

DTL_C_DEFINE

B-41

CC Data Type: Is:

CC Data Type: Is:

RAW

no conversion

LONG

int (signed)

BYTE

char (signed)

ULONG

unsigned int

UBYTE

unsigned char

FLOAT

float

WORD

¬

short (signed)

DOUBLE

double

UWORD

unsigned short

¬

Default is WORD

[access type]

Optional; legal access rights are:

* READ = read only
* MODIFY = read or write

Default is modify.

Returns

Status

Symbolic Name

Meaning

0

DTL_SUCCESS

Operation successful

03

DTL_E_DEFBAD2

Invalid number of elements to DEFINE

04

DTL_E_DEFBAD3

Invalid data type

05

DTL_E_DEFBAD4

Invalid access rights

09

DTL_E_DEFBADN

Invalid number of DEFINE parameters

11

DTL_E_FULL

Data DEFINE table is full

16

DTL_E_INVTYPE

Data is invalid type for operation

19

DTL_E_NOINIT

DEFINE table not initialized

31

DTL_E_TOOBIG

Data item greater than maximum allowed

38

DTL_E_DFBADADR

Bad DEFINE address

40

DTL_E_INPTOOLONG

DEFINE input string too long

Description

Use the DTL_C_DEFINE function to add a data definition to the table of
data definitions for the calling task. The DTL_C_DEFINE routine returns
a handle with which the calling task can refer to the data item in
subsequent DTL calls. You must use the DTL_C_DEFINE function to
create an entry for each contiguous range of data-table locations you need.

C Example

unsigned fred;

/*handle used in later DTL_READ_W or

DTL_WRITE_W calls*/

unsigned status;

status = DTL_C_DEFINE (&fred,“N10:2,10,WORD,READ”);

Advertising