OpenTP1 Version 7 Operation

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

1.4.2 Creation of the MCF main function of the application startup service

To use the application startup facility and the MHP for processing MCF events, code, compile, and link the MCF main function of the application startup service in addition to the MCF main function of the protocol.

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

To use the user exit routine for determining the inheritance of the timer startup, specify the address of the user exit routine for determining the inheritance of the timer startup in the main function of the application startup service. Create the user exit routine for determining the inheritance of the timer startup using the same language that is used to create the MCF main function (K&R C, ANSI C, or C++). For details about the user exit routine for determining the inheritance of the timer startup, see the manual OpenTP1 Programming Reference C Language.

Figures 1-6 and 1-7 give an overview of how to code the MCF main function of the application startup service.

Figure 1-6 Overview of how to code the MCF main function of the application startup service (for ANSI C and C++)

[Figure]

  1. Include the header file provided by the application startup service.
  2. Declare extern for the function of the user exit routine to be used. The return values of the user exit routine must be the long type. You only need to perform this coding if you use the user exit routine for determining the inheritance of the timer startup.
  3. Declare extern for the user exit routine table. You only need to perform this coding if you use the user exit routine for determining the inheritance of the timer startup.
  4. Set the function address of the user exit routine for determining the inheritance of the timer startup in the following variable provided by the system:
    dcmcf_uoctbl.rrntime /* Address of the user exit
                            routine for determining the
                            inheritance of the timer
                            startup */
    You only need to perform this coding if you use the user exit routine for determining the inheritance of the timer startup.
  5. Issue the start function. This coding is always required.
 

Figure 1-7 Overview of how to code the MCF main function of the application startup service (for K&R C)

[Figure]

  1. Include the header file provided by the application startup service.
  2. Declare extern for the function of the user exit routine to be used. The return values of the user exit routine must be the long type. You only need to perform this coding if you use the user exit routine for determining the inheritance of the timer startup.
  3. Declare extern for the user exit routine table. You only need to perform this coding if you use the user exit routine for determining the inheritance of the timer startup.
  4. Set the function address of the user exit routine for determining the inheritance of the timer startup in the following variable provided by the system:
    dcmcf_uoctbl.rrntime /* Address of the user exit
                            routine for determining the
                            inheritance of the timer
                            startup */
    You only need to perform this coding if you use the user exit routine for determining the inheritance of the timer startup.
  5. Issue the start function. This coding is always required.