OpenTP1 Version 7 Operation

[Contents][Index][Back][Next]

1.4.1 Creation of the MCF main function of the MCF communication service

To use the message transmission facility provided by a protocol, you must code, compile, and link the MCF main function of the MCF communication service.

Issue the start function (dc_mcf_svstart) from the MCF main function.

When you use a user exit routine, specify the function address of the desired user exit routine in the MCF main function. Create user exit routines using the same language that is used to create the MCF main function (K&R C, ANSI C, or C++).

When you use the TP1/NET/XMAP3 protocol, you need to start the mapping service that is used in the user exit routine beforehand in the MCF main function. For details about starting the mapping service, see the manual OpenTP1 Protocol TP1/NET/XMAP3.

Figures 1-4 and 1-5 give an overview of how to code the MCF main function that defines a protocol and user exit routines.

Figure 1-4 Overview of how to code the MCF main function that defines a protocol and user exit routines (for ANSI C and C++)

[Figure]

  1. Include the header file provided by the protocol.
    XXXX of dcmXXXX.h changes depending on the protocol. See the manual for the protocol.
  2. Declare extern for the functions of the user exit routines to be used. The return values of the user exit routines must be the long type. You only need to perform this coding if you use user exit routines.
  3. Declare extern for the user exit routine table.
    You only need to perform this coding if you use the user exit routines specified in step 2.
  4. Set the function address of each user exit routine in the following variables provided by the system:
     
    dcmcf_uoctbl.msgrcv  /* Address of the user exit
                            routine for editing input
                            messages */
    dcmcf_uoctbl.msgsend /* Address of the user exit
                            routine for editing output
                            messages */
     
    You only need to perform this coding if you use those user exit routines.
  5. Issue the start function. This coding is always required.
 

Figure 1-5 Overview of how to code the MCF main function that defines a protocol and user exit routines (for K&R C)

[Figure]

  1. Include the header file provided by the protocol.
    XXXX of dcmXXXX.h changes depending on the protocol. See the manual for the protocol.
  2. Declare extern for the functions of the user exit routines to be used. The return values of the user exit routines must be the long type. You only need to perform this coding if you use user exit routines.
  3. Declare extern for the user exit routine table.
    You only need to perform this coding if you use the user exit routines specified in step 2.
  4. Set the function address of each user exit routine in the following variables provided by the system:
    dcmcf_uoctbl.msgrcv  /* Address of the user exit
                            routine for editing input
                            messages */
    dcmcf_uoctbl.msgsend /* Address of the user exit
                            routine for editing output
                            messages */
    You only need to perform this coding if you use those user exit routines.
  5. Issue the start function. This coding is always required.