How to use dtl functions – Rockwell Automation 1771-DMC_DMC1_DMC4_DXPS Control Coprocessor User Manual User Manual
Page 63

Chapter 5
Developing Programs
5-3
Use the DTL library of commands to access real-time data from the data
table of a direct-connect PLC-5 programmable controller. The data is
transferred between the control coprocessor and the PLC-5 processor via
the connector interface between the two devices.
This section defines the available commands. For more details, see
Appendix B, Application Program Interface Routines.
Important: You must use the DTL_INIT function to initialize the
data-table library before using any data-transfer, data-definition, or
chassis-control functions
Configuration Functions
Use configuration functions to initialize the DTL software and establish an
internal data-definition table for data items. See Table 5.C.
Table 5.C
DTL Configuration Functions
Function
What It Does
Why You Need It
When You Use It
DTL_INIT
Creates and initializes the
dataĆdefinition table
You must establish the dataĆdefinition
table before you call DTL functions
It is required and must be in the DTL function called in
your program; you should call it only once per program
DTL_C_DEFINE Adds a data definition to the
dataĆdefinition table
For data transfer solicited by a C
applicationprogram
Required for C code data items
DTL_UNDEF
Deletes a data definition from
the dataĆdefinition table
To free the dataĆdefinition table entry
to be reused for another data item
Should be called when a definition is no longer needed
DTL_DEF_AVAIL Returns the number of data
definitions that can be added
to the dataĆdefinition table
To check that you do not define more
data items thanthe dataĆdefinition
table canhold
When you want to keep track of how many definitions
have been defined at one time
Read/Write Access Functions
Use read/write access functions to exchange data between the directly
connected PLC-5 programmable controller and the control coprocessor.
See Table 5.D. The read/write functions listed are synchronous to the
application program; and they are all control-coprocessor initiated.
The DTL read/write functions are the quickest ways for the control
coprocessor to access data in an attached PLC-5 programmable controller.
Every read or write interrupts the programmable controller’s ladder-
program scan for approximately 1 msec, regardless of the length of the
transfer; therefore, you should make fewer transfers with greater transfer
lengths rather than several small transfers. The amount of time that it takes
for the coprocessor to retrieve data and have it available for the application
program follows this linear formula:
Time
(msec)
=
1.2
msec
+
(0.012
msec
x
number
of
words)
How to Use DTL Functions