home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 18 / CD_ASCQ_18_111294_W.iso / dos / prg / pas / pcl4p42 / pcl4p.ref < prev    next >
Text File  |  1994-08-19  |  62KB  |  1,497 lines

  1.  
  2.  
  3.                                Personal Communications Library
  4.  
  5.                                      For the Turbo Pascal
  6.  
  7.  
  8.                                          ( PCL4P )
  9.  
  10.  
  11.  
  12.                                     REFERENCE MANUAL
  13.  
  14.  
  15.  
  16.  
  17.  
  18.                                        Version  4.2
  19.  
  20.                                        Sept 1, 1994
  21.  
  22.  
  23.  
  24.  
  25.                              This software is provided as-is.
  26.                       There are no warranties, expressed or implied.
  27.  
  28.  
  29.  
  30.  
  31.                                    Copyright (C) 1994
  32.                                    All rights reserved
  33.  
  34.  
  35.  
  36.                                    MarshallSoft Computing, Inc.
  37.                                    Post Office Box 4543
  38.                                    Huntsville AL 35815
  39.  
  40.                                    Voice 205-881-4630
  41.                                    FAX   205|881|4630
  42.                                    BBS   205-880-9748
  43.  
  44.  
  45.                                             _______
  46.                                        ____|__     |                (R)
  47.                                     --+       |    +-------------------
  48.                                       |   ____|__  |  Association of
  49.                                       |  |       |_|  Shareware
  50.                                       |__|   o   |    Professionals
  51.                                     --+--+   |   +---------------------
  52.                                          |___|___|    MEMBER
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.              PCL4P Reference Manual                                            Page 1
  69.                                      C O N T E N T S
  70.  
  71.  
  72.  
  73.  
  74.  
  75.                    Chapter                                                 Page
  76.  
  77.                    Table of Contents......................................2
  78.                    Introduction...........................................3
  79.                       SioBaud.............................................4
  80.                       SioBrkKey...........................................4
  81.                       SioBrkSig...........................................5
  82.                       SioCTS..............................................5
  83.                       SioDCD..............................................6
  84.                       SioDelay............................................6
  85.                       SioDone.............................................7
  86.                       SioDSR..............................................7
  87.                       SioDTR..............................................8
  88.                       SioError............................................8
  89.                       SioFIFO.............................................9
  90.                       SioFlow.............................................9
  91.                       SioGetc............................................10
  92.                       SioGetDiv..........................................10
  93.                       SioInfo............................................11
  94.                       SioIRQ.............................................11
  95.                       SioLine............................................12
  96.                       SioLoopBack........................................12
  97.                       SioModem...........................................13
  98.                       SioParms...........................................13
  99.                       SioPorts...........................................14
  100.                       SioPutc............................................14
  101.                       SioRead............................................15
  102.                       SioReset...........................................15
  103.                       SioRI..............................................16
  104.                       SioRTS.............................................16
  105.                       SioRxBuf...........................................17
  106.                       SioRxFlush.........................................17
  107.                       SioRxQue...........................................18
  108.                       SioTimer...........................................18
  109.                       SioTxBuf...........................................19
  110.                       SioTxFlush.........................................19
  111.                       SioTxQue...........................................20
  112.                       SioUART............................................20
  113.                       SioUnGetc..........................................21
  114.                    Function Summary......................................21
  115.                    Error Code Summary....................................22
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.              PCL4P Reference Manual                                            Page 2
  137.                                   Introduction
  138.  
  139.  
  140.               This  manual  list  all  the  PCL4P  functions  in alphabetical order. Every
  141.               library function will return a value as follows:
  142.  
  143.               1.  Negative values for error conditions. See last page of this manual for a
  144.               list of error values and their meanings.
  145.  
  146.               2.  Non-negative values when returning data ( eg: SioLine ).
  147.  
  148.               3.  Zero otherwise.
  149.  
  150.               When debugging an application, be  sure  to  test  all  return  values.  Use
  151.               SioError to print the associated text for errors.
  152.  
  153.  
  154.               Example Code Segment
  155.  
  156.               +--------------------------------------------------------+
  157.               |  RetCode := SioFunction();    (* any PCL4P function *) |
  158.               |  if RetCode < 0 then begin                             |
  159.               |    RetCode := SioError(RetCode);                       |
  160.               |    (* ...do some stuff... *)                           |
  161.               |    end;                                                |
  162.               +--------------------------------------------------------+
  163.  
  164.  
  165.               For  more examples, examine each of the example programs provided. Also look
  166.               at the examples associated with  each  library  function  described  in  the
  167.               following section.
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.              PCL4P Reference Manual                                            Page 3
  205.               +-------------+------------------------------------------------------------+
  206.               |   SioBaud   |  Sets the baud rate of the selected port.                  |
  207.               +-------------+------------------------------------------------------------+
  208.  
  209.  
  210.                 Syntax    function SioBaud(Port,BaudCode:Integer):Integer;
  211.                           (* Port:      Port selected (COM1 - COM16) *)
  212.                           (* BaudCode:  Baud code *)
  213.  
  214.                Remarks    The  SioBaud  function sets the baud rate without resetting  the
  215.                           port. It is used to change the baud rate after calling SioReset.
  216.  
  217.                            Code   Rate    Name             Code   Rate   Name
  218.                              0     300    Baud300            5    9600   Baud9600
  219.                              1     600    Baud600            6   19200   Baud19200
  220.                              2    1200    Baud1200           7   38400   Baud38400
  221.                              3    2400    Baud2400           8   57600   Baud57600
  222.                              4    4800    Baud4800           9  115200   Baud115200
  223.  
  224.  
  225.                Returns     -4 : No such port. Expect 0 to MaxPort.
  226.                           -11 : Bad baud rate code. See above code values.
  227.  
  228.               See Also    SioReset
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.               +-------------+------------+-------------------+---------------------------+
  238.               |  SioBrkKey  |  Return non|zero if the Control|Break key was pressed.     |
  239.               +-------------+------------+-------------------+---------------------------+
  240.  
  241.  
  242.                 Syntax    function SioBrkKey:Integer;
  243.  
  244.                Remarks     The  SioBrkKey  function returns a TRUE value (non-zero) if the
  245.                           Control-BREAK key was pressed,  else  it  returns  a  zero.  Use
  246.                           SioBrkKey  as  a safety exit from a polling loop. Don't mix this
  247.                           function up with SioBrkSig.
  248.  
  249.                Returns    -1 : Control-BREAK was pressed.
  250.                            0 : Control-BREAK was NOT pressed.
  251.  
  252.               See Also    SioBrkSig
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.              PCL4P Reference Manual                                            Page 4
  273.               +-------------+------------------------------------------------------------+
  274.               |  SioBrkSig  |  Asserts, cancels, or detects BREAK signal.                |
  275.               +-------------+------------------------------------------------------------+
  276.  
  277.  
  278.                 Syntax    function SioBrkSig(Port:Integer;Cmd:Char):Boolean;
  279.                           (* Port:      Port selected (COM1 thru COM16) *)
  280.                           (* char Cmd:  ASSERT, CANCEL, or DETECT *)
  281.  
  282.                Remarks    The SioBrkSig function controls the BREAK bit in the line status
  283.                           register. The legal commands are:
  284.  
  285.                           ASSERT_BREAK ('A') to assert BREAK
  286.                           CANCEL_BREAK ('C') to cancel BREAK
  287.                           DETECT_BREAK ('D') to detect BREAK
  288.  
  289.                           ASSERT_BREAK, CANCEL_BREAK,  and  DETECT_BREAK  are  defined  in
  290.                           PCL4P.H. See TERM.C for an example of the use of SioBrkSig.
  291.  
  292.                Returns    -2 : Port not enabled. Call SioReset first.
  293.                           -4 : No such port. Expect 0 to MaxPort.
  294.                           -6 : Illegal command. Expected 'A', 'C', or 'D'.
  295.                           >0 : BREAK signal detected (DETECT command only)
  296.  
  297.               See Also    SioBrkKey
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.               +-------------+------------------------------------------------------------+
  306.               |   SioCTS    |  Reads the Clear to Send (CTS) modem status bit.           |
  307.               +-------------+------------------------------------------------------------+
  308.  
  309.                 Syntax    function SioCTS(Port:Integer):Integer;
  310.                           (* int Port: Port selected (COM1 thru COM16) *)
  311.  
  312.                Remarks    The SioCTS function is used to read  the  Clear  to  Send  (CTS)
  313.                           modem status bit.
  314.  
  315.                           The  CTS  line  is  used  by  some  error  correcting  modems to
  316.                           implement hardware flow control.  CTS is dropped by the modem to
  317.                           signal the computer not to send data  and is  raised  to  signal
  318.                           the computer to continue.
  319.  
  320.                           Refer to the User's Manual for a discussion of flow control.
  321.  
  322.                Returns    -2 : Port not enabled. Call SioReset first.
  323.                           -4 : No such port.  Expect 0 to MaxPort.
  324.                            0 : CTS is clear.
  325.                           >0 : CTS is set.
  326.  
  327.               See Also    SioFlow, SioDSR, SioRI, SioDCD, and SioModem.
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.              PCL4P Reference Manual                                            Page 5
  341.               +-------------+------------------------------------------------------------+
  342.               |   SioDCD    |  Reads the Data Carrier Detect (DCD) modem staus bit.      |
  343.               +-------------+------------------------------------------------------------+
  344.  
  345.  
  346.                 Syntax    function SioDCD(Port:Integer):Integer;
  347.                           (* Port: Port selected (COM1 thru COM16) *)
  348.  
  349.                Remarks    The  SioDCD  function is  used to read the Data Carrier Detect
  350.                           (DCD) modem status bit. Also see SioModem.
  351.  
  352.                Returns    -2 : Port not enabled. Call SioReset first.
  353.                           -4 : No such port.  Expect 0 to MaxPort.
  354.                            0 : DCD is clear.
  355.                           >0 : DCD is set.
  356.  
  357.               See Also    SioDSR, SioCTS, SioRI, and SioModem.
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.               +-------------+------------------------------------------------------------+
  371.               |   SioDelay  |  Delays one or more timer tics.                            |
  372.               +-------------+------------------------------------------------------------+
  373.  
  374.  
  375.                 Syntax    function SioDelay(Tics:Integer):Integer;
  376.                           (* Tics: # timer tics to delay *)
  377.  
  378.                Remarks    The  SioDelay  function is used to delay one or more timer tics,
  379.                           where each timer tic is approximately 55 milliseconds (18.2 tics
  380.                           to the second).
  381.  
  382.                Returns    zero.
  383.  
  384.               See Also    SioTimer
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.              PCL4P Reference Manual                                            Page 6
  409.               +-------------+------------------------------------------------------------+
  410.               |   SioDone   |  Terminates further serial processing.                     |
  411.               +-------------+------------------------------------------------------------+
  412.  
  413.  
  414.                 Syntax    function SioDone(Port:Integer):Integer;
  415.                           (* Port: Port selected (COM1 thru COM16) *)
  416.  
  417.                Remarks    The  SioDone  function  terminates  further  serial  processing.
  418.                           SioDone  MUST  be called before exiting your application so that
  419.                           interrupts can be restored to their original state.  Failure  to
  420.                           do  this  can crash the operating system.  If you forget to call
  421.                           SioDone before exiting, be sure to re-boot your  computer.   You
  422.                           can  call SioDone even if SioReset has not been called, so it is
  423.                           good  practice  to  always  call  SioDone  before  exiting  your
  424.                           application.
  425.  
  426.                           Also  note  that  SioDone  dereferences the transmit and receive
  427.                           buffers set up by SioRxQue and SioTxQue.
  428.  
  429.                Returns    -2 : Port not enabled. Call SioReset first.
  430.                           -4 : No such port. Expect 0 to MaxPort.
  431.  
  432.               See Also    SioReset.
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.               +-------------+------------------------------------------------------------+
  442.               |    SioDSR   |  Reads the Data Set Ready (DSR) modem status bit.          |
  443.               +-------------+------------------------------------------------------------+
  444.  
  445.  
  446.                 Syntax    function SioDSR(Port:Integer):Integer;
  447.                           (* Port: Port selected (COM1 thru COM16) *)
  448.  
  449.                Remarks    The SioDSR function is used to read the  Data  Set  Ready  (DSR)
  450.                           modem status bit.
  451.  
  452.                Returns    -2 : Port not enabled. Call SioReset first.
  453.                           -4 : No such port.  Expect 0 to MaxPort.
  454.                            0 : DSR is clear.
  455.                           >0 : DSR is set
  456.  
  457.               See Also    SioCTS, SioRI, SioDCD, and SioModem
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.              PCL4P Reference Manual                                            Page 7
  477.               +-------------+------------------------------------------------------------+
  478.               |    SioDTR   |  Set, clear, or read Data Terminal Ready (DTR) status bit. |
  479.               +-------------+------------------------------------------------------------+
  480.  
  481.  
  482.                 Syntax    function SioDTR(Port:Integer;Cmd Char):Integer;
  483.                           (* Port: Port selected (COM1 thru COM16) *)
  484.                           (* Cmd:  DTR command (SET, CLEAR, or READ) *)
  485.  
  486.                Remarks    The SioDTR function controls the Data Terminal Ready (DTR) bit
  487.                           in the modem control register.  DTR should always  be  set  when
  488.                           communicating with a modem. Commands (defined in PCL4P.H) are:
  489.  
  490.                           SET_LINE ('S')  to set DTR (ON)
  491.                           CLEAR_LINE ('C')  to clear DTR (OFF)
  492.                           READ_LINE ('R')  to read DTR
  493.  
  494.                Returns    -2 : Port not enabled. Call SioReset first.
  495.                           -4 : No such port. Expect 0 to MaxPort.
  496.                           -5 : Not one of 'S', 'C', or 'R'.
  497.                            0 : DTR is OFF (READ_LINE Command).
  498.                           >0 : DTR is ON (READ_LINE Command).
  499.  
  500.               See Also    SioRTS.
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.               +-------------+------------------------------------------------------------+
  510.               |   SioError  |  Displays error in text.                                   |
  511.               +-------------+------------------------------------------------------------+
  512.  
  513.  
  514.                 Syntax    function SioError(Code:Integer):Integer;
  515.                           (* Code: PCL4P error code *)
  516.  
  517.                Remarks    The SioError function displays the error in  text  corresponding
  518.                           to  the  error  code  returned  from  a  PCL4P  function. During
  519.                           development of a communications application, it is a  good  idea
  520.                           to  always  test  return codes, and print out their descriptions
  521.                           with SioError.
  522.  
  523.                Returns    zero.
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.              PCL4P Reference Manual                                            Page 8
  545.               +-------------+------------------------------------------------------------+
  546.               |   SioFIFO   |  Sets the FIFO trigger level (16550 UART only).            |
  547.               +-------------+------------------------------------------------------------+
  548.  
  549.  
  550.                 Syntax    function SioFIFO(Port,LevelCode:Integer):Integer;
  551.                           (* Port:      Port selected (COM1 thru COM16) *)
  552.                           (* LevelCode: FIFO level code (see below) *)
  553.  
  554.                Remarks    The SioFIFO function  is  used to enable both transmit & receive
  555.                           FIFOs for 16550 UARTS, and to set the  trigger  level  at  which
  556.                           receive interrupts are generated.
  557.  
  558.                           For  example, if the FIFO level is set to 8, then the 16550 UART
  559.                           will not generate an interrupt until 8 bytes have been received.
  560.                           This reduces the number of interrupts  generated.  In  order  to
  561.                           take  advantage  of  the  TX FIFO, use the PCL4P library with TX
  562.                           interrupts enabled (PCL4P_2.OBJ).
  563.  
  564.                           In order to test if your port is a 16550 UART, call SioFIFO with
  565.                           a LevelCode of other than FIFO_OFF. SioFIFO can  be  called  for
  566.                           the 8250 and 16450 UART without ill effect.
  567.  
  568.                           Code  PCL4P.H Name  Trigger Level
  569.                           -1      FIFO_OFF     Disable FIFO
  570.                            0      LEVEL_1      1 byte
  571.                            1      LEVEL_4      4 bytes
  572.                            2      LEVEL_8      8 bytes
  573.                            3      LEVEL_14     14 bytes
  574.  
  575.                Returns    -2 : Port not enabled. Call SioReset first.
  576.                           -4 : No such port.  Expect 0 to MaxPort.
  577.                           >0 : FIFO level set.
  578.                            0 : FIFO level not set (not 16550).
  579.  
  580.               +------------+-------------------------------------------------------------+
  581.               |   SioFlow  |  Sets hardware (RTS/CTS) flow control.                      |
  582.               +------------+-------------------------------------------------------------+
  583.  
  584.  
  585.                 Syntax    function SioFlow(Port,Tics:Integer)
  586.                           (* Port: Port selected (COM1 thru COM16) *)
  587.                           (* Tics: # tics before time out *)
  588.  
  589.                Remarks    The SioFlow function is used to enable or disable hardware  flow
  590.                           control.  Hardware flow control uses RTS and CTS to control data
  591.                           flow  between  the  modem and the computer.  Refer to the User's
  592.                           Manual  for  a  discussion  of flow control.  To enable hardware
  593.                           flow control, call SioFlow with Tics > 0.
  594.  
  595.                           "Tics" is the number of timer tics (18.2 per  second)  before  a
  596.                           call to SioPutc will time out because CTS was not set.
  597.  
  598.                           In order for hardware flow control to work correctly, your modem
  599.                           must also be configured to work with hardware flow control,  and
  600.                           your  computer  to  modem  cable  must  have  RTS  and CTS wired
  601.                           straight through. If you enable hardware flow  control,  do  not
  602.                           modify  the  RTS line (by calling SioRTS). To explicitly disable
  603.                           hardware flow control, call SioFlow with Tics=-1.
  604.  
  605.                Returns    -2 : Port not enabled. Call SioReset first.
  606.                           -4 : No such port.  Expect 0 to MaxPort.
  607.                           =0 : Flow control disabled.
  608.                           >0 : Flow control enabled.
  609.  
  610.               See Also    SioPutc
  611.  
  612.              PCL4P Reference Manual                                            Page 9
  613.               +------------+-------------------------------------------------------------+
  614.               |   SioGetc  |  Reads the next character from the serial line.             |
  615.               +------------+-------------------------------------------------------------+
  616.  
  617.  
  618.                 Syntax    function SioGetc(Port:Integer):Integer;
  619.                           (* Port: Port selected (COM1 thru COM16) *)
  620.  
  621.                Remarks    The SioGetc function reads a byte from the selected serial port.
  622.                           The function will return immediately if no serial byte is ready.
  623.  
  624.                Returns    -2 : Port not enabled. Call SioReset first.
  625.                           -4 : No such port. Expect 0 to MaxPort.
  626.                           -1 : If timed out.
  627.                           >0 : Character read.
  628.  
  629.               See Also    SioUnGetc and SioPutc.
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.               +---------------+----------------------------------------------------------+
  646.               |   SioGetDiv   |  Reads the baud rate divisor.                            |
  647.               +---------------+----------------------------------------------------------+
  648.  
  649.  
  650.                 Syntax    function SioGetDiv(Port:Integer):Integer;
  651.                           (* Port: Port selected (COM1 thru COM16) *)
  652.  
  653.  
  654.                Remarks     The  SioGetDiv  function reads the baud rate divisor. The baud
  655.                           rate can then be determined by the divisor:
  656.  
  657.                           Baud   Divisor      Baud  Divisor      Baud  Divisor
  658.                            300    0180        4800   0018       38400   0003
  659.                           1200    0060        9600   000C       57600   0002
  660.                           2400    0030       19200   0006      115200   0001
  661.  
  662.                Returns    -2 : Port not enabled. Call SioReset first.
  663.                           -4 : No such port. Expect 0 to MaxPort.
  664.                           >0 : Baud rate divisor.
  665.  
  666.               See Also    SioParms.
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.              PCL4P Reference Manual                                            Page 10
  681.               +-------------+------------------------------------------------------------+
  682.               |   SioInfo   |  Returns PCL4P library information.                        |
  683.               +-------------+------------------------------------------------------------+
  684.  
  685.  
  686.                 Syntax    function SioInfo(Cmd:Char):Integer;
  687.                           (* Cmd: Command ('V' or 'I') *)
  688.  
  689.                Remarks    The  SioInfo  function returns an integer code  corresponding to
  690.                           either the (1) library version number  or  (2)  whether  or  not
  691.                           transmitter interrupts are enabled.
  692.  
  693.  
  694.                Returns    Version ('V')
  695.  
  696.                           hex byte XY where version is denoted as X.Y
  697.  
  698.                           TX Interrupts ('I')
  699.  
  700.                           TRUE  if  transmitter  interrupts  are  enabled  in the library,
  701.                           otherwise FALSE.
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.               +-------------+------------------------------------------------------------+
  714.               |    SioIRQ   |  Assigns an IRQ line to a port.                            |
  715.               +-------------+------------------------------------------------------------+
  716.  
  717.  
  718.                 Syntax    function SioIRQ(Port,IRQcode:Integer):Integer;
  719.                           (* Port:    Port selected (COM1 thru COM16) *)
  720.                           (* IRQcode: IRQ number [IRQ2..IRQ7] *)
  721.  
  722.                Remarks    The SioIRQ function assigns an IRQ line to  a  port.   That  is,
  723.                           SioIRQ  maps  an  IRQ  to a port.  SioIRQ (like SioUART) must be
  724.                           called before calling SioReset. Unless you have  a  non-standard
  725.                           (COM1  &  COM3  use IRQ4 while COM2 & COM4 use IRQ3) serial port
  726.                           configuration  (or  don't  want  to  run  more  than   2   ports
  727.                           concurrently),  you  will not need to call SioIRQ.  Be EXTREMELY
  728.                           careful with SioIRQ as it can lock  your  machine  up  if  given
  729.                           incorrect information.
  730.  
  731.                           In  particular,  remember  that your port hardware must generate
  732.                           the interrupt that you have specified.  You should refer to your
  733.                           serial  board  hardware  manual  for  specfic  instructions   in
  734.                           configuring  your  hardware.  Be  sure to call SioPorts first to
  735.                           setup DigiBoard ports if you have  them.   Refer  to  the  PCL4P
  736.                           Users Manual for additional information.
  737.  
  738.  
  739.                Returns    -4 : No such port. Expect 0 to MaxPort.
  740.                          -15 : Port already enabled.  SioReset has already been called.
  741.                          |17 : No such IRQ.
  742.                          -18 : ISR limit (maximum of 4 PC IRQs) exceeded.
  743.                            0 : Otherwise
  744.  
  745.               See Also    SioUART and SioPorts.
  746.  
  747.  
  748.              PCL4P Reference Manual                                            Page 11
  749.               +-------------+------------------------------------------------------------+
  750.               |   SioLine   |  Reads the line status register.                           |
  751.               +-------------+------------------------------------------------------------+
  752.  
  753.  
  754.                 Syntax    function SioLine(Port:Integer):Integer;
  755.                           (* Port: Port selected (COM1 thru COM16) *)
  756.  
  757.                Remarks    The  SioLine  function  reads  the  line  status  register.  The
  758.                           individual bit masks are as follows:
  759.  
  760.                           0x40  = Transmitter empty.
  761.                           0x20  = Transmitter buffer empty.
  762.                           0x10  = Break detected.
  763.                           0x08  = Framming error.
  764.                           0x04  = Parity error.
  765.                           0x02  = Overrun error.
  766.                           0x01  = Data ready.
  767.  
  768.                           The above are documented in the file PCL4P.H.
  769.  
  770.                Returns    -2 : Port not enabled. Call SioReset first.
  771.                           -4 : No such port. Expect 0 to MaxPort.
  772.                           >0 : Line status (rightmost byte of word).
  773.  
  774.               See Also    SioModem.
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.               +-------------+------------------------------------------------------------+
  782.               | SioLoopBack |  Does a UART loopback test.                                |
  783.               +-------------+------------------------------------------------------------+
  784.  
  785.  
  786.                 Syntax    function SioLoopBack(Port:Integer):Integer;
  787.                           (* Port: Port selected (COM1 thru COM16) *)
  788.  
  789.                Remarks    SioLoopBack makes use of the built in loopback  test  capability
  790.                           of  the  INS8250  family  UART.  Normally SioLoopBack will never
  791.                           need to be called unless you suspect that your UART is bad. Many
  792.                           UARTs must be reset after running a loopback test.
  793.  
  794.                Returns      0 : Loopback test is successfull.
  795.                            -2 : Port not enabled. Call SioReset first.
  796.                            -4 : No such port.  Expect 0 to MaxPort.
  797.                           -12 : Loopback test fails.
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.              PCL4P Reference Manual                                            Page 12
  817.               +-------------+------------------------------------------------------------+
  818.               |   SioModem  |  Reads the modem status register.                          |
  819.               +-------------+------------------------------------------------------------+
  820.  
  821.  
  822.                 Syntax    function SioModem(Port,Mask:Integer):Integer;
  823.                           (* Port: Port selected (COM1 thru COM16) *)
  824.                           (* Mask: Modem function mask *)
  825.  
  826.                Remarks    The  SioModem  function  reads  the  modem  register.    The bit
  827.                           definitions for the function mask are as follows:
  828.  
  829.                           Bit Name  Function               Bit  Name      Function
  830.                            7  DCD   Data Carrier Detect     3   DeltaDCD  DCD has changed
  831.                            6  RI    Ring Indicator          2   DeltaRI   RI has changed
  832.                            5  DSR   Data Set Ready          1   DeltaDSR  DSR has changed
  833.                            4  CTS   Clear To Send           0   DeltaCTS  CTS has changed
  834.  
  835.                           Bits  4  through  7  represent  the  absolute  state  of   their
  836.                           respective  RS-232  inputs.  Bits 0 through 3 represent a change
  837.                           in the state of their respective RS-232 inputs since last  read.
  838.                           Once UART register 3 is read, the Delta bits are cleared.  Thus,
  839.                           it is best not to depend on the Delta bits.
  840.  
  841.  
  842.                Returns    -2 : Port not enabled. Call SioReset first.
  843.                           -4 : No such port. Expect 0 to MaxPort.
  844.                           >0 : Modem status (rightmost byte of word).
  845.  
  846.               See Also   SioCTS, SioDCD, SioDSR and SioRI.
  847.  
  848.  
  849.               +-------------+------------------------------------------------------------+
  850.               |  SioParms   |  Sets parity, stop bits, and word length.                  |
  851.               +-------------+------------------------------------------------------------+
  852.  
  853.  
  854.                Syntax     int  SioParms(Port,Parity,StopBits,DataBits:Integer):Integer;
  855.                           (* Port:     Port selected (COM1 - COM16) *)
  856.                           (* Parity:   Parity code [0,1,2] *)
  857.                           (* StopBits: Stop bits code [0,1] *)
  858.                           (* DataBits: Word length code [0,1,2,3] *)
  859.  
  860.                Remarks    The SioParms function sets  the  parity,  stop  bits,  and  word
  861.                           length.   If  the  default parity (none), stop bits (1), or word
  862.                           length (8) is not  acceptable,  then  they  can  be  changed  by
  863.                           calling SioParms.  SioParms can be called either before or after
  864.                           calling SioReset. See file PCL4P.H. (8 = default)
  865.  
  866.                                         Value   Description    PCL4P.H Name
  867.                           ParityCode:    *0      no parity      NoParity
  868.                                           1      odd parity     OddParity
  869.                                           3      even parity    EvenParity
  870.                           StopBitsCode:  *0      1 stop bit     OneStopBit
  871.                                           1      2 stop bits    TwoStopBits
  872.                           WordLengthCode: 0      5 data bits    WordLength5
  873.                                           1      6 data bits    WordLength6
  874.                                           2      7 data bits    WordLength7
  875.                                          *3      8 data bits    WordLength8
  876.  
  877.               Returns     -4 : No such port. Expect 0 to MaxPort.
  878.                           -7 : Bad parity code selected. Expecting  0 to 2.
  879.                           |8 : Bad stop bits code. Expecting  0 or 1.
  880.                           -9 : Bad word length code. Expecting  0 to 3.
  881.  
  882.              See Also    SioReset.
  883.  
  884.              PCL4P Reference Manual                                            Page 13
  885.               +-------------+------------------------------------------------------------+
  886.               |  SioPorts   |  Sets number of PC & Digiboard / BOCA Board ports.         |
  887.               +-------------+------------------------------------------------------------+
  888.  
  889.  
  890.                 Syntax    function SioPorts(NbrPorts,FirstPort,StatusReg,Code:Integer)
  891.                                      :Integer;
  892.                           (* NbrPorts:  Total number of ports *)
  893.                           (* FirstPort: First DigiBoard port *)
  894.                           (* StatusReg: DigiBoard Status Register *)
  895.                           (* Code:      PC_PORTS, DIGIBOARD, or BOCABOARD *)
  896.  
  897.                Remarks    The SioPorts function must be called  before  ANY  other  serial
  898.                           functions.   The  purpose of the SioPorts function is to set the
  899.                           total number of ports, the first DigiBoard (or BOCA board)  port
  900.                           and the DigiBoard (or BOCA board) status register address.
  901.  
  902.                           Once SioPorts is called, all COM ports starting with "FirstPort"
  903.                           will be treated as DigiBoard (or BOCA board) ports.  The default
  904.                           setup is 4 standard PC ports and no DigiBoard or  BOCA  ports  [
  905.                           SioPorts(4,4,0,PC_PORTS) ].
  906.  
  907.                           Refer  to  ther  PCL4P users maniual for more information on the
  908.                           DigiBoard and BOCA board.
  909.  
  910.                Returns    -4 : No such port. Expect 0 to 9.
  911.                           0 : No error (sets MaxPort to NumberPorts-1).
  912.  
  913.               See Also    SioUART, SioIRQ, and Code Examples.
  914.  
  915.  
  916.  
  917.               +-------------+------------------------------------------------------------+
  918.               |   SioPutc   |  Transmit a character over a serial line.                  |
  919.               +-------------+------------------------------------------------------------+
  920.  
  921.  
  922.                 Syntax    function SioPutc(Port:Integer;Ch:Char):Integer;
  923.                           (* Port: Port selected (COM1 thru COM16) *)
  924.                           (* Ch:   Character to send *)
  925.  
  926.                Remarks    The SioPutc function transmits one character  over the  selected
  927.                           serial line.
  928.  
  929.                           If  flow  control has been enabled, then SioPutc may return a -1
  930.                           (time out) if the  number  of  tics  specified  in  the  SioFlow
  931.                           function was exceeded waiting for the modem to raise CTS.
  932.  
  933.                           Refer to the User's Manual for a discussion of flow control.
  934.  
  935.                           If  transmitter  interrupts  are  enabled  (there  are  separate
  936.                           versions of the library  for  transmitter  interrupts  enabled),
  937.                           then  the  byte  is  placed  in  the  transmit  buffer, awaiting
  938.                           transmission by the PCL4P interrupt service routine.
  939.  
  940.                Returns    -2 : Port not enabled. Call SioReset first.
  941.                           -4 : No such port. Expect 0 to MaxPort.
  942.                           -1 : Timed out waiting for CTS (flow control enabled)
  943.  
  944.               See Also    SioGetc and SioFlow.
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.              PCL4P Reference Manual                                            Page 14
  953.               +-------------+------------------------------------------------------------+
  954.               |   SioRead   |  Reads any UART register.                                  |
  955.               +-------------+------------------------------------------------------------+
  956.  
  957.  
  958.                 Syntax    function SioRead(Port,Reg:Integer):Integer;
  959.                           (* Port: Port selected (COM1 thru COM16) *)
  960.                           (* Reg:  UART register (0 to 7) *)
  961.  
  962.                Remarks    The SioReset function directly reads the contents of any of  the
  963.                           7  UART  registers.   This  function  is  useful  when debugging
  964.                           application  programs  and  as  a  method  for  verifying   UART
  965.                           contents.   Refer  to the PCL4P Users Manual for a discussion of
  966.                           the 7 UART registers.
  967.  
  968.                           The line status register (register 5)  can  also  be  read  with
  969.                           SioLine while the modem status register (register 6) can also be
  970.                           read  with  SioModem.  Refer  to  the  PCL4P User's Manual for a
  971.                           discussion of the UART registers.
  972.  
  973.                Returns     -3 : No buffer available. Call SioRxBuf first.
  974.                            -4 : No such port. Expect 0 to MaxPort.
  975.  
  976.               See Also    SioLine and SioModem.
  977.  
  978.  
  979.  
  980.               +-------------+------------------------------------------------------------+
  981.               |  SioReset   |  Initialize a serial port for processing.                  |
  982.               +-------------+------------------------------------------------------------+
  983.  
  984.  
  985.                 Syntax    function SioReset(Port,BaudCode:Integer):Integer;
  986.                           (* Port:     Port selected (COM1 thru COM16) *)
  987.                           (* BaudCode: Baud code or -1 *)
  988.  
  989.                Remarks    The SioReset function  initializes  the  selected  serial  port.
  990.                           SioReset should be called after calling SioParm and SioRxBuf but
  991.                           before  making  any  other  calls  to  PCL4P.  SioReset uses the
  992.                           parity, stop bits, and  word  length  value  previously  set  if
  993.                           SioParm  was  called, otherwise the default values (see SioParm)
  994.                           are used.
  995.  
  996.                           Recall that COM1 and COM3 share the same  interrupt  vector  and
  997.                           therefore  cannot  operate  simultaneously. Similiarly, COM2 and
  998.                           COM4 cannot operate simultaneously. Any other combination of two
  999.                           ports can be used.
  1000.  
  1001.                           By specifing NORESET (-1) for the baud rate code, the port  will
  1002.                           NOT  be  reset.   This is used to "take over" a port from a host
  1003.                           communications program that allows a  "DOS  gateway".   External
  1004.                           protocols  can  be implemented this way.  See SioBaud for a list
  1005.                           of the baud rate codes, or see "PCL4P.H".
  1006.  
  1007.                Returns     -3 : No buffer available. Call SioRxBuf first.
  1008.                            -4 : No such port. Expect 0 to MaxPort.
  1009.                           -11 : Bad baud rate code selected. Expecting  0 to 9.
  1010.                           |13 : UART undefined.  SioUART(Port,0) was called previously.
  1011.                           |14 : Bad or missing UART.  You may not have hardware present.
  1012.                           |15 : Port already enabled.  SioReset has already been called.
  1013.                           -16 : Interrupt already in use.
  1014.  
  1015.               See Also    SioBaud, SioParms, SioRxBuf, SioDone, and SioUART.
  1016.  
  1017.  
  1018.  
  1019.  
  1020.              PCL4P Reference Manual                                            Page 15
  1021.               +-------------+------------------------------------------------------------+
  1022.               |    SioRI    |  Reads the Ring Indicator (RI) modem status bit.           |
  1023.               +-------------+------------------------------------------------------------+
  1024.  
  1025.  
  1026.                 Syntax    function SioRI(Port:Integer):Integer;
  1027.                           (* Port: Port selected (COM1 thru COM16) *)
  1028.  
  1029.                Remarks    The SioRI function is used to read the Ring  Indicator
  1030.                           (RI) modem status bit. Also see SioModem.
  1031.  
  1032.                Returns    -2 : Port not enabled. Call SioReset first.
  1033.                           -4 : No such port.  Expect 0 to MaxPort.
  1034.                            0 : RI is clear.
  1035.                           >0 : RI is set (RING has occurred).
  1036.  
  1037.               See Also    SioDSR, SioCTS, SioDCD, and SioModem.
  1038.  
  1039.  
  1040.  
  1041.  
  1042.               +-------------+------------------------------------------------------------+
  1043.               |    SioRTS   |  Sets, clears, or reads the Request to Send (RTS) line.    |
  1044.               +-------------+------------------------------------------------------------+
  1045.  
  1046.  
  1047.                 Syntax    function SioRTS(Port:Integer;Cmd:Char):Integer;
  1048.                           (* Port: Port selected (COM1 thru COM16) *)
  1049.                           (* Cmd:  RTS command (SET, CLEAR, or READ) *)
  1050.  
  1051.                Remarks    The SioRTS function controls the Request to Send (RTS bit in the
  1052.                           modem control register.
  1053.  
  1054.                           The  RTS  line  is  used  by  some  error  correcting  modems to
  1055.                           implement hardware flow control.  RTS is dropped by the computer
  1056.                           to signal the modem not to send data, and is  raised  to  signal
  1057.                           the modem to continue. RTS should be set when communicating with
  1058.                           a modem unless Flow Control is being used.
  1059.  
  1060.                           Refer  to  the  User's  Manual for a discussion of flow control.
  1061.                           Commands (defined in PCL4P.H) are:
  1062.  
  1063.                           SET_LINE ('S')   - set RTS (ON)
  1064.                           CLEAR_LINE ('C') | clear RTS (OFF)
  1065.                           READ_LINE ('R')  - read RTS
  1066.  
  1067.                Returns    -2 : Port not enabled. Call SioReset first.
  1068.                           -4 : No such port. Expect 0 to MaxPort.
  1069.                           -5 : Command is not one of 'S', 'C', or 'R'.
  1070.                            0 : RTS is OFF (READ_LINE Command).
  1071.                           >0 : RTS is ON  (READ_LINE Command).
  1072.  
  1073.               See Also    SioFlow and SioDTR.
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.  
  1081.  
  1082.  
  1083.  
  1084.  
  1085.  
  1086.  
  1087.  
  1088.              PCL4P Reference Manual                                            Page 16
  1089.               +------------+-------------------------------------------------------------+
  1090.               |  SioRxBuf  |  Sets up receive buffers.                                   |
  1091.               +------------+-------------------------------------------------------------+
  1092.  
  1093.  
  1094.                 Syntax    function SioRxBuf(Port,Selector,SizeCode:Integer):Integer;
  1095.                           (* Port:     Port selected (COM1 thru COM16) *)
  1096.                           (* Selector: Receive buffer selector *)
  1097.                           (* SizeCode: Buffer size code *)
  1098.  
  1099.                Remarks     The  SioRxBuf  function passes the address selector and size of
  1100.                           the receive buffer to  PCL4P.   Recall  that  PCL4P  requires  a
  1101.                           receive buffer for each port in simultaneous operation since the
  1102.                           receive  function is interrupt driven.  It must be called before
  1103.                           any incoming characters can be received. SioRxBuf must be called
  1104.                           before SioReset.  Buffer size codes are listed in "PCL4P.H".
  1105.  
  1106.                           Size Code       Buffer Size    PCL4P.H Name
  1107.                              4            128 bytes        Size128
  1108.                              5            256 bytes        Size256
  1109.                              6            512 bytes        Size512
  1110.                              7           1024 bytes        Size1024 or Size1K
  1111.                              8           2048 bytes        Size2048 or Size2K
  1112.                              9           4096 bytes        Size4096 or Size4K
  1113.                             10           8192 bytes        Size8192 or Size8K
  1114.                             11          16384 bytes        Size16384 or Size16K
  1115.                             12          32768 bytes        Size32768 or Size32K
  1116.  
  1117.                Returns    -4 : No such port. Expect 0 to MaxPort.
  1118.                          -10 : Bad buffer size code. Expecting 0 to 11.
  1119.  
  1120.               See Also    SioReset and Code Examples.
  1121.  
  1122.  
  1123.  
  1124.  
  1125.               +------------+-------------------------------------------------------------+
  1126.               | SioRxFlush |  Flushes (clears) the receive buffer.                       |
  1127.               +------------+-------------------------------------------------------------+
  1128.  
  1129.  
  1130.                 Syntax    function SioRxFlush(Port:Integer):Integer;
  1131.                           (* Port: Port selected (COM1 thru COM16) *)
  1132.  
  1133.                Remarks    The SioRxFlush  function  will  delete  any  characters  in  the
  1134.                           receive  buffer  for  the  specified port.  After execution, the
  1135.                           receive buffer will be empty.  Call SioRxBuf after  resetting  a
  1136.                           port in order to delete any spurious characters.
  1137.  
  1138.                Returns    -2 : Port not enabled. Call SioReset first.
  1139.                           -4 : No such port. Expect 0 to MaxPort.
  1140.  
  1141.               See Also    SioRxQue.
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.              PCL4P Reference Manual                                            Page 17
  1157.               +-------------+------------------------------------------------------------+
  1158.               |  SioRxQue   |  Returns the number of bytes in the receive queue.         |
  1159.               +-------------+------------------------------------------------------------+
  1160.  
  1161.  
  1162.                 Syntax    function SioRxQue(Port:Integer):Integer;
  1163.                           (* Port: Port selected (COM1 thru COM16) *)
  1164.  
  1165.                Remarks    The  SioRxQue  function  will return the number of characters in
  1166.                           the receive queue at the time of the call. It  can  be  used  to
  1167.                           implement XON/XOFF flow control.
  1168.  
  1169.                Returns    -2 : Port not enabled. Call SioReset first.
  1170.                           -4 : No such port. Expect 0 to MaxPort.
  1171.  
  1172.               See Also     SioRxFlush.
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.               +------------+---------------------------------------------------------+---*
  1190.               |  SioTimer  |  Returns the number of system clock tics since midnight |
  1191.               +------------+---------------------------------------------------------+---*
  1192.  
  1193.  
  1194.                 Syntax    function SioTimer:LongInt;
  1195.  
  1196.                Remarks     The  SioTimer  function will return the number of system clock
  1197.                           tics since midnight, at 18.2065 tics per second.  This  function
  1198.                           is usefull for timing various functions.
  1199.  
  1200.               See Also    SioDelay
  1201.  
  1202.  
  1203.  
  1204.  
  1205.  
  1206.  
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.              PCL4P Reference Manual                                            Page 18
  1225.               +------------+-------------------------------------------------------------+
  1226.               |  SioTxBuf  |  Sets up transmitter buffer.                                |
  1227.               +------------+-------------------------------------------------------------+
  1228.  
  1229.  
  1230.                 Syntax    function SioTxBuf(Port,Selector,SizeCode:Integer):Integer;
  1231.                           (* Port:     Port selected (COM1 thru COM16) *)
  1232.                           (* Selector: Receive buffer selector *)
  1233.                           (* SizeCode: Buffer size code *)
  1234.  
  1235.                           int Port;     (* Port selected (COM1 thru COM16) *)
  1236.                           char *Buffer; (* Transmit buffer *)
  1237.                           int SizeCode; (* Buffer size code *)
  1238.  
  1239.                Remarks     The  SioTxBuf  function passes the address selector and size of
  1240.                           the transmit buffer to PCL4P, provided that you will link with a
  1241.                           PCL4P  library  with  transmitter  interrupts  enabled.    PCL4P
  1242.                           requires  a  transmit  buffer  for  each  port  in  simultaneous
  1243.                           operation if you are using  the  version  of  the  library  with
  1244.                           transmitter interrupts enabled (PCL4P2.LIB).  SioTxBuf() must be
  1245.                           called before SioReset.
  1246.  
  1247.                           Size Code       Buffer Size    PCL4P.H Name
  1248.                              4            128 bytes        Size128
  1249.                              5            256 bytes        Size256
  1250.                              6            512 bytes        Size512
  1251.                              7           1024 bytes        Size1024 or Size1K
  1252.                              8           2048 bytes        Size2048 or Size2K
  1253.                              9           4096 bytes        Size4096 or Size4K
  1254.                             10           8192 bytes        Size8192 or Size8K
  1255.                             11          16384 bytes        Size16384 or Size16K
  1256.                             12          32768 bytes        Size32768 or Size32K
  1257.  
  1258.                           This function is not used unless the transmitter interrupts  are
  1259.                           enabled  (PCL4P_2.OBJ).   Refer  to  the  PCL4P Users Manual for
  1260.                           information on transmitter (TX) interrupts.
  1261.  
  1262.                Returns     -4 : No such port. Expect 0 to MaxPort.
  1263.                           -10 : Bad buffer size code. Expecting 0 to 11.
  1264.  
  1265.               See Also    SioRxBuf, SioReset and Code Examples.
  1266.  
  1267.  
  1268.               +------------+-------------------------------------------------------------+
  1269.               | SioTxFlush |  Flushes (clears) the transmitter buffer.                   |
  1270.               +------------+-------------------------------------------------------------+
  1271.  
  1272.  
  1273.                 Syntax    function SioTxFlush(Port:Integer):Integer;
  1274.                           (* Port: Port selected (COM1 thru COM16) *)
  1275.  
  1276.                Remarks    The SioTxFlush  function  will  delete  any  characters  in  the
  1277.                           transmit  buffer  for the specified port, provided that you will
  1278.                           link with a PCL4P library with transmitter  interrupts  enabled.
  1279.                           After execution, the transmit buffer will be empty.
  1280.  
  1281.                           Once  this  function is called, any character  in  the  transmit
  1282.                           buffer  (put  there  by  SioPutc) will be lost and therefore not
  1283.                           transmitted. This function is not used  unless  the  transmitter
  1284.                           interrupts  are  enabled  Refer  to  the  PCL4P Users Manual for
  1285.                           information on transmitter (TX) interrupts.
  1286.  
  1287.                Returns    -2 : Port not enabled. Call SioReset first.
  1288.                           -4 : No such port. Expect 0 to MaxPort.
  1289.  
  1290.               See Also    SioTxQue.
  1291.  
  1292.              PCL4P Reference Manual                                            Page 19
  1293.               +------------+-------------------------------------------------------------+
  1294.               |  SioTxQue  |  Returns the number of bytes in the transmit queue.         |
  1295.               +------------+-------------------------------------------------------------+
  1296.  
  1297.  
  1298.                 Syntax    function SioTxQue(Port:Integer):Integer;
  1299.                           (* Port: Port selected (COM1 thru COM16) *)
  1300.  
  1301.                Remarks    The SioTxQue function will return the number  of  characters  in
  1302.                           the  transmit  queue  at the time of the call, provided that you
  1303.                           will link with  a  PCL4P  library  with  transmitter  interrupts
  1304.                           enabled.
  1305.  
  1306.                           This function is not used unless the transmitter interrupts  are
  1307.                           enabled.  Refer  to  the  PCL4P  Users Manual for information on
  1308.                           transmitter (TX) interrupts.
  1309.  
  1310.                Returns    -2 : Port not enabled. Call SioReset first.
  1311.                           -4 : No such port. Expect 0 to MaxPort.
  1312.  
  1313.               See Also     SioTxFlush.
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.               +------------+-------------------------------------------------------------+
  1320.               |  SioUART   |  Sets the UART base address.                                |
  1321.               +------------+-------------------------------------------------------------+
  1322.  
  1323.  
  1324.                 Syntax    function SioUART(Port,Address:Integer):Integer;
  1325.                           (* Port:    Port selected (COM1 thru COM16) *)                           int Port;     (* COM1 to COM4 *)
  1326.                           (* Address: UART address *)
  1327.  
  1328.                Remarks    The  SioUART  function  sets  the  UART  base  address  for  the
  1329.                           specified port.  SioUART must be called before SioReset in order
  1330.                           to have effect.  Be extremely sure that you know  what  you  are
  1331.                           doing!   Note   that  PCL4P  uses  the  standard  PC/XT/AT  port
  1332.                           addresses,  interrupt  request  lines,  and  interrupt   service
  1333.                           vectors.   Therefore,   this   function   is   only  needed  for
  1334.                           non-standard ports.
  1335.  
  1336.                Returns    >0 : The previous base address for this port.
  1337.                           -4 : No such port.  Expect 0 to MaxPort.
  1338.                          -15 : Port already enabled.  SioReset has already been called.
  1339.  
  1340.               See Also    SioPorts, SioIRQ, and SioReset.
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.              PCL4P Reference Manual                                            Page 20
  1361.               +------------+-----+-------------------------------------------------------+
  1362.               | SioUnGetc  |  "Un|gets" the last character read with SioGetc().          |
  1363.               +------------+-----+-------------------------------------------------------+
  1364.  
  1365.  
  1366.                 Syntax    function SioUnGetc(Port:Integer;Ch:Char):Integer;
  1367.                           (* Port: Port selected (COM1 thru COM16) *)
  1368.                           (* Ch:   Character to unget *)
  1369.  
  1370.                Remarks    The SioUnGetc function returns  ("pushes")  the  character  back
  1371.                           into  the serial input buffer.  The character pushed will be the
  1372.                           next character returned by SioGetc.  Only one character  can  be
  1373.                           pushed back. This function works just like the "ungetc" function
  1374.                           in the C language.
  1375.  
  1376.                Returns    -2 : Port not enabled. Call SioReset first.
  1377.                           -4 : No such port. Expect 0 to MaxPort.
  1378.  
  1379.               See Also    SioReset.
  1380.  
  1381.  
  1382.  
  1383.                                        Function Sumary
  1384.  
  1385.  
  1386.  
  1387.                    +-------------+----------+----------+----------+----------+
  1388.                    | Function    |   Arg1   |   Arg2   |   Arg3   |   Arg4   |
  1389.                    +-------------+----------+----------+----------+----------+
  1390.                    | SioBaud     | Port     | BaudCode |          |          |
  1391.                    | SioBrkSig   | Port     | Cmd      |          |          |
  1392.                    | SioCTS      | Port     |          |          |          |
  1393.                    | SioDCD      | Port     |          |          |          |
  1394.                    | SioDone     | Port     |          |          |          |
  1395.                    | SioDSR      | Port     |          |          |          |
  1396.                    | SioDTR      | Port     | Cmd      |          |          |
  1397.                    | SioError    | Code     |          |          |          |
  1398.                    | SioFIFO     | Port     | FIFOcode |          |          |
  1399.                    | SioFlow     | Port     |          |          |          |
  1400.                    | SioGetc     | Port     |          |          |          |
  1401.                    | SioGetDiv   | Port     |          |          |          |
  1402.                    | SioInfo     | Cmd      |          |          |          |
  1403.                    | SioIRQ      | Port     | IRQcode  | ISRcode  |          |
  1404.                    | SioLine     | Port     |          |          |          |
  1405.                    | SioLoopBack | Port     |          |          |          |
  1406.                    | SioModem    | Port     | Mask     |          |          |
  1407.                    | SioParms    | Port     | Parity   | StopBits |WordLength|
  1408.                    | SioPorts    | NbrPorts | FirstDBP |StatusReg | Code     |
  1409.                    | SioPutc     | Port     | Ch       |          |          |
  1410.                    | SioRead     | Port     | Register |          |          |
  1411.                    | SioReset    | Port     | BaudCode |          |          |
  1412.                    | SioRI       | Port     |          |          |          |
  1413.                    | SioRTS      | Port     | Cmd      |          |          |
  1414.                    | SioRxBuf    | Port     | Buffer   | SizeCode |          |
  1415.                    | SioRxFlush  | Port     |          |          |          |
  1416.                    | SioRxQue    | Port     |          |          |          |
  1417.                    | SioTxBuf    | Port     | Buffer   | SizeCode |          |
  1418.                    | SioTxFlush  | Port     |          |          |          |
  1419.                    | SioTxQue    | Port     |          |          |          |
  1420.                    | SioUART     | Port     | Address  |          |          |
  1421.                    | SioUnGetc   | Port     | Ch       |          |          |
  1422.                    +-------------+----------+----------+----------+----------+
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.              PCL4P Reference Manual                                            Page 21
  1429.                                        Error Code Summary
  1430.  
  1431.  
  1432.  
  1433.               +------+--------------------------------------------------------+
  1434.               | Code |  Description                                           |
  1435.               +------+--------------------------------------------------------+
  1436.               |   0  |  No error.                                             |
  1437.               |  -1  |  Timeout waiting for I/O.                              |
  1438.               |  |2  |  Port not enabled. Call SioReset first.                |
  1439.               |  |3  |  No buffer available. Call SioRxBuf first.             |
  1440.               |  |4  |  No such port. Expect 0 to MaxPort. (COM1 = 0)         |
  1441.               |  |5  |  Expected 'S', 'C', or 'R' as 2nd argument.            |
  1442.               |  |6  |  Expected 'A', 'C', or 'D' as 2nd argument.            |
  1443.               |  |7  |  Bad parity code specified. Expected 0 to 7.           |
  1444.               |  |8  |  Bad stop bits code specified. Expected 0 or 1.        |
  1445.               |  -9  |  Bad wordlength code specified. Expect 0 to MaxPort.   |
  1446.               | -10  |  Bad buffer size code specified. Expected 0 to 11.     |
  1447.               | |11  |  Bad baud rate code. Expected 0 to 9.                  |
  1448.               | |12  |  Loopback test fails.                                  |
  1449.               | |13  |  UART undefined.                                       |
  1450.               | |14  |  Missing or bad UART. (no UART hardware ?)             |
  1451.               | |15  |  Port already enabled.                                 |
  1452.               | |16  |  ISR (interrupt) already in use.                       |
  1453.               | |17  |  No such IRQ. (Should be 2 to 7)                       |
  1454.               | |18  |  ISR limit (maximum of 4 PC IRQs) exceeded.            |
  1455.               +-+----+--------------------------------------------------------+
  1456.  
  1457.  
  1458.                                        Code Examples
  1459.  
  1460.  
  1461.               SioRxBuf() Example
  1462.  
  1463.               DigiBoard Example
  1464.  
  1465.               BOCA Board Example
  1466.  
  1467.  
  1468.  
  1469.  
  1470.  
  1471.  
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.              PCL4P Reference Manual                                            Page 22
  1497.