DDCMP Programmer’s Guide DC 900-1343D Simpact, Inc.
Simpact, Inc. 9210 Sky Park Court San Diego, CA 92123 (619) 565-1865 DDCMP Programmer’s Guide © 1996 through 1999 Simpact, Inc. All rights reserved Printed in the United States of America This document can change without notice. Simpact, Inc. accepts no liability for any errors this document might contain. Freeway is a registered trademark of Simpact, Inc. All other trademarks and trade names are the properties of their respective holders.
Contents List of Figures 7 List of Tables 9 Preface 11 1 17 Introduction 1.1 Product Overview . . . . . . . . . . . . . . . . . . . 1.1.1 Freeway Server . . . . . . . . . . . . . . . . . . 1.1.2 Embedded ICP . . . . . . . . . . . . . . . . . . 1.2 Freeway Client-Server Environment . . . . . . . . . 1.2.1 Establishing Freeway Server Internet Addresses 1.3 Embedded ICP Environment . . . . . . . . . . . . . 1.4 Client Operations . . . . . . . . . . . . . . . . . . . 1.4.
DDCMP Programmer’s Guide 2.1.4 Buffer Management . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Using the DLI in the Freeway DDCMP Environment . . . . . . . . 2.2.1 Initializing the DLI . . . . . . . . . . . . . . . . . . . . . . . . 2.2.2 DDCMP DLI Session Configuration . . . . . . . . . . . . . . . 2.2.3 Opening and Attaching DLI Sessions . . . . . . . . . . . . . . 2.2.4 Detaching and Closing DLI Sessions . . . . . . . . . . . . . . . 2.2.5 Error Reporting . . . . . . . . . . . . . . . . . . . . .
Contents 2.6.2.8 DDCMP Maintenance Message Received [140] . . . . 2.6.2.9 Control Message Received in Maintenance Mode [200] 2.6.2.10 Data Message Received in Maintenance Mode [201] . . 2.6.3 Confirmation Responses . . . . . . . . . . . . . . . . . . . . 2.6.4 Reports in Response to dlWrite Information Requests . . . . 3 . . . . . . . . . . . . . . . . . . . . DDCMP Link Configuration Options 3.1 3.2 Data Rate Option . . . . . . Clock Source Option . . . . 3.2.1 External . . . . . . . . . 3.2.
DDCMP Programmer’s Guide C.15 stats-rpt-ack-packet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C.16 status-rpt-packet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C.17 status-rpt-ack-packet . . . . . . . . . . . . . . . . . . . . . . . . . . . .
List of Figures Figure 1–1: Freeway Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Figure 1–2: Embedded ICP Configuration . . . . . . . . . . . . . . . . . . . . . . . . 19 Figure 1–3: A Typical Freeway Server Environment . . . . . . . . . . . . . . . . . . . 22 Figure 2–1: DLI Configuration File for Two DDCMP Links (Freeway Server) . . . . .
DDCMP Programmer’s Guide 8 DC 900-1343D
List of Tables Table 2–1: Include Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Table 2–2: DLI Call Sequence for DDCMP (Blocking I/O) . . . . . . . . . . . . . . 33 Table 2–3: DLI Call Sequence for DDCMP (Non-blocking I/O) . . . . . . . . . . . 34 Table 2–4: DLI Functions: Syntax and Parameters (Listed in Typical Call Order) . . 36 Table 2–5: Required dlWrite Optional Arguments Fields . . . . . . . . . . . . . . .
DDCMP Programmer’s Guide 10 DC 900-1343D
Preface Purpose of Document This document describes the operation and programming interface required to use Simpact’s Digital Data Communications Message Protocol (DDCMP) product, which is a point-to-point serial line protocol. The DDCMP software runs on either a Simpact Freeway communications server or on a Simpact embedded ICPs. The DDCMP implementation complies with the DDCMP Specification, version 4.0, AA-D599A-TC (with a configuration option to use version I2).
DDCMP Programmer’s Guide Required Equipment The DDCMP product requires the following major hardware components to operate: • a Freeway communications server or an embedded ICP that runs the communications software • a client computer that runs the following: • • TCP/IP (for a Freeway server) • the user application program Data link interface (DLI) Organization of Document Chapter 1 is an overview of Freeway and the DDCMP product.
Preface 3/31/99 Leslie: Add DC-9001574, BitStream Simpact References The following documents provide useful supporting information, depending on the customer’s particular hardware and software environments. Most documents are available on-line at Simpact’s web site, www.simpact.com.
DDCMP Programmer’s Guide Embedded ICP Installation and Programming Support • • • • • ICP2432 User’s Guide for Digital UNIX DC 900-1513 ICP2432 User’s Guide for OpenVMS Alpha DC 900-1511 ICP2432 User’s Guide for OpenVMS Alpha (DLITE Interface) DC 900-1516 ICP2432 User’s Guide for Windows NT DC 900-1510 ICP2432 User’s Guide for Windows NT (DLITE Interface) DC 900-1514 Application Program Interface (API) Programming Support • • • Freeway Data Link Interface Reference Guide DC 900-1385 Freeway
Preface • • • • • • Military/Government Protocols Programmer’s Guide DC 900-1602 SIO STD-1200A (Rev. 1) Programmer’s Guide DC 908-1359 SIO STD-1300 Programmer’s Guide DC 908-1559 X.25 Call Service API Guide DC 900-1392 X.25/HDLC Configuration Guide DC 900-1345 X.25 Low-Level Interface DC 900-1307 Document Conventions This document follows the most significant byte first (MSB) and most significant word first (MSW) conventions for bit-numbering and byte-ordering.
DDCMP Programmer’s Guide Revision Release Date DC 900-1343B March 1998 Description • • DC 900-1343C November 1998 • • • DC 900-1343D • • April 1999 • • Add new Freeway overview and Embedded ICP information (Section 1.2 through Section 1.5) Changes to Chapter 2: minor changes to Section 2.2.3 on page 32 and Section 2.3 on page 33, add dlpErrString function (Table 2–4 on page 36), Stop Link DTR control (Section 2.5.1.4 on page 43), and major changes to Section 2.
Chapter 1 Introduction 1.1 Product Overview Most recent modification date: 8/18/98 Leslie: minor mods. Just update when convenient. Simpact provides a variety of wide-area network (WAN) connectivity solutions for real-time financial, defense, telecommunications, and process-control applications. Simpact’s Freeway server offers flexibility and ease of programming using a variety of LAN-based server hardware platforms.
DDCMP Programmer’s Guide To maintain high data throughput, Freeway uses a multi-processor architecture to support the LAN and WAN services. The LAN interface is managed by a single-board computer, called the server processor. It uses the commercially available VxWorks operating system to provide a full-featured base for the LAN interface and layered services needed by Freeway. Freeway can be configured with multiple WAN interface processor boards, each of which is a Simpact ICP.
1: Introduction 1.1.2 Embedded ICP The embedded ICP connects your client computer directly to the WAN (for example, using Simpact’s ICP2432 PCIbus board). The embedded ICP provides client applications with the same WAN connectivity as the Freeway server, using the same data link interface. The ICP runs the communication protocol software using Simpact’s real-time operating system. Figure 1–2 shows the embedded ICP configuration.
DDCMP Programmer’s Guide Summary of product features: • Provision of WAN connectivity either through a LAN-based Freeway server or directly using an embedded ICP • Elimination of difficult LAN and WAN programming and systems integration by providing a powerful and consistent data link interface • Variety of off-the-shelf communication protocols available from Simpact which are independent of the client operating system and hardware platform • Support for multiple WAN communication protocols simulta
1: Introduction 1.2 Freeway Client-Server Environment The Freeway server acts as a gateway that connects a client on a local-area network to a wide-area network. Through Freeway, a client application can exchange data with a remote data link application. Your client application must interact with the Freeway server and its resident ICPs before exchanging data with the remote data link application.
DDCMP Programmer’s Guide Freeway Client Application DLI TSI TCP/IP TCP/IP Socket Interface SRA Msg TSI Mux client1 192.52.107.99 ICP0 ICP1 WAN Protocols ICP2 ICP3 3125 Shared Memory Interface Ethernet Industry Standard Bus Client freeway2 192.52.107.100 Figure 1–3: A Typical Freeway Server Environment 1.
1: Introduction 1.4.2 Opening a Session After the DLI and TSI configurations are properly defined, your client application uses the dlOpen function to establish a DLI session with an ICP link. As part of the session establishment process, the DLI establishes a TSI connection with the Freeway MsgMux through the TCP/IP BSD-style socket interface for the Freeway server, or directly to the ICP driver for the embedded ICP environment. 1.4.
DDCMP Programmer’s Guide • DLI library for linking with client applications • Test program (ddcmpalp.c) to check product installation For a Freeway server, the Freeway User’s Guide describes the software installation procedures, and the Loopback Test Procedures describes how to run the loopback test program. For an embedded ICP, refer to the user’s guide for your particular embedded ICP and operating system (for example, the ICP2432 User’s Guide for Windows NT).
Chapter 2 Note DDCMP DLI Functions In this document, the term “Freeway” can mean either a Freeway server or an embedded ICP. For the embedded ICP, also refer to the user’s guide for your ICP and operating system (for example, the ICP2432 User’s Guide for Windows NT). This chapter describes how to use the data link interface (DLI) functions to write client applications interfacing to the Freeway DDCMP protocol software.
DDCMP Programmer’s Guide • The Freeway Data Link Interface Reference Guide shows a generic code example which can guide your application program development. The loopback test program (ddcmpalp.c) distributed with the product software is another example. • Appendix C provides detailed command and response header formats.. • The various mnemonic codes mentioned throughout this document are defined in the include files provided with this product, which are described in Table 2–1.
2: DDCMP DLI Functions • transport subsystem interface (TSI) connection configuration • protocol-specific ICP link configuration The Freeway server is normally configured only once, during the installation procedures described in the Freeway User’s Guide. DLI session and TSI connection configurations are defined by specifying parameters in DLI and TSI ASCII configuration files and then running two preprocessor programs, dlicfg and tsicfg, to create binary configuration files.
DDCMP Programmer’s Guide In the Freeway environment, the term blocking I/O indicates that the dlOpen, dlClose, dlRead and dlWrite functions do not return until the I/O is complete. For non-blocking I/O, these functions might return after the I/O has been queued at the client, but before the transfer to Freeway is complete.
2: DDCMP DLI Functions 2.2.1 Initializing the DLI The client application calls dlInit to initialize its interface to Freeway. This call specifies a DLI binary configuration file, which is generated off-line from a text file (see Appendix B for details of the configuration process). The text file contains definitions of the sessions that can be opened, as described in the following Section 2.2.2.
DDCMP Programmer’s Guide main // DLI “main” section: { asyncIO = “yes”; // Use non-blocking I/O tsiCfgName = “ddcmpaltcfg.
2: DDCMP DLI Functions For an embedded ICP using the DLITE interface, Figure 2–2 shows the “main” section and two DDCMP sessions. You need to include only those parameters whose values differ from the defaults. The DLITE interface supports only Raw operation. For more information on the DLITE interface, refer to the user’s guide for your embedded ICP and operating system (for example, the ICP2432 User’s Guide for Windows NT).
DDCMP Programmer’s Guide 2.2.3 Opening and Attaching DLI Sessions After DLI initialization, the client calls dlOpen to open each DLI session. The DDCMP protocol allows only one session per ICP link. Using Raw operation, the client’s dlOpen call to open a session allows only the client DLI and Freeway to handle that session. A separate step is required to allow the ICP to handle the session and to associate a link with the session.
2: DDCMP DLI Functions 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.
DDCMP Programmer’s Guide Caution When using non-blocking I/O, a dlRead request must always be queued to avoid loss of data or responses from the ICP (see Step 5 of Table 2–3). Table 2–3: DLI Call Sequence for DDCMP (Non-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 dlPoll to confirm the success of each session ID obtained in Step 2. 4.
2: DDCMP DLI Functions 2.4 Overview of DLI Functions for DDCMP After the DDCMP software is downloaded to the Freeway ICP, the client and Freeway can communicate by exchanging messages. These messages configure and activate each ICP link and transfer data. The client application issues reads and writes to transfer messages to and from the ICP. Caution When using non-blocking I/O, there must always be at least one dlRead request queued to avoid loss of data or responses from the ICP.
DDCMP Programmer’s Guide Table 2–4: DLI Functions: Syntax and Parameters (Listed in Typical Call Order) DLI Function Parameter(s) Parameter Usage int dlInit (char *cfgFile, char *pUsrCb, int (*fUsrIOCH)(char *pUsrCb)); int dlOpena (char *cSessionName, Session name in DLI config file int (*fUsrIOCH) Optional I/O completion handler (char *pUsrCB, int iSessionID)); Parameters for IOCH int dlPoll (int iSessionID, int iPollType, char **ppBuf, int *piBufLen, char *pStat, DLI_OPT_ARGS **ppOptArgs); int d
2: DDCMP DLI Functions 2.4.1 DLI Optional Arguments Section 2.5 and Section 2.6 describe the dlWrite and dlRead functions for a DDCMP application. Both functions use the optional arguments parameter to provide the protocol-specific information required for Raw operation (Section 2.1.2). The “C” definition of the optional arguments structure is shown in Figure 2–3.
DDCMP Programmer’s Guide Table 2–5: Required dlWrite Optional Arguments Fields dlWrite Optional Arguments Field Value Usage usFWPacketType FW_DATA usFWCommand FW_ICP_WRITE usICPCommand DLI_ICP_CMD_ATTACH DLI_ICP_CMD_WRITE DLI_ICP_CMD_DETACH DLI_ICP_CMD_BIND DLI_ICP_CMD_UNBIND Send an Attach request for a session Write a message buffer to a session Send a Detach request for a session Send a Start Link command Send a Stop Link command usProtCommand See Table 2–7 on page 40 Send protocol-related c
2: DDCMP DLI Functions Table 2–6: Relevant dlRead Optional Arguments Fields dlRead Optional Arguments Field Value Usage usFWPacketType FW_DATA usFWCommand FW_ICP_READ usICPCommand DLI_ICP_CMD_ATTACH DLI_ICP_CMD_READ DLI_ICP_CMD_DETACH DLI_ICP_CMD_BIND DLI_ICP_CMD_UNBIND ICP acknowledgment of an Attach Message buffer from a session ICP acknowledgment of a Detach ICP Acknowledgment of Start Link ICP Acknowledgment of Stop Link iICPStatus See Appendix A Used for error reporting usProtCommand See
DDCMP Programmer’s Guide 2.5 Overview of DDCMP Requests using Raw dlWrite For DDCMP the dlWrite function supports three dlWrite categories: commands, report requests, and data transfer, which are discussed in detail in Section 2.5.1 through Section 2.5.3. Whether you use blocking or non-blocking I/O, each dlWrite request must be followed by a dlRead request to receive the command confirmation, the report requested, or the acknowledgment of the data transfer. Section 2.
2: DDCMP DLI Functions 2.5.1 Commands using Raw dlWrite Section 2.5.1.2 through Section 2.5.1.4 explain how to issue specific commands to the DDCMP software using the dlWrite function. Call dlRead to receive the command confirmation response (the dlRead pOptArgs.usProtCommand field is set by the DLI). 2.5.1.
DDCMP Programmer’s Guide Table 3–1 on page 56 lists the available link configuration options and values for the DDCMP protocol. The link status report (Section 2.5.2.3 on page 46) gives the current settings for a link’s configuration options. 2.5.1.2 Clear Link Statistics Command Use the dlWrite function with the pOptArgs.usProtCommand field set to DLI_PROT_CLR_STATISTICS to clear the link statistics report. The link statistics are cleared as soon as this command is received.
2: DDCMP DLI Functions 2.5.1.4 Stop Link Command Use the dlWrite function with the pOptArgs.usProtCommand field set to DLI_PROT_SEND_UNBIND and the pOptArgs.usICPCommand field set to DLI_ICP_CMD_UNBIND to stop a link without ending your session with Freeway. This command shuts down the link transmitter and receiver. A Stop Link command can be sent to a link that is active or already inactive. If the pOptArgs.
DDCMP Programmer’s Guide 2.5.2 Information Requests using Raw dlWrite Section 2.5.2.1 through Section 2.5.2.3 explain how to issue protocol-specific information requests to the DDCMP software using the dlWrite function. You must then make a Raw request dlRead to receive the report information (the dlRead pOptArgs.usProtCommand field is set by the DLI to reflect the type of report, and the iBufLen parameter indicates the size of the message).
2: DDCMP DLI Functions 2.5.2.2 Request Link Statistics Report Use the dlWrite function with the pOptArgs.usProtCommand field set to DLI_PROT_GET_STATISTICS_REPORT to request link statistics. The DDCMP software maintains a set of link statistics. The report consists of 16 words (32 bytes) of statistics. The link statistics report is also sent to the client in response to a Clear Statistics command (Section 2.5.1.2). The format of the dlRead link statistics report response (the pOptArgs.
DDCMP Programmer’s Guide 2.5.2.3 Request Link Status Report Use the dlWrite function with the pOptArgs.usProtCommand field set to DLI_PROT_GET_STATUS_REPORT to request the current link status and configuration option settings. The link configuration options are changed using the Configure Link command (Section 2.5.1.1). The dlRead link status report response (the pOptArgs.
2: DDCMP DLI Functions 2.5.3 Data Transfer using Raw dlWrite For the DDCMP software to properly handle data transfer, the localAck DLI configuration parameter must be set to “no” (see Figure 2–1 on page 30). After sending a data transfer request, the client application must make a dlRead request to receive the acknowledgment response associated with each dlWrite data transfer request, as explained below. 2.5.3.1 Send Normal Data Use the dlWrite function with the pOptArgs.
DDCMP Programmer’s Guide 2.6 Overview of DDCMP Responses using Raw dlRead Table 2–11 shows the valid DDCMP codes sent to your application in response to a Raw dlRead request; the returned dlRead pOptArgs.usProtCommand field indicates the response code. DDCMP error codes associated with the responses are returned in the pOptArgs.iICPStatus field and are described in Appendix A. The following responses can be received from the ICP.
2: DDCMP DLI Functions 2.6.1 Received Data The DDCMP software provides the DLI_PROT_RECV_DATA dlRead response code for data reception. The buffer pointed to by the pBuf parameter contains 16 empty bytes followed by the received data. The dlRead iBufLen parameter equals the size of the data (in bytes) + 16. The dlRead function returns a non-zero pOptArgs.iICPStatus field if there is an error associated with the message (see Appendix A). The pOptArgs.
DDCMP Programmer’s Guide pOptArgs.iProtModifier field set to 7. The Final Acknowledge of Data Transmitted tells the client writing DDCMP messages to the serial line that the remote computer has acknowledged one or more line data messages sent to the ICP serial line. Note that all line data messages sent to an ICP line are processed in the order sent. The final acknowledge count field is the high-order byte of the pOptArgs.
2: DDCMP DLI Functions defines the type of circuit exception received as shown in Table 2–13. Section 2.6.2.2 through Section 2.6.2.10 give details. Circuit exceptions are messages generated by the ICP in response to unexpected protocol events. For circuit exceptions, the pOptArgs.iProtModifier field values are greater than 128 (decimal) to differentiate them from responses to client commands.
DDCMP Programmer’s Guide 2.6.2.2 Receiving Computer not Responding [131] This exception is generated each seventh time that a reply (REP) message is sent because no response was received from the remote computer. The REP is retried until a valid response is received or the line is shut down. 2.6.2.
2: DDCMP DLI Functions 2.6.2.8 DDCMP Maintenance Message Received [140] This exception is caused by the reception of a DDCMP maintenance message when the link is not in maintenance mode (Section 3.7 on page 58). The message is ignored and the link is halted. 2.6.2.9 Control Message Received in Maintenance Mode [200] 10/97 Leslie: These last two were confusing, but Fred and I agreed to leave them in the category of circuit exceptions.
DDCMP Programmer’s Guide 54 DC 900-1343D
Chapter 3 DDCMP Link Configuration Options This chapter describes the various link configuration options that can be set using the dlWrite Configure Link command as described in Section 2.5.1.1 on page 41. Table 3–1 lists all the available options, the allowed settings, and the defaults. The defaults are in effect immediately after the protocol software is downloaded to the ICP. They remain in effect until you send a dlWrite Configure Link command or redownload the protocol software to the ICP.
DDCMP Programmer’s Guide Table 3–1: DDCMP Link Configuration Options and Settings Option Data Rate (bits/second) 56 Value (hex) 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a Default (✓) ✓ Clock Source 0x00 0x01 ✓ Reply Timer Length 0x0n 0x03 Line Mode 0x00 0x01 ✓ DDCMP Version 0x02 0x28 ✓ Setting 300 600 1,200 2,400 4,800 9,600 19,200 38,400 56,000 (Synchronous line mode only) 64,000 (Synchronous line mode only) 263,100 (Synchronous line mode only) External Internal n = number of
3: DDCMP Link Configuration Options 3.2 Clock Source Option The clock source option determines the source of the data clock signals for a link. Data clocking can be provided by the DDCMP software or received from an external source. 3.2.1 External Simpact recommends the external clock setting for most communications applications that involve a cable length greater than 25 feet. In the external setting, the clock generator is disabled.
DDCMP Programmer’s Guide 3.4 Line Mode Option This option selects the mode of serial communications, either synchronous or asynchronous. This option also affects the allowed data rate values (see Table 3–1). 3.5 DDCMP Version Option This option selects the DDCMP version, either DDCMP I2 or DDCMP 4.0. 3.6 Electrical Interface Option The electrical interface option applies only to the ICP2432 (such as in the Freeway 1100/1150) and allows the electrical interface for each link to be set.
Appendix A Error Codes There are several methods used by the DLI and DDCMP software to report errors (Table A–1 lists the DDCMP errors). The DLI error constant definitions are in the file dlicperr.h. 1. The error code can be returned directly by the DLI function call. Typical errors are those described in the Freeway Data Link Interface Reference Guide. 2. The DDCMP errors listed in Table A–1 can be returned in the global variable iICPStatus. 3.
DDCMP Programmer’s Guide Table A–1: DDCMP Error Codes Code DLI Constant Name Meaning 0 DLI_ICP_ERR_NO_ERR A data block has been successfully transmitted or received on the line or a command has been successfully executed. –105 DLI_ICP_ERR_BAD_CMD The command from the client program is not a legal value. –117 DLI_ICP_ERR_LINK_ACTIVE The link is already started. –122 DLI_ICP_ERR_BAD_PARMS The parameter value(s) used for the function call are illegal.
Appendix B Note DLI and TSI Configuration Process In this document, the term “Freeway” can mean either a Freeway server or an embedded ICP. For the embedded ICP, also refer to the user’s guide for your ICP and operating system (for example, the ICP2432 User’s Guide for Windows NT). This chapter summarizes the process for configuring DLI sessions and TSI connections.
DDCMP Programmer’s Guide The DLI and TSI configuration files provided with the product are listed in Table B–1. Table B–1: Configuration File Names Freeway Server Embedded ICP DLI: ddcmpaldcfg ddcacfg ddcscfg TSI: ddcmpaltcfg TSI not applicable for embedded ICP The DLI and TSI configuration procedures are summarized as follows. Keep in mind that TSI configuration does not apply to an embedded ICP environment. 1.
B: DLI and TSI Configuration Process uration file in the same directory as the location of the text file (unless a different path is supplied with the optional filename). If the optional filename is not supplied, the binary file is given the same name as your TSI text configuration file plus a .bin extension.
DDCMP Programmer’s Guide 6. If you have a UNIX system, move the binary configuration files that you created in Step 4 and Step 5 into the appropriate freeway/client/op-sys/bin directory Techpubs — keep the opsys up-todate with DC900-1333 where op-sys indicates the operating system: dec, hpux, sgi, solaris, or sunos. UNIX example: mv ddcmpaldcfg.bin /usr/local/freeway/client/hpux/bin mv ddcmpaltcfg.bin /usr/local/freeway/client/hpux/bin 7. If you have a VMS system, run the move.
B: DLI and TSI Configuration Process Application dlicfg DLI DLI Text Configuration File DLI Configuration Preprocessor DLI Binary Configuration File TSI (Freeway Server Only) 2836 tsicfg TSI Text Configuration File TSI Configuration Preprocessor TSI Binary Configuration File Transport Environment Figure B–1: DLI and TSI Configuration Process DC 900-1343D 65
DDCMP Programmer’s Guide 66 DC 900-1343D
Appendix C Packet Exchange Quick Reference This appendix is intended for programmers writing an application program under one of the following conditions: 1. If you are writing to Simpact’s data link interface (DLI) using Raw operation, refer also to the Freeway Data Link Interface Reference Guide. If you are using the embedded DLITE interface, also refer to the user’s guide for your particular ICP and operating system; for example, the ICP2432 User’s Guide for Windows NT. 2.
DDCMP Programmer’s Guide C.2 Command Sequences 1. Sequence of packet exchanges for establishing a connection and starting a link Send an ICP attach-packet Recieve an attach-packet (ack) Send a link-config-packet Receive a link config (ack) Send a start-link-packet Recieve a start link (ack) Receive a receive-data-packet (DLI_ICP_CMD_ATTACH) (DLI_ICP_CMD_ATTACH) (DLI_PROT_CFG_LINK) (DLI_PROT_CFG_LINK) (DLI_PROT_SEND_BIND) (DLI_PROT_SEND_BIND) (DLI_PROT_RECV_DATA) - mod=9 2.
C: Packet Exchange Quick Reference C.3 attach-packet Packet Description This packet is used to attach an application to the protocol and retrieve the protocol’s session ID.
DDCMP Programmer’s Guide C.4 link-config-packet Packet Description This packet is used to configure a link. The data field consists of a data structure with the format shown in Figure C–1.
C: Packet Exchange Quick Reference Note The Freeway header is used only with DLI (it is not applicable for DLITE), and the usLength field of the ICP header is used only without DLI. Data Data formatted as listed above.
DDCMP Programmer’s Guide C.5 start-link-packet Packet Description This packet is used to start or enable a link.
C: Packet Exchange Quick Reference C.6 write-data-packet Packet Description This packet is used to send data to a remote application.
DDCMP Programmer’s Guide C.7 receive-data-packet Packet Description This packet is received for data from a remote application, for acknowledgment of some sent commands and for ICP exceptions.
C: Packet Exchange Quick Reference Packet Exchanges usProtCommand sent -----------------None usProtCommand received ---------------------DLI_PROT_RECV_DATA Modifier Meanings Table C–1 shows the possible values for the iProtModifier field of the “receive-datapacket”.
DDCMP Programmer’s Guide C.8 stop-link-packet Packet Description This packet is used to stop or disable a link.
C: Packet Exchange Quick Reference C.9 detach-packet Packet Description This packet is used to detach an application from the protocol.
DDCMP Programmer’s Guide C.10 clr-stats-packet Packet Description This packet is used to clear a links statistics.
C: Packet Exchange Quick Reference C.11 clr-stats-ack-packet Packet Description This packet is received in response to a “clr-stats-packet”.
DDCMP Programmer’s Guide Word ---1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Statistic --------NAKs received for header BCC errors NAKs received for buffer BCC errors NAKs sent for header BCC errors NAKs sent for buffer BCC errors NAKs sent for no buffer available NAKs received for no buffer available REPs sent (local reply timeouts) Reps received (remote reply timeouts) NAKs sent for receive overruns NAKs received for receive overruns NAKs sent for message too long NAKs received for message too long NAKs sent
C: Packet Exchange Quick Reference C.12 buf-report-packet Packet Description This packet is used to request a buffer report.
DDCMP Programmer’s Guide C.13 buf-report-ack-packet Packet Description This packet is received in response to a “buf-report-packet”.
C: Packet Exchange Quick Reference Word ---1 2 3 4 5 6 7 Description ----------ICP message buffer size Number of free ICP message buffers Number of buffers in general client queue Number of buffers in client input queue Number of buffers in link input queue Number of buffers in link output queue Number of buffers in in fak queue Figure C–3: Buffer Report Format Packet Exchanges usProtCommand sent -----------------None DC 900-1343D usProtCommand received ---------------------DLI_PROT_GET_BUF_REPORT 83
DDCMP Programmer’s Guide C.14 stats-rpt-packet Packet Description This packet is used to request a links statistics report.
C: Packet Exchange Quick Reference C.15 stats-rpt-ack-packet Packet Description This packet is received in response to a “stats-rpt-packet”.
DDCMP Programmer’s Guide Word ---1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Statistic --------NAKs received for header BCC errors NAKs received for buffer BCC errors NAKs sent for header BCC errors NAKs sent for buffer BCC errors NAKs sent for no buffer available NAKs received for no buffer available REPs sent (local reply timeouts) Reps received (remote reply timeouts) NAKs sent for receive overruns NAKs received for receive overruns NAKs sent for message too long NAKs received for message too long NAKs sent
C: Packet Exchange Quick Reference C.16 status-rpt-packet Packet Description This packet is used to request a link’s status report.
DDCMP Programmer’s Guide C.17 status-rpt-ack-packet Packet Description This packet is received in response to a “status-rpt-ack-packet”.
C: Packet Exchange Quick Reference Word ---1 2 3 4 5 6 7 8 9 10 11 12 13 Description --------------------Link active flag Remote status Baud rate Clock source Reply timer length (seconds) Controller state Number of leading sync characters Sync/Async communications Full/Half duplex Half-duplex status Link is receive only EIA (Freeway 1000/1100 only) Maintenance state Value -------------0=inactive; 1=active 0=inactive; 1=active see Table 3–1 on page 56 0=external; 1=internal 1 to 65535 unused 8 for sync; 0
DDCMP Programmer’s Guide 90 DC 900-1343D
Index A Acknowledgments attach 39 data transmit final acknowledgment 47, 49 detach 39 start link 39, 42, 50 final acknowledgment 42 stop link 39, 43, 50 Addressing Internet 21 alwaysQIO DLI parameter 28, 29 asyncIO DLI parameter 28, 29 Attach acknowledgment 39 command 32, 38 attach-packet 69 Audience 11 B Binary configuration files 22, 27, 29, 33, 34, 62 Bit numbering 15 Blocking I/O 27 call sequence 33 Buffer adequate size 44 management 28 report 44 buf-report-ack-packet 82 buf-report-packet 81 buf-report
DDCMP Programmer’s Guide see Data codes see Error codes see Information codes see Response codes Command codes 40 DLI_PROT_CFG_LINK 41 DLI_PROT_CLR_STATISTICS 42 DLI_PROT_SEND_BIND 42 DLI_PROT_SEND_UNBIND 43 Command sequences 68 Commands attach 32, 38 detach 32, 38 foreign 62 see dlWrite categories CONFIG_TYPE data structure 41 Configuration 26 binary files 27, 29, 33, 34, 62 DLI alwaysQIO parameter 28, 29 asyncIO parameter 28, 29 cfgLink parameter 29, 33, 41 enable parameter 29, 33, 41 example 30, 31 local
Index configuration 26 see also Configuration, DLI configuration process 61 initialization 29 normal vs raw operation 27 session configuration 29 summary 26 DLI functions 25 overview 35 see also Functions summary table 36 syntax synopsis 36 dlicfg preprocessor program 27, 63 dlicperr.h include file 26, 59 dliicp.h include file 26 dlInit (see also Functions) 36 dliprot.
DDCMP Programmer’s Guide Features product 20 Files binary configuration 27, 29, 33, 34, 62 configuration file names 62 dlicperr.h include file 59 example DLI configuration 30, 31 include 26 makefc.com 62 move.com 64 test programs 24, 26 Foreign commands 62 Freeway client-server environment 21 overview 17 freeway.
Index O Opening DLI sessions 32 Operating system Simpact’s real-time 18, 19 Operation normal vs raw 27 Optional arguments 32 dlRead relevant 39 dlWrite required 38 iICPStatus field 40, 48, 49, 50, 53, 59 iProtModifier field 49, 51 structure 37 usProtCommand field 40, 48 Options see Configuration options OS/Impact 23 Overview DDCMP 23 DLI and TSI configuration 61 DLI functions 35 dlRead responses 48 dlWrite requests 40 embedded ICP 19 Freeway server 17 product 17 P Packet exchange attach-packet 69 buf-repor
DDCMP Programmer’s Guide components 23 download 21, 55 Start link acknowledgment 39, 42 command 38, 42 final acknowledge 50 final acknowledgment 42 start-link-packet 72 Statistics clear 42 clr-stats-ack-packet 79 clr-stats-packet 78 report 45 stats-rpt-ack-packet 85 stats-rpt-packet 84 stats-rpt-ack-packet 85 stats-rpt-packet 84 Status report 46 status-rpt-ack-packet 88 status-rpt-packet 87 status-rpt-ack-packet 88 status-rpt-packet 87 Stop link acknowledgment 39, 43 command 38, 43 final acknowledge 50 stop
DDCMP Programmer’s Guide DC 900-1343D Customer Report Form We are constantly improving our products. If you have suggestions or problems you would like to report regarding the hardware, software or documentation, please complete this form and mail it to Simpact at 9210 Sky Park Court, San Diego, CA 92123, or fax it to (619)560-2838. If you are reporting errors in the documentation, please enter the section and page number.
Simpact, Inc.