Returns, Description, Valid definition examples – Rockwell Automation 1771-DMC_DMC1_DMC4_DXPS Control Coprocessor User Manual User Manual
Page 217
![background image](/manuals/579606/217/background.png)
API Library of Routines
Appendix B
DTL_WRITE_W_IDX
B-86
Returns
Status
Symbolic Name
Meaning
0
DTL_SUCCESS
Operation successful
15
DTL_E_R_ONLY
Data item defined as READ only
19
DTL_E_NOINIT
DEFINE table not initialized
20
DTL_E_BADID
Definition ID out of range
24
DTL_E_FAIL
I/O completed with errors
32
DTL_E_NODEF
No such data item defined
41
DTL_E_CNVT
DataĆconversion error, I/O not attempted
157
CC_E_NOTCONNECT
PLC is not connected or offline
Description
Use the DTL_WRITE_W_IDX function to write a file to the PLC-5
programmable controller connected directly to the control coprocessor.
This function is synchronous. When this function is initiated, your
C application program stops until the function completes or fails.
To use this function, 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)*/