User`s guide

40 DC 900-1339H
FMP Programmer’s Guide
3.2 Example FMP Call Sequences
Table 3–1 shows the sequence of DLI function calls to send and receive data using
blocking I/O. Table 3–2 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 3.1.3 on page 38 describes blocking and non-blocking I/O.
Note
The example call sequences assume that the cfgLink and enable
DLI configuration parameters are both set to “yes” (the defaults).
This means that
dlOpen configures and enables the ICP links.
Figure 5–2 on page 103 shows an example DLI configuration file.
Table 3–1: DLI Call Sequence for FMP (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 requests and data to Freeway (Section 3.4 on page 45).
5. Call dlRead to receive responses and data from Freeway (Section 3.5 on page 60).
6. Repeat Step 4 and Step 5 until you are finished writing and reading.
7. Call dlBufFree for all buffers allocated in Step 3.
8. Call dlClose for each session ID obtained in Step 2.
9. Call dlTerm to terminate your applications access to Freeway.