home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l360 / 3.ddi / APPC.@EM / APPCDEMO.DOC < prev    next >
Encoding:
Text File  |  1991-04-08  |  10.9 KB  |  255 lines

  1.  
  2.  
  3.             COBOL Advanced Program to Program (APPC) Demonstration
  4.             ======================================================
  5.  
  6.  
  7.    Contents
  8.    --------
  9.  
  10.        Introduction
  11.        Hardware/software requirements
  12.        Amending the configuration profiles
  13.        Changing CONFIG.SYS
  14.        Compiling and running the demonstration
  15.        User instructions
  16.  
  17.  
  18.    Introduction
  19.    ------------
  20.  
  21.        This document describes how to run a demonstration which uses
  22.        Advanced Program to Program Communication to communicate between two
  23.        programs on a network.
  24.  
  25.        The demonstration is the game Battleships.  Each program controls
  26.        the two player's views of the battle scene, showing positions of his
  27.        own ships and coordinates where previous attacks have been made.
  28.        The game involves a simple two way communication of sending
  29.        coordinates, receiving opponent's damage reports, receiving
  30.        opponent's attack coordinates and sending own damage reports.
  31.        Instructions for playing the game are provided later.
  32.  
  33.        If you have no previous knowledge of APPC, we recommend that you read
  34.        the IBM OS/2 Extended Edition Version 1.1 APPC Programming Reference
  35.        manual to gain a basic understanding of the concepts and terminology.
  36.        For detailed information about configuring Communications Manager,
  37.        refer to the IBM Operating System/2 Extended Edition Version 1.1
  38.        System Administrator's Guide for Communications.  Also read the
  39.        section on using APPC in the document INTERFAC.DOC.
  40.  
  41.  
  42.    Hardware/Software requirements
  43.    ------------------------------
  44.  
  45.    Hardware:
  46.  
  47.       o Two IBM PS/2s or machines capable of running IBM OS/2 1.1 Extended
  48.         Edition
  49.  
  50.       o Memory enough to run IBM OS/2 1.1 EE with Communications Manager,
  51.         this will be around 6 megabytes.
  52.  
  53.       o Both machines to be connected to an IBM Token Ring Network or PC LAN
  54.         Network
  55.  
  56.    System Software:
  57.  
  58.        o IBM OS/2 1.1 Extended Edition
  59.  
  60.        o Communications Manager (CM)
  61.  
  62.        o CM configuration profile to run APPC
  63.  
  64.        o Network Driver software relevent to type of network being used
  65.  
  66.    Application Software:
  67.  
  68.        o The following programs/configurations have been provided:
  69.  
  70.            BATTLEL.CBL  - main program for local machine
  71.            BATTRER.CBL  - main program for remote machine
  72.            BATTLE.WKS   - working storage copy file
  73.            BATTLE.SS    - screen section copy file
  74.            BATTLE.CBL   - procedure copy file
  75.            BATTLE.CMD   - batch file to create run files
  76.            BATTAPPC.CBL - communications interface
  77.            APPCBATL.CFG - CM configuration profile for local machine
  78.            APPCBATR.CFG - CM configuration profile for remote machine
  79.            ADAPTER.EXE  - Utility program to get adapter address
  80.            APPC.CPY     - APPC COBOL definitions (appc basic/mapped verbs)
  81.            ACSSVC.CPY   - ACSSVC COBOL definitions (common service verbs)
  82.  
  83.        o APPC.CPY and ACSSVC.CPY are general purpose copy files, and can be
  84.          used by any COBOL APPC application.  The files contain definitions
  85.          for each verb's control block, operation codes, error codes and
  86.          constants.
  87.  
  88.  
  89.    Amending the configuration profiles
  90.    -----------------------------------
  91.  
  92.    Before you can start running the demonstration programs you must amend
  93.    one and possibly both the configuration files. The configurations
  94.    provided assume that you will be using an IBM Token Ring Network running
  95.    on a PS/2 machine. If you have a different type of machine or you are
  96.    using a different DLC type (eg. IBM PC Network ) it is likely that you
  97.    will have to amend the configurations.
  98.  
  99.    The other change, which you should make to APPCBATL.CFG, is to fill in
  100.    the adapter number field in the Partner Logical Unit Profiles of the SNA
  101.    Feature Profiles menu.  This tells Communications Manager which machine
  102.    on the network to talk converse with.
  103.  
  104.    The profile which you should change is called DEMOPLU.  To change this
  105.    field:
  106.  
  107.      o start Communications Manager with the configuration file as a
  108.        parameter: 'CM APPCBATL'
  109.      o press F10 and select 'A' to get to the advanced pull down menu
  110.      o select 'C' for configuration
  111.      o enter configuration name APPCBATL (if not already shown) and press
  112.        enter key
  113.      o select the SNA Feature Profiles menu
  114.      o select the PLU profile menu
  115.      o enter 'H' to change profile
  116.      o enter profile name 'DEMOPLU1' and press enter key
  117.      o press enter key to accept first screen
  118.      o move cursor to adapter number field and enter the adapter address of
  119.        the network adapter card in the machine that will use the other
  120.        configuration ie. APPCBATR.CFG.
  121.      o keep pressing the enter key until you reach the SNA Feature
  122.        Configuration menu, then press the escape key to get back to
  123.        Communication Configuration menu
  124.      o press F10 and then 'V' and the enter key to verify the changes you
  125.        have made
  126.      o the verification should complete successfully
  127.      o exit Communications Manager
  128.  
  129.    The adapter number is the hard coded address of the network adapter card
  130.    (each card is given a unique address by the manufacturer). You can find out
  131.    this address by running ADAPTER.EXE (OS/2 1.1), or by looking in ACSLAN.LOG
  132.    in the CMLIB directory (OS/2 1.2) on the machine which will use the
  133.    configuration file 'APPCBATR.CFG'.
  134.  
  135.  
  136.    Changing CONFIG.SYS
  137.    -------------------
  138.  
  139.    The device drivers which control the network hardware require the CM
  140.    configuration profiles to be specified as parameters.
  141.  
  142.    If you are using a IBM Token Ring Network amend the following lines in
  143.    CONFIG.SYS.
  144.        o on the local machine:
  145.  
  146.            DEVICE=C:\CMLIB\TRNETDD.SYS CFG=C:\CMLIB\APPCBATL.CFG
  147.            DEVICE=C:\CMLIB\NETBDD.SYS CFG=C:\CMLIB\APPCBATL.CFG
  148.  
  149.        o on the remote machine:
  150.  
  151.            DEVICE=C:\CMLIB\TRNETDD.SYS CFG=C:\CMLIB\APPCBATR.CFG
  152.            DEVICE=C:\CMLIB\NETBDD.SYS CFG=C:\CMLIB\APPCBATR.CFG
  153.  
  154.    If you are using a IBM PC LAN Network amend the following lines in
  155.    CONFIG.SYS.
  156.        o on the local machine:
  157.  
  158.            DEVICE=C:\CMLIB\PCNETDD.SYS CFG=C:\CMLIB\APPCBATL.CFG
  159.            DEVICE=C:\CMLIB\NETBDD.SYS CFG=C:\CMLIB\APPCBATL.CFG
  160.  
  161.        o on the remote machine:
  162.  
  163.            DEVICE=C:\CMLIB\PCNETDD.SYS CFG=C:\CMLIB\APPCBATR.CFG
  164.            DEVICE=C:\CMLIB\NETBDD.SYS CFG=C:\CMLIB\APPCBATR.CFG
  165.  
  166.        After changing CONFIG.SYS reboot both machines so that the device
  167.        drivers are reactivated with the correct configurations.
  168.  
  169.  
  170.    Starting Communications Manager
  171.    -------------------------------
  172.  
  173.        Before you start running the demo program you must make sure that you
  174.        have started Communications Manager (CM) on each machine with the
  175.        respective configuration file active.  To make the configuration
  176.        active supply its name as a parameter when you start CM.
  177.  
  178.        eg. STARTCM APPCBATL
  179.  
  180.        If you receive any error messages when you start CM you should fix
  181.        these problems before attempting to run the programs.  If you do have
  182.        problems record the error message number and refer to the IBM OS/2 EE
  183.        Manual on Programming Services and Problem Determination for
  184.        Communications for help.
  185.  
  186.  
  187.    Compiling and running the demonstration
  188.    ---------------------------------------
  189.  
  190.    The demonstration programs can be compiled for use with Animator or as
  191.    object files which can then be linked to produce standalone executable
  192.    programs.
  193.  
  194.    A batch file has been provided : BATTLE.CMD which will create the
  195.    files to run the demonstration.  The batch file will produce files for
  196.    animation or for direct execution.
  197.  
  198.    To run the demonstration, start BATTLEL on the machine that has
  199.    configuration profile APPCBATL.CFG active.
  200.  
  201.    If there are no problems with the connection, a message on the remote
  202.    machine should appear instructing the operator to begin a transaction
  203.    program called BATTLE.
  204.  
  205.    This message is your prompt to start BATTLER on the remote machine.
  206.  
  207.    If a conversation is established, the two programs should start to
  208.    communicate with each other and the BATTLESHIPS game should start.
  209.  
  210.    If any errors occur, the program will stop and the error codes, together
  211.    with the verb operation code will be displayed.  Refer to the APPC
  212.    Reference Manual for information on error codes. Additional information
  213.    is provided by the error log, which can be accessed from the Problem
  214.    Determination menu of the Advanced features pull down menu. This provides
  215.    information in the form of error codes which reference cause/diagnosis
  216.    text in the Problem Determination for Communications manual - it will
  217.    also report what area of communications the problem occured in.
  218.  
  219.    Unless you change the programs, the most likely cause of any problems
  220.    that may occur will be due to problems in the configuration file.  The
  221.    configurations provided are model profiles.  This means that you may have
  222.    to amend some fields in the profile which suit the particular setup you
  223.    have.  For example the LAN Adapter Type profile has been configured as an
  224.    IBM Token-Ring Network Adapter /A card which is generally used by IBM
  225.    PS/2 machines.  If you are using a different machine you will likely have
  226.    to change the profile to configure a different type of card.  Also it is
  227.    possible to have two adapter cards installed in a machine. The primary
  228.    adapter card is known as Adapter 0 and the secondary as Adapter 1.  The
  229.    configurations assume only one card is installed which define Adapter 0.
  230.    If you have two cards, you may have to alter the profile to reflect this.
  231.  
  232.  
  233.    User Instructions
  234.    -----------------
  235.  
  236.    Before the game starts, both players should agree on how many ships that
  237.    are going to take part and how many of each type of ship.  There are four
  238.    types of ships: Aircraft Carrier, Battleship, Frigate and Gun-Boat,
  239.    denoted by the letters: A,B,F and G respectively. There is no limit to
  240.    the numbers of ships, nor of each type.  The only requirement is that
  241.    different ships of the same type are not placed in adjacent locations to
  242.    one another.
  243.  
  244.    The game starts for player 1. Player 1 selects a grid coordinate where he
  245.    thinks an opponent ship is located. Coordinates are specified in column
  246.    row order (eg. F2).  After a while, player 1 will receive a damage report
  247.    of the earlier attempt this will be either a hit, a miss or a sinking.
  248.    If a part of an opponent's ship has been hit, the grid location is
  249.    colored red, a miss it is colored cyan and a sink, the whole ship is
  250.    marked in black.  After this player 2 has his turn. The player who sinks
  251.    all of his opponent's ships first wins the game.
  252.  
  253.    The game can be stopped by entering a grid location of Q.  This will
  254.    send a message to the opponent to quit.
  255.