User guide

8: Client Applications DLI Overview
DC 900-1338I 153
8.2 Example Call Sequences
Ta bl e 8 3 shows the sequence of DLI function calls to send and receive data using
blocking I/O. Ta ble 8 4 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. Refer back to Section 8.1.2 on page 151 for more information on
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 81 on page 145 shows an example
DLI configuration file.
Table 83: DLI Call Sequence for 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 send an attach request to Freeway.
5. Call dlRead to receive the protocol session ID from Freeway.
6. Call dlWrite to send a configuration message to Freeway.
7. Call dlRead to receive the configuration confirmation from Freeway.
8. Call dlWrite to send a link activation message to Freeway.
9. Call dlRead to receive the link activation confirmation from Freeway.
10. Call dlWrite to send requests and data to Freeway.
11. Call dlRead to receive responses and data from Freeway.
12. Repeat Step 10 and Step11 until you are finished writing and reading.
13. Call dlBufFree for all buffers allocated in Step3.
14. Call dlClose for each session ID obtained in Step 2.
15. Call dlTerm to terminate your applications access to Freeway.