User`s guide
2: DDCMP DLI Functions
DC 900-1343D 33
2.3 Example DDCMP Call Sequences
Table 2–2 shows the sequence of DLI function calls to send and receive data using
blocking I/O. Table 2–3 is the non-blocking I/O example. The remainder of this chapter
and the Freeway Data Link Interface Reference Guide give further information about
each function call. Section 2.1.3 on page 27 describes blocking and non-blocking I/O.
Note
The example call sequences assume that the cfgLink and enable
DLI configuration parameters are set to “no” (the default is “yes”
for both). This is necessary for the client application to configure
and enable the ICP links. Figure 2–1 on page 30 shows an example
DLI configuration file.
Table 2–2: DLI Call Sequence for DDCMP (Blocking I/O)
1. Call dlInit to initialize the DLI operating environment.
The first parameter is your DLI binary configuration file name.
2. Call dlOpen for each required session (link) to get a session ID.
3. Call dlBufAlloc for all required input and output buffers.
4. Call dlWrite to attach each session from Step 2 to the ICP (Section 2.2.3 on page 32).
5. Call dlWrite to configure and enable the ICP links (page 41 and page 42).
6. Call dlWrite to send requests and data to Freeway (Section 2.5 on page 40).
7. Call dlRead to receive responses and data from Freeway (Section 2.6 on page 48).
8. Repeat Step 6 and Step 7 until you are finished writing and reading.
9. Call dlWrite to disable the ICP links (Section 2.5.1.4 on page 43).
10. Call dlWrite to detach each session from Step 4 (Section 2.2.4 on page 32).
11. Call dlBufFree for all buffers allocated in Step 3.
12. Call dlClose for each session ID obtained in Step 2.
13. Call dlTerm to terminate your application’s access to Freeway.