Returns, Description, Valid definition examples – Rockwell Automation 1771-DMC_DMC1_DMC4_DXPS Control Coprocessor User Manual User Manual

Page 199: Invalid definition example

Advertising
background image

API Library of Routines

Appendix B

DTL_READ_W_IDX

B-68

Returns

Status

Symbolic Name

Meaning

0

DTL_SUCCESS

Operation successful

19

DTL_E_NOINIT

DEFINE table not initialized

20

DTL_E_BADID

Definition ID out of range

24

DTL_E_FAIL

I/O completedwith errors

32

DTL_E_NODEF

No such data item defined

157

CC_E_NOTCONNECT

PLC is not connectedor offline

Description

Use the DTL_READ_W_IDX function to read a file, one element at a
time, from a PLC-5 programmable controller that is directly connected to
the control coprocessor.

This function is synchronous. When this function is initiated, your
C application programs stops until the function completes or fails.

For this function to be successful, the data definition must specify the
address to the first element of the file and the number of data items
must be 1.

You can address structured data types to either the structure level or the
element level. When you address to the structure level, the data type must
be RAW.

Valid Definition Examples

DTL_C_DEFINE (&idl, “N34:0”)

/* specified to element 0,

default 1 item */

DTL_C_DEFINE (&idl, “T4:0.pre”)

/* index 0 accesses T4:0.pre; index 14

accesses T4:14.pre */

DTL_C_DEFINE (&idl, “T4:0,1,raw”)

/* index 0 accesses all three elements of

T4:0 (control, preset, accumulator);

index 14 access all three elements

of T4:14 (control, preset, accumulator)*/

Invalid Definition Example

DTL_C_DEFINE (&idl, “N34:3”)

/* not specified to element 0 */

DTL_C_DEFINE (&idl, “N34:0,3,long”) /* number of items not 1 */

Advertising