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