home *** CD-ROM | disk | FTP | other *** search
/ Shareware 1 2 the Maxx / sw_1.zip / sw_1 / PROGRAM / PCL4P30.ZIP / PCL4P.REF < prev    next >
Text File  |  1992-01-24  |  40KB  |  1,981 lines

  1.  
  2.  
  3.                       Personal Communications Library
  4.  
  5.                         For Turbo Pascal 4.0 & up
  6.  
  7.  
  8.                                ( PCL4P )
  9.  
  10.  
  11.  
  12.  
  13.                       REFERENCE MANUAL
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.                               Version 3.0
  21.  
  22.                               Jan 15, 1992
  23.  
  24.  
  25.  
  26.  
  27.                     This software is provided as-is.
  28.               There are no warranties, expressed or implied.
  29.  
  30.  
  31.  
  32.  
  33.                            Copyright (C) 1992
  34.                            All rights reserved
  35.  
  36.  
  37.  
  38.                            MarshallSoft Computing, Inc.
  39.                            Post Office Box 4543
  40.                            Huntsville AL 35815
  41.  
  42.                            Phone (205) 881-4630
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.       PCL4P Reference Manual                                  Page 1
  63.  
  64.  
  65.  
  66.  
  67.                              Table of Contents
  68.  
  69.  
  70.  
  71.  
  72.  
  73.        Chapter                                        Page
  74.  
  75.           Table of Contents.............................2
  76.           Introduction..................................3
  77.           SioBaud.......................................4
  78.           SioBrkKey.....................................5
  79.           SioBrkSig.....................................6
  80.           SioCTS........................................7
  81.           SioDCD........................................8
  82.           SioDelay......................................9
  83.           SioDone......................................10
  84.           SioDSR.......................................11
  85.           SioDTR.......................................12
  86.           SioError.....................................13
  87.           SioGetc......................................14
  88.           SioLine......................................15
  89.           SioLoopBack..................................16
  90.           SioModem.....................................17
  91.           SioParms.....................................18
  92.           SioPutc......................................19
  93.           SioReset.....................................20
  94.           SioRI........................................21
  95.           SioRTS.......................................22
  96.           SioRxBuf.....................................23
  97.           SioRxFlush...................................24
  98.           SioRxQue.....................................25
  99.           SioTimer.....................................26
  100.           SioUART......................................27
  101.           SioUnGetc....................................28
  102.        Function Summary................................29
  103.        Error Code Summary..............................30
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.       PCL4P Reference Manual                                  Page 2
  129.  
  130.  
  131.  
  132.  
  133.                              Introduction
  134.  
  135.  
  136.  
  137.        This  manual  list  all the PCL4P functions in alphabetical order.
  138.        Every library function will return a value as follows:
  139.  
  140.        1.  Negative values for error conditions. See last  page  of  this
  141.            manual for a list of error values and their meanings.
  142.  
  143.        2.  Non-negative values when returning data ( eg: SioLine ).
  144.  
  145.        3.  Zero otherwise.
  146.  
  147.        When  debugging an application, be sure to test all return values.
  148.        Use SioError to print the associated text for errors.
  149.  
  150.  
  151.        Example Code Segment
  152.  
  153.        +--------------------------------------------------------+
  154.        |  RetCode := SioFunction();    (* any PCL4P function *) |
  155.        |  if RetCode < 0 then begin                             |
  156.        |    RetCode := SioError(RetCode);                       |
  157.        |    (* ...do some stuff... *)                           |
  158.        |    end;                                                |
  159.        +--------------------------------------------------------+
  160.  
  161.        For  more examples, examine each of the example programs provided.
  162.        Also look at the examples associated with  each  library  function
  163.        described in the following section.
  164.  
  165.  
  166.  
  167.  
  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.       PCL4P Reference Manual                                  Page 3
  195.  
  196.  
  197.  
  198.  
  199.                                   SioBaud
  200.  
  201.  
  202.        Function    Sets the baud rate of the selected port.
  203.  
  204.          Syntax    function SioBaud(Port,BaudCode:Integer) : Integer;
  205.  
  206.         Remarks    The  SioBaud  function  sets  the  baud  rate  without
  207.                    resetting the port. It is used to change the baud rate
  208.                    after calling SioReset.
  209.  
  210.                    Baud Code           Baud Rate       PCL4P.H Name
  211.                         0                 300            Baud300
  212.                         1                 600            Baud600
  213.                         2                1200            Baud1200
  214.                         3                2400            Baud2400
  215.                         4                4800            Baud4800
  216.                         5                9600            Baud9600
  217.                         6               19200            Baud19200
  218.                         7               38400            Baud38400
  219.                         8               57600            Baud57600
  220.                         9              115200            Baud115200
  221.  
  222.  
  223.         Returns     -4 : Port out of range. Expecting   0  to 3.
  224.                    -11 : Bad baud rate code. See above code values.
  225.  
  226.         Example
  227.  
  228.                     /* do auto baud detect */
  229.                     for Code = 0 to 9 do begin
  230.                     RetCode := SioBaud(Port,Code);
  231.                     RetCode := SioPutc(Port,'A');
  232.                     if SioGetc(Port,18) = Ord('A') then
  233.                       begin
  234.                         writeln('Baud rate detected');
  235.                         (*...do something here...*)
  236.                       end
  237.                     end;
  238.  
  239.        See Also    SioReset
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.       PCL4P Reference Manual                                  Page 4
  261.  
  262.  
  263.  
  264.  
  265.                                   SioBrkKey
  266.  
  267.  
  268.        Function    Return non-zero if the Control-BREAK key was
  269.                    pressed.
  270.  
  271.          Syntax    function SioBrkKey : Integer;
  272.  
  273.         Remarks    The SioBrkKey function returns a TRUE value ( non zero
  274.                    ) if  the  Control-BREAK  key  was  pressed,  else  it
  275.                    returns a zero.  Use SioBrkKey as a safety exit from a
  276.                    polling   loop.   Don't  mix  this  function  up  with
  277.                    SioBrkSig.
  278.  
  279.         Returns    -1 : Control-BREAK was pressed.
  280.                     0 : Control-BREAK was NOT pressed.
  281.  
  282.         Example
  283.  
  284.                    if SioBrkKey then
  285.                      begin
  286.                        writeln('User typed Contrl-BREAK');
  287.                        RetCode := SioDone(Port);
  288.                        halt;
  289.                      end;
  290.  
  291.        See Also    SioBrkSig
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.       PCL4P Reference Manual                                  Page 5
  327.  
  328.  
  329.  
  330.  
  331.                                   SioBrkSig
  332.  
  333.  
  334.  
  335.        Function    Asserts, cancels, or detects BREAK signal.
  336.  
  337.          Syntax    function SioBrkSig(Port:Integer;Cmd:Char) : Boolean;
  338.  
  339.         Remarks    The SioBrkSig function controls the BREAK  bit
  340.                    in the line status register. The legal commands are:
  341.  
  342.                    ASSERT ('A') to assert BREAK
  343.                    CANCEL ('C') to cancel BREAK
  344.                    DETECT ('D') to detect BREAK
  345.  
  346.                    ASSERT,  CANCEL,  and  DETECT  are defined in PCL4P.H.
  347.                    See TERM.C for an example of the use of SioBrkSig.
  348.  
  349.         Returns    -2 : Port not enabled. Call SioReset first.
  350.                    -4 : Port out of range. Expecting  0 to 3.
  351.                    -6 : Illegal command. Expected 'A', 'C', or 'D'.
  352.                    >0 : BREAK signal detected ( DETECT command only )
  353.  
  354.         Example
  355.  
  356.                    (* Assert BREAK for 1 second *)
  357.                    RetCode := SioBrkSig(Port,ASSERT);
  358.                    RetCode := SioDelay(18);
  359.                    RetCode := SioBrkSig(Port,CANCEL);
  360.                    (* Detect BREAK *)
  361.                    if SioBrkSig(Port,DETECT) then
  362.                      begin
  363.                        writeln('BREAK signal detected');
  364.                          (* ...do some more stuff... *)
  365.                      end
  366.  
  367.        See Also    SioBrkKey
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.       PCL4P Reference Manual                                  Page 6
  393.  
  394.  
  395.  
  396.  
  397.                                   SioCTS
  398.  
  399.  
  400.  
  401.        Function    Reads the Clear to Send ( CTS ) modem status bit.
  402.  
  403.          Syntax    function SioCTS(Port:Integer) : Integer;
  404.  
  405.         Remarks    The  SioCTS function is used to read the Clear to Send (
  406.                    CTS ) modem status bit.
  407.  
  408.         Returns    -2 : Port not enabled. Call SioReset first.
  409.                    -4 : Port out of range.  Expecting  0 to 3.
  410.                     0 : CTS is clear.
  411.                    >0 : CTS is set.
  412.  
  413.         Example
  414.  
  415.                    RetCode := SioCTS(Port);
  416.                    if RetCode > 0 then write('CTS is set');
  417.                    else write('CTS is clear');
  418.  
  419.        See Also    SioDSR, SioRI, SioDCD, and SioModem.
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.       PCL4P Reference Manual                                  Page 7
  459.  
  460.  
  461.  
  462.  
  463.                                   SioDCD
  464.  
  465.  
  466.  
  467.        Function    Reads the Data Carrier Detect ( DCD ) modem status bit.
  468.  
  469.          Syntax    function SioDCD(Port:Integer) : Integer;
  470.  
  471.         Remarks    The SioDCD function is used to read the  Data  Carrier
  472.                    Detect ( DCD ) modem status bit. Also see SioModem.
  473.  
  474.         Returns    -2 : Port not enabled. Call SioReset first.
  475.                    -4 : Port out of range.  Expecting  0 to 3.
  476.                     0 : DCD is clear.
  477.                    >0 : DCD is set.
  478.  
  479.         Example
  480.  
  481.                    RetCode := SioDCD(Port);
  482.                    if RetCode > 0 then write('DCD is set');
  483.                    else write('DCD is clear');
  484.  
  485.        See Also    SioDSR, SioCTS, SioRI, and SioModem.
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.       PCL4P Reference Manual                                  Page 8
  525.  
  526.  
  527.  
  528.  
  529.                                   SioDelay
  530.  
  531.  
  532.  
  533.        Function    Delays one or more tics.
  534.  
  535.          Syntax    function SioDelay(Tics:Integer) : Integer;
  536.  
  537.         Remarks    The  SioDelay  function  is used to delay one  or more
  538.                    timer tics, where each timer tic is  approximately  55
  539.                    milliseconds ( 18 to the second ).
  540.  
  541.         Returns    zero
  542.  
  543.         Example    (* delay 5 seconds *)
  544.                    RetCode := SioDelay(5*18);
  545.  
  546.        See Also    SioTimer
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.       PCL4P Reference Manual                                  Page 9
  591.  
  592.  
  593.  
  594.  
  595.                                   SioDone
  596.  
  597.  
  598.  
  599.        Function    Terminates further serial processing.
  600.  
  601.          Syntax    function SioDone(Port:Integer) : Integer
  602.  
  603.         Remarks    The  SioDone  function  terminates  further  serial
  604.                    processing. SioDone MUST be called before exiting your
  605.                    application so that  interrupts  can  be  restored  to
  606.                    their original state. Failure to do this can crash the
  607.                    operating  system.   If  you  forget  to  call SioDone
  608.                    before exiting, be sure to re-boot your computer.  You
  609.                    can call SioDone even if SioReset has not been called,
  610.                    so it is good practice to always call  SioDone  before
  611.                    exiting your application.
  612.  
  613.         Returns    -2 : Port not enabled. Call SioReset first.
  614.                    -4 : Port out of range. Expecting  0 to 3.
  615.  
  616.         Example    (* terminate processing for COM3 *)
  617.                    RetCode := SioDone(COM3);
  618.  
  619.        See Also    SioReset.
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.       PCL4P Reference Manual                                  Page 10
  657.  
  658.  
  659.  
  660.  
  661.                                   SioDSR
  662.  
  663.  
  664.  
  665.        Function    Reads the Data Set Ready ( DSR ) modem status bit.
  666.  
  667.          Syntax    function SioDSR(Port:Integer) : Integer;
  668.  
  669.         Remarks    The SioDSR function is used  to  read  the  Data  Set
  670.                    Ready ( DSR ) modem status bit.
  671.  
  672.         Returns    -2 : Port not enabled. Call SioReset first.
  673.                    -4 : Port out of range.  Expecting  0 to 3.
  674.                     0 : DSR is clear.
  675.                    >0 : DSR is set
  676.  
  677.         Example
  678.  
  679.                    RetCode := SioDSR(Port);
  680.                    if RetCode > 0 then write('DSR is set');
  681.                    else write('DSR is clear');
  682.  
  683.        See Also    SioCTS, SioRI, SioDCD, and SioModem
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.       PCL4P Reference Manual                                  Page 11
  723.  
  724.  
  725.  
  726.  
  727.                                   SioDTR
  728.  
  729.  
  730.  
  731.        Function    Set, clear, or read the Data Terminal Ready ( DTR ) bit.
  732.  
  733.          Syntax    function SioDTR(Port,Cmd:Integer) : Integer;
  734.  
  735.         Remarks    The SioDTR function controls the Data Terminal Ready (
  736.                    DTR  )  bit in the modem control register.  Commands (
  737.                    defined in PCL4P.H ) are:
  738.  
  739.                    SET ('S')  to set DTR ( ON )
  740.                    CLEAR ('C')  to clear DTR ( OFF )
  741.                    READ ('R')  to read DTR
  742.  
  743.         Returns    -2 : Port not enabled. Call SioReset first.
  744.                    -4 : Port out of range. Expecting  0 to 3.
  745.                    -5 : Not one of 'S', 'C', or 'R'.
  746.                     0 : DTR is OFF (READ Command).
  747.                    >0 : DTR is ON (READ Command).
  748.  
  749.         Example
  750.  
  751.                    (* turn DTR on for modem connected to COM4 *)
  752.                    RetCode := SioDTR(COM4,SET);
  753.  
  754.        See Also    SioRTS.
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.       PCL4P Reference Manual                                  Page 12
  789.  
  790.  
  791.  
  792.  
  793.                                   SioError
  794.  
  795.  
  796.        Function    Displays error in text.
  797.  
  798.          Syntax    function SioError(Code:Integer) : Integer;
  799.  
  800.         Remarks    The SioError  function  displays  the  error  in  text
  801.                    corresponding  to  the error code.  During development
  802.                    of a communications application, it is a good idea  to
  803.                    always   test   return  codes,  and  print  out  their
  804.                    descriptions with SioError.
  805.  
  806.         Returns    zero
  807.  
  808.         Example
  809.  
  810.                    RetCode := SioReset(Port,Baud4800);
  811.                    if RetCode < 0 then RetCode := SioError(RetCode);
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.       PCL4P Reference Manual                                  Page 13
  855.  
  856.  
  857.  
  858.  
  859.                                   SioGetc
  860.  
  861.  
  862.  
  863.        Function    Reads the next character from the serial line.
  864.  
  865.          Syntax    function SioGetc(Port,Tics:Integer) : Integer;
  866.  
  867.         Remarks    The  SioGetc function reads the selected serial port.
  868.                    The function will wait for the number of  system  tics
  869.                    given  by  the 'Tics' argument before returning 'timed
  870.                    out'. There are 18 tics to the second.
  871.  
  872.                    To specify no waiting, call SioGetc with Tics = 0.
  873.  
  874.         Returns    -2 : Port not enabled. Call SioReset first.
  875.                    -4 : Port out of range. Expecting  0 to 3.
  876.                    -1 : If timed out.
  877.                    >0 : Character read.
  878.  
  879.         Example
  880.  
  881.                    RetCode := SioGetc(COM1,1);
  882.                    if RetCode <> -1
  883.                      then  writeln('Character is ', chr(RetCode) );
  884.                      else writeln('Timed out');
  885.  
  886.        See Also    SioUnGetc and SioPutc.
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.       PCL4P Reference Manual                                  Page 14
  921.  
  922.  
  923.  
  924.  
  925.                                   SioLine
  926.  
  927.  
  928.  
  929.        Function    Reads the line status register.
  930.  
  931.          Syntax    function SioLine(Port:Integer) : Integer;
  932.  
  933.         Remarks    The  SioLine function reads the line status register.
  934.                    The individual bit masks are as follows:
  935.  
  936.                    0x20  = Transmitter Buffer Empty.
  937.                    0x10  = Break detected.
  938.                    0x08  = Framming error.
  939.                    0x04  = Parity error.
  940.                    0x02  = Overrun error.
  941.                    0x01  = Data ready.
  942.  
  943.                    The above are documented in the file PCL4P.H.
  944.  
  945.         Returns    -2 : Port not enabled. Call SioReset first.
  946.                    -4 : Port out of range. Expecting  0 to 3.
  947.                    >0 : Line status ( rightmost byte of word ).
  948.  
  949.         Example
  950.  
  951.                    RetCode := SioLine(Port);
  952.                    if(RetCode and
  953.                      (FramingError or ParityError or OverrunError)) <> 0
  954.                      then begin
  955.                        if (RetCode and FramingError) <> 0
  956.                                then writeln('Framing Error');
  957.                        if (RetCode and ParityError) <> 0
  958.                                then writeln('Parity Error');
  959.                        if (RetCode and OverrunError) <> 0
  960.                                then writeln('Overrun Error')
  961.                      end
  962.                    else writeln('No error');
  963.  
  964.        See Also    SioModem.
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.       PCL4P Reference Manual                                  Page 15
  987.  
  988.  
  989.  
  990.  
  991.                                   SioLoopBack
  992.  
  993.  
  994.  
  995.        Function    Does a UART loopback test.
  996.  
  997.          Syntax    function SioLoopBack(Port:Integer) : Integer;
  998.  
  999.         Remarks    SioLoopBack  makes  use of the built in loopback test
  1000.                    capability of the INS8250 UART.  Normally  SioLoopBack
  1001.                    will  never  need  to  be called except if you suspect
  1002.                    that your UART is bad. See the LOOPBACK.C program.
  1003.  
  1004.  
  1005.         Returns      0 : Loopback test is successfull.
  1006.                     -2 : Port not enabled. Call SioReset first.
  1007.                     -4 : Port out of range.  Expecting   0  to 3.
  1008.                    -12 : Loopback test fails.
  1009.  
  1010.  
  1011.         Example
  1012.  
  1013.                    RetCode := SioLoopBack(Port);
  1014.                    if RetCode = 0
  1015.                      then write('Loopback test has succeeded');
  1016.                      else write('Loopback test has failed');
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.       PCL4P Reference Manual                                  Page 16
  1053.  
  1054.  
  1055.  
  1056.  
  1057.                                   SioModem
  1058.  
  1059.  
  1060.  
  1061.        Function    Reads the modem status register.
  1062.  
  1063.          Syntax    function SioModem(Port:Integer; Mask:Char) ; Integer;
  1064.  
  1065.         Remarks    The  SioModem function reads the modem register.  The
  1066.                    bit definitions for the function mask are as follows:
  1067.  
  1068.                     Bit    PCL4P.H Name   Function
  1069.                      7      DCD           Data Carrier Detect
  1070.                      6      RI            Ring Indicator
  1071.                      5      DSR           Data Set Ready
  1072.                      4      CTS           Clear To Send
  1073.                      3      DeltaDCD      Delta DCD   ( DCD has changed )
  1074.                      2      DeltaRI       Delta RI    ( RI has changed )
  1075.                      1      DeltaDSR      Delta DSR   ( DSR has changed )
  1076.                      0      DeltaCTS      Delta CTS   ( CTS has changed )
  1077.  
  1078.                    Bits 4 through  7  represent  the  absolute  state  of
  1079.                    their  respective  RS-232  inputs.  Bits  0  through 3
  1080.                    repesent a change in the  state  of  their  respective
  1081.                    RS-232 inputs since last read.
  1082.  
  1083.                    The  above  definitions  are  also in the PCL4P.H file
  1084.                    for use by your application program.
  1085.  
  1086.         Returns    -2 : Port not enabled. Call SioReset first.
  1087.                    -4 : Port out of range. Expecting  0 to 3.
  1088.                    >0 : Modem status ( rightmost byte of word ).
  1089.  
  1090.         Example
  1091.  
  1092.                    (* any change in DCD ? *)
  1093.                    Status := SioModem(Port,DeltaDCD);
  1094.                    if Status < 0 then
  1095.                      begin
  1096.                        RetCode := SioError(Status);
  1097.                        Halt;
  1098.                      end;
  1099.                    else writeln('DCD status = ', SioModem(Port,DCD) );
  1100.  
  1101.        See Also    SioCTS, SioDCD, SioDSR and SioRI.
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.       PCL4P Reference Manual                                  Page 17
  1119.  
  1120.  
  1121.  
  1122.  
  1123.                                   SioParms
  1124.  
  1125.  
  1126.  
  1127.        Function    Sets parity, stop bits, and word length.
  1128.  
  1129.          Syntax    function SioParms(Port,ParityCode,StopBitsCode,
  1130.                        WordLengthCode:Integer) : Integer;
  1131.  
  1132.  
  1133.         Remarks    The SioParms function sets the parity, stop bits, and
  1134.                    word length.  If the default parity  (  none  ),  stop
  1135.                    bits  (  1  ), or word length ( 8 ) is not acceptable,
  1136.                    then they can be changed by calling SioParms. SioParms
  1137.                    can be called either before or after calling SioReset.
  1138.                    See file PCL4P.H.
  1139.  
  1140.                                   Value   Description    PCL4P.H Name
  1141.                    ParityCode:    *0      no parity      NoParity
  1142.                                    1      odd parity     OddParity
  1143.                                    3      even parity    EvenParity
  1144.  
  1145.                    StopBitsCode:  *0      1 stop bit     OneStopBit
  1146.                                    1      2 stop bits    TwoStopBits
  1147.  
  1148.                    WordLengthCode: 0      5 data bits    WordLength5
  1149.                                    1      6 data bits    WordLength6
  1150.                                    2      7 data bits    WordLength7
  1151.                                   *3      8 data bits    WordLength8
  1152.  
  1153.                    * = Default
  1154.  
  1155.         Returns    -4 : Port out of range. Expecting 0 to 3.
  1156.                    -7 : Bad parity code selected. Expecting  0 to 2.
  1157.                    -8 : Bad stop bits code. Expecting  0 or 1.
  1158.                    -9 : Bad word length code. Expecting  0 to 3.
  1159.  
  1160.         Example
  1161.  
  1162.                    RetCode := SioParms(COM1,NoParity,OneStopBit,WordLength8);
  1163.  
  1164.        See Also    SioReset.
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.       PCL4P Reference Manual                                  Page 18
  1185.  
  1186.  
  1187.  
  1188.  
  1189.                                   SioPutc
  1190.  
  1191.  
  1192.  
  1193.        Function    Transmit a character over a serial line.
  1194.  
  1195.          Syntax    function SioPutc(Port:Integer; Ch:Char) : Integer;
  1196.  
  1197.         Remarks    The SioPutc function transmits one character over the
  1198.                    selected serial line.
  1199.  
  1200.         Returns    -2 : Port not enabled. Call SioReset first.
  1201.                    -4 : Port out of range. Expecting  0 to 3.
  1202.  
  1203.         Example
  1204.  
  1205.                    crc := 0;
  1206.                    for i = 0 to 127 do
  1207.                      begin
  1208.                        crc := crcupdate( buffer[i], crc);
  1209.                        RetCode := SioPutc(Port, buffer[i]);
  1210.                      end;
  1211.                    RetCode := SioPutc(crc);
  1212.  
  1213.        See Also    SioGetc.
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.  
  1225.  
  1226.  
  1227.  
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.       PCL4P Reference Manual                                  Page 19
  1251.  
  1252.  
  1253.  
  1254.  
  1255.                                   SioReset
  1256.  
  1257.  
  1258.  
  1259.        Function    Initialize a serial port for processing.
  1260.  
  1261.          Syntax    function SioReset(Port,BaudCode:Integer) : Integer;
  1262.  
  1263.         Remarks    The SioReset function initializes the selected serial
  1264.                    port.  SioReset should be called after calling SioParm
  1265.                    and SioRxBuf but before  making  any  other  calls  to
  1266.                    PCL4P.   SioReset uses the parity, stop bits, and word
  1267.                    length value previously set  if  SioParm  was  called,
  1268.                    otherwise the default values ( see SioParm ) are used.
  1269.  
  1270.                    Recall  that  COM1  and  COM3 share the same interrupt
  1271.                    vector and therefore  cannot  operate  simultaneously.
  1272.                    Similiarly,    COM2    and    COM4    cannot   operate
  1273.                    simultaneously. Any other combination of two ports can
  1274.                    be used.
  1275.  
  1276.                    By specifing NORESET ( -1 ) for the  baud  rate  code,
  1277.                    the  port  will  NOT  be reset.  This is used to "take
  1278.                    over" a port from a host communications  program  that
  1279.                    allows  a  "DOS  gateway".   External protocols can be
  1280.                    implemented this way. See SioBaud for a  list  of  the
  1281.                    baud rate codes, or see "PCL4P.H".
  1282.  
  1283.        Returns      -3 : No buffer available. Call SioRxBuf first.
  1284.                     -4 : Port out of range. Expecting  0 to 3.
  1285.                    -11 : Bad baud rate code selected. Expecting  0 to 9.
  1286.                    -13 : UART  undefined.   SioUART(Port,0)  was  called
  1287.                          previously.
  1288.                    -14 : Bad or missing UART.  You may not have hardware
  1289.                          present.
  1290.                    -15 : Port already enabled.  SioReset has already been
  1291.                          called.
  1292.                    -16 : Cannot enable both COM1 & COM3  or  COM2 & COM4.
  1293.  
  1294.         Example
  1295.  
  1296.                    RetCode := SioRxBuf(COM1,Ofs(Buffer),Seg(Buffer),Size128);
  1297.                    RetCode := SioReset(Com1,Baud38400);
  1298.                    if RetCode = 0 then writeln('RESET ok');
  1299.                    else begin
  1300.                      RetCode := SioError(rc);
  1301.                      if (RetCode and OverrunError) <> 0
  1302.                                        then writeln('Overrun Error');
  1303.                      if (RetCode and ParityError) <> 0
  1304.                                        then writeln('Parity Error');
  1305.                      if (RetCode and FramingError) <> 0
  1306.                                        then writeln('Framing Error');
  1307.                      if (RetCode and BreakDetected) <> 0
  1308.                                        then writeln('Break Detected');
  1309.                    end;
  1310.  
  1311.        See Also    SioBaud, SioParms, SioRxBuf, SioDone, and SioUART.
  1312.  
  1313.  
  1314.  
  1315.  
  1316.       PCL4P Reference Manual                                  Page 20
  1317.  
  1318.  
  1319.  
  1320.  
  1321.                                   SioRI
  1322.  
  1323.  
  1324.  
  1325.        Function    Reads the Ring Indicator ( RI ) modem status bit.
  1326.  
  1327.          Syntax    function SioRI(Port:Integer) : Integer;
  1328.  
  1329.         Remarks    The SioRI function is used to read the Ring Indicator
  1330.                    ( RI ) modem status bit. Also see SioModem.
  1331.  
  1332.         Returns    -2 : Port not enabled. Call SioReset first.
  1333.                    -4 : Port out of range.  Expecting   0  to 3.
  1334.                     0 : RI is clear.
  1335.                    >0 : RI is set ( RING has occurred ).
  1336.  
  1337.         Example
  1338.  
  1339.                    RetCode := SioRI(Port);
  1340.                    if RetCode > 0 then write('RING');
  1341.  
  1342.        See Also    SioDSR, SioCTS, SioDCD, and SioModem.
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.       PCL4P Reference Manual                                  Page 21
  1383.  
  1384.  
  1385.  
  1386.  
  1387.                                   SioRTS
  1388.  
  1389.  
  1390.  
  1391.        Function    Sets,  clears,  or  reads the Request to Send ( RTS )
  1392.                    line.
  1393.  
  1394.          Syntax    function SioRTS(Port:Integer; Cmd:Char) : Integer;
  1395.  
  1396.         Remarks    The SioRTS function controls the  Request  to  Send  (
  1397.                    RTS  )  bit  in the modem control register. Commands (
  1398.                    defined in PCL4P.H ) are:
  1399.  
  1400.                    SET ('S')   -- set RTS ( ON )
  1401.                    CLEAR ('C') -- clear RTS ( OFF )
  1402.                    READ ('R')  -- read RTS
  1403.  
  1404.         Returns    -2 : Port not enabled. Call SioReset first.
  1405.                    -4 : Port out of range. Expecting  0 to 3.
  1406.                    -5 : Command is not one of 'S', 'C', or 'R'.
  1407.                     0 : RTS is OFF (READ Command).
  1408.                    >0 : RTS is ON  (READ Command).
  1409.  
  1410.         Example
  1411.  
  1412.                    (* turn off RTS for modem *)
  1413.                    RetCode := SioRTS(Port,CLEAR);
  1414.  
  1415.        See Also    SioDTR.
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.       PCL4P Reference Manual                                  Page 22
  1449.  
  1450.  
  1451.  
  1452.  
  1453.                                   SioRxBuf
  1454.  
  1455.  
  1456.  
  1457.        Function    Sets up receive buffers.
  1458.  
  1459.          Syntax    function SioRxBuf(Port,BufferOfs,BufferSeg,
  1460.                                        SizeCode:Integer) : Integer;
  1461.  
  1462.         Remarks    The SioRxBuf function passes the address and  size  of
  1463.                    the   receive  buffer  to  PCL4P.  Recall  that  PCL4P
  1464.                    requires  a  receive   buffer   for   each   port   in
  1465.                    simultaneous  operation  since the receive function is
  1466.                    interrupt driven. SioRxBuf passes the  receive  buffer
  1467.                    to  PCL4P  for  both  the  primary  (  COM1/COM3 ) and
  1468.                    secondary ( COM2/COM4 )  ports.   It  must  be  called
  1469.                    before   any  incoming  characters  can  be  received.
  1470.                    SioRxBuf must be called before SioReset.  Buffer  size
  1471.                    codes are listed in "PCL4P.H".
  1472.  
  1473.                    Size Code       Buffer Size    PCL4P.H Name
  1474.                       0              8 bytes        Size8
  1475.                       1             16 bytes        Size16
  1476.                       2             32 bytes        Size32
  1477.                       3             64 bytes        Size64
  1478.                       4            128 bytes        Size128
  1479.                       5            256 bytes        Size256
  1480.                       6            512 bytes        Size512
  1481.                       7           1024 bytes        Size1024
  1482.                       8           2048 bytes        Size2048
  1483.                       9           4096 bytes        Size4096
  1484.                      10           8192 bytes        Size8192
  1485.                      11          16384 bytes        Size16384
  1486.  
  1487.         Returns    -4 : Port out of range. Expecting 0 to 3.
  1488.                   -10 : Bad buffer size code. Expecting 0 to 11.
  1489.  
  1490.         Example
  1491.  
  1492.                    RetCode := SioRxBuf( COM1, Ofs(RxBuf),Seg(RxBuf), 128);
  1493.  
  1494.        See Also    SioReset.
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.       PCL4P Reference Manual                                  Page 23
  1515.  
  1516.  
  1517.  
  1518.  
  1519.                                   SioRxFlush
  1520.  
  1521.  
  1522.  
  1523.        Function    To  flush  the  receive  buffer  associated  with  the
  1524.                    specified port.
  1525.  
  1526.          Syntax    function SioRxFlush(Port:Integer) : Integer;
  1527.  
  1528.         Remarks    The SioRxFlush function will delete any characters  in
  1529.                    the  receive  buffer  for  the  specified port.  After
  1530.                    execution, the receive buffer  will  be  empty.   Call
  1531.                    SioRxBuf after resetting a port in order to delete any
  1532.                    spurious characters.
  1533.  
  1534.         Returns    -2 : Port not enabled. Call SioReset first.
  1535.                    -4 : Port out of range. Expecting 0 to 3.
  1536.  
  1537.         Example
  1538.  
  1539.                    (* setup receive buffer  and  reset port *)
  1540.                    RetCode := SioRxBuf(COM1,Ofs(Buffer),Seg(Buffer),Size1024);
  1541.                    RetCode := SioReset(COM1,Baud115200);
  1542.                    (* flush any spurious character *)
  1543.                    RetCode := SioRxFlush(COM1);
  1544.                    (* ready for serial processing ! *)
  1545.  
  1546.        See Also    SioRxQue.
  1547.  
  1548.  
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.       PCL4P Reference Manual                                  Page 24
  1581.  
  1582.  
  1583.  
  1584.  
  1585.                                   SioRxQue
  1586.  
  1587.  
  1588.  
  1589.        Function    Returns the number of characters in the receive queue.
  1590.  
  1591.          Syntax    function SioRxQue(Port:Integer) : Integer;
  1592.  
  1593.         Remarks    The  SioRxQue  function  will  return  the  number  of
  1594.                    characters in the receive queue. It  can  be  used  to
  1595.                    implement XON/XOFF flow control.
  1596.  
  1597.         Returns    -2 : Port not enabled. Call SioReset first.
  1598.                    -4 : Port out of range. Expecting  0 to 3.
  1599.  
  1600.         Example
  1601.  
  1602.                    RetCode := SioRxBuf(COM1,Ofs(Buffer),Seg(Buffer),Size128);
  1603.                    (* implement XON / XOFF *)
  1604.                    count := SioRxQue(COM1);
  1605.                    if (last=XON) and (count>120) then
  1606.                      begin
  1607.                        RetCode := SioPutc(COM1,char(XOFF));
  1608.                        last := XOFF;
  1609.                      end
  1610.                   if (last=XOFF) and (count<8) then
  1611.                     begin
  1612.                       RetCode := SioPutc(COM1,char(XON));
  1613.                       last := XON;
  1614.                     end
  1615.  
  1616.       See Also     SioRxFlush.
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.       PCL4P Reference Manual                                  Page 25
  1647.  
  1648.  
  1649.  
  1650.  
  1651.                                   SioTimer
  1652.  
  1653.  
  1654.  
  1655.        Function    Returns the number of system clock tics since midnight.
  1656.  
  1657.          Syntax    function SioTimer : LongInt;
  1658.  
  1659.         Remarks    The SioTimer function will return the number of system
  1660.                    clock tics since midnight, at 18.2065 tics per second.
  1661.                    This function is usefull for timing various functions.
  1662.                    Also see SioDelay.
  1663.  
  1664.         Returns    timer tics.
  1665.  
  1666.         Example
  1667.  
  1668.                    Var Time : LongInt;
  1669.                    ...
  1670.                    Time := SioTimer();
  1671.                    (* do some stuff *)
  1672.                    Writeln('Elasped time ', SioTimer - Time );
  1673.  
  1674.        See Also    SioDelay.
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684.  
  1685.  
  1686.  
  1687.  
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.       PCL4P Reference Manual                                  Page 26
  1713.  
  1714.  
  1715.  
  1716.  
  1717.                                   SioUART
  1718.  
  1719.  
  1720.  
  1721.        Function    Sets the UART base address.
  1722.  
  1723.          Syntax    function SioUART(Port,Address:Integer) : Integer;
  1724.  
  1725.         Remarks    The SioUART function sets the UART  base  address  for
  1726.                    the  specified  port.   SioUART  must be called before
  1727.                    SioReset in order to have effect.  Be  extremely  sure
  1728.                    that you know what you are doing! Note that PCL4P uses
  1729.                    the   standard   PC/XT/AT  port  addresses,  interrupt
  1730.                    request  lines,   and   interrupt   service   vectors.
  1731.                    Therefore,   this   function   is   only   needed  for
  1732.                    non-standard ports.
  1733.  
  1734.         Returns    >0 : The previous base address for this port.
  1735.                    -4 : Port out of range.  Expecting 0 to 3.
  1736.  
  1737.         Example    (* Record fact that you don't have COM4 *)
  1738.                    RetCode := SioUART(COM4, 0);
  1739.  
  1740.        See Also    SioReset.
  1741.  
  1742.  
  1743.  
  1744.  
  1745.  
  1746.  
  1747.  
  1748.  
  1749.  
  1750.  
  1751.  
  1752.  
  1753.  
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.       PCL4P Reference Manual                                  Page 27
  1779.  
  1780.  
  1781.  
  1782.  
  1783.                                   SioUnGetc
  1784.  
  1785.  
  1786.  
  1787.        Function    "Un-gets" the last character read with SioGetc().
  1788.  
  1789.          Syntax    function SioUnGetc(Port:Integer; Ch:Char) : Integer;
  1790.  
  1791.         Remarks    The  SioUnGetc  function  returns  (  pushes  )   the
  1792.                    character  back  into  the  serial  input buffer.  The
  1793.                    character pushed will be the next  character  returned
  1794.                    by  SioGetc.  Only  one  character can be pushed back.
  1795.                    This function works just like the "ungetc" function in
  1796.                    the C language.
  1797.  
  1798.         Returns    -2 : Port not enabled. Call SioReset first.
  1799.                    -4 : Port out of range. Expecting 0 to 3.
  1800.  
  1801.         Example    (* push back c so next SioGetc will get it *)
  1802.                    RetCode := SioUnGetc(Port,c);
  1803.  
  1804.        See Also    SioReset.
  1805.  
  1806.  
  1807.  
  1808.  
  1809.  
  1810.  
  1811.  
  1812.  
  1813.  
  1814.  
  1815.  
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.       PCL4P Reference Manual                                  Page 28
  1845.  
  1846.  
  1847.  
  1848.  
  1849.                              Function Sumary
  1850.  
  1851.  
  1852.  
  1853.        +-------------+----------+----------+----------+----------+
  1854.        | Function    |   Arg1   |   Arg2   |   Arg3   |   Arg4   |
  1855.        +=============+==========+==========+==========+==========+
  1856.        | SioBaud     | Port     | BaudCode |          |          |
  1857.        | SioBrkKey   |          |          |          |          |
  1858.        | SioBrkSig   | Port     | Cmd      |          |          |
  1859.        | SioCTS      | Port     |          |          |          |
  1860.        | SioDCD      | Port     |          |          |          |
  1861.        | SioDelay    | Tics     |          |          |          |
  1862.        | SioDone     | Port     |          |          |          |
  1863.        | SioDSR      | Port     |          |          |          |
  1864.        | SioDTR      | Port     | Cmd      |          |          |
  1865.        | SioError    | Code     |          |          |          |
  1866.        | SioGetc     | Port     | Tics     |          |          |
  1867.        | SioLine     | Port     |          |          |          |
  1868.        | SioLoopBack | Port     |          |          |          |
  1869.        | SioParms    | Port     | Parity   | StopBits |WordLength|
  1870.        | SioPutc     | Port     | Ch       |          |          |
  1871.        | SioReset    | Port     | BaudCode |          |          |
  1872.        | SioRI       | Port     |          |          |          |
  1873.        | SioRTS      | Port     | Cmd      |          |          |
  1874.        | SioRxBuf    | Port     | Ofs(Buff)| Seg(Buff)| SizeCode |
  1875.        | SioRxFlush  | Port     |          |          |          |
  1876.        | SioRxQue    | Port     |          |          |          |
  1877.        | SioTimer    |          |          |          |          |
  1878.        | SioUART     | Port     | Address  |          |          |
  1879.        | SioUnGetc   | Port     | Ch       |          |          |
  1880.        +-------------+----------+----------+----------+----------+
  1881.  
  1882.        ( 26 functions )
  1883.  
  1884.  
  1885.  
  1886.  
  1887.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.       PCL4P Reference Manual                                  Page 29
  1911.  
  1912.  
  1913.  
  1914.  
  1915.                              Error Code Summary
  1916.  
  1917.  
  1918.  
  1919.        Code      Description
  1920.  
  1921.          0        No error.
  1922.  
  1923.         -1        Timeout waiting for input. (Only returned by SioGetc).
  1924.  
  1925.         -2        Port not enabled. Call SioReset first.
  1926.  
  1927.         -3        No buffer  available.   Call  SioRxBuf  before  calling
  1928.                   SioReset.
  1929.  
  1930.         -4        Port  out of range. Expecting 0 to 3. Recall that COM1
  1931.                   is port 0, COM2 is port 1, etc.
  1932.  
  1933.         -5        Expected 'S', 'C', or 'R' as second argument.
  1934.  
  1935.         -6        Expected 'A', 'C', or 'D' as second argument.
  1936.  
  1937.         -7        Bad parity code specified. Must be 0 to 7.
  1938.  
  1939.         -8        Bad stop bits code specified. Must be 0 or 1.
  1940.  
  1941.         -9        Bad wordlength code specified. Must be 0 to 3.
  1942.  
  1943.        -10        Bad buffer size code specified. Must be 0 to 11.
  1944.  
  1945.        -11        Bad baud rate code. Must be 0 to 9.
  1946.  
  1947.        -12        Loopback test fails.
  1948.  
  1949.        -13        UART undefined.
  1950.  
  1951.        -14        Missing or bad UART.
  1952.  
  1953.        -15        Port already enabled.
  1954.  
  1955.        -16        Cannot enable both COM1 and COM3 or COM2 and COM4.
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.       PCL4P Reference Manual                                  Page 30
  1977.  
  1978.  
  1979.  
  1980.  
  1981.