⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pcl4w.usr

📁 C语言通讯程序库windows版  
💻 USR
📖 第 1 页 / 共 5 页
字号:
              The  PCL4W  library  uses  this same DPMI mechanism. In particular, the file
              USE_DPMI.ASM contains the necessary functions for using DPMI. The  developer
              should not modify USE_DPMI.ASM in any way.


              3.3 Memory Models


              Most windows programs are small or medium memory model programs since  these
              memory  models  are  limited  to  one  data  segmnemt.   However,  all PCL4W
              functions are FAR functions, so they can be  used  with  any  memory  model.
              Thus,  there  is  just  one PCL4W.DLL and PCL4W.LIB regardless of the memory
              model used.


              3.4 Using the Library


              The PCL4W has been tested on a TANDY 3000 (80286 IBM AT  clone),  a  Gateway
              2000 25 MHZ 80386-DX, and a Gateway 2000 66MHZ 80486-DX2.

              Please examine the PCL4W.H file. Note that COM1 is defined as port zero, not
              port  one.   The  user must assume the responsibilty for passing the correct
              information when calling PCL4W functions.

              If there are any conflicts between PCL4W  definitions  and  those  in  other
              libraries,  the PCL4W definitions can be changed in the PCL4W.H file and any
              file that uses the definition. There is no change necessary for the  library
              code itself.

              If  you  write  an  application  using  the PCL4W library, don't run another
              application that uses the same communications port.





             PCL4W Users Manual                                                Page 10
              3.5 Example Programs


              Two  communications  programs  are  provided as a demonstration of the PCL4W
              library -- SIMPLE and TERM.

              SIMPLE  is  provided  as  the  easiest example of communications programming
              using PCL4W.  The user should compile and link SIMPLE.C as  a  test  of  the
              library.

              If you have two computers, connect them together with a null modem cable and
              run SIMPLE on both machines.  The baud rate in SIMPLE is hard coded to  2400
              baud. It is easily changed in the source code. Start SIMPLE by typing SIMPLE
              followed by the port.

              The  TERM  program  is  a  more  capable  terminal  emulator than SIMPLE. It
              features modem initialization, hardware flow control, and state driven  file
              transfer  using  ASCII,  XMODEM, and YMODEM, communications protocols.  TERM
              can be used to call up any bulletin board system, including the MarshallSoft
              Computing BBS.

              Refer to the sections on SIMPLE and TERM in this manual  for  more  detailed
              information.


              3.6 Making the Library


              Registered  users  may  wish  to  assemble PCL4W.ASM.  Use the /MX switch in
              order to disable automatic conversion from lower case to upper case.  If the
              /MX switch is not used, then all PCL4W function references in C code must be
              in upper case. To assemble using the Microsoft assembler, use  the  provided
              makefile "PCL4W.MAK". Type

                   nmake pcl4w.mak

              Two  libraries  are  made, one with transmitter interrupts disabled (PCL4W1)
              and one with transmitter interrupts enabled (PCL4W2). Most users should  use
              the  library  without transmitter interrupts enabled since they require less
              overhead.

              To use the PCL4W library without transmitter interrupts enabled, type

                   copy pcl4w1.lib pcl4w.lib
                   copy pcl4w1.dll pcl4w.dll

              To use the PCL4W library with transmitter interrupts enabled, type

                   copy pcl4w2.lib pcl4w.lib
                   copy pcl4w2.dll pcl4w.dll


              After creating PCL4W.LIB and PCL4W.DLL, the example programs can be compiled
              and linked. Refer to the section "Example Programs".













             PCL4W Users Manual                                                Page 11
              4.0 Talking to Your Modem


              A  modem  is  used  to  extend  the distance over which you may communicate.
              Without a modem, your RS232 cable is limited to a maximum  of  approximately
              50 feet.  But with a modem, you can communicate literally around the world.


              4.1 Modem Standards


              Two modems can communicate over a telephone line only if they are both using
              the  same  signaling frequencies and modulation, which are determined by the
              the modem standards used.  Modem standards can be divided into  three  sets:
              (1) speed, (2) data compression used, and (3) error control.

              The  Bell  standards  (103  &  212A)  are  those  of  AT&T.   The CCITT (The
              International Consultative Committee for Telephone and Telegraph)  standards
              are designated as "V. ".


              Speed


                   Bell 103  --   300 baud
                   Bell 212A --  1200 baud
                   V.21      --   300 baud
                   V.22bis   --  1200 & 2400 baud
                   V.32      --  4800 & 9600 baud
                   V.32bis   --  4800, 7200, 9600, 12000, and 14400 baud


              Data Compression


                   MNP 5     --  Microcom Networking Protocol (proprietary).
                   V.42bis   --  International data compression standard.


              Error Control


                   MNP 2,3,4 --  Three level error correction (public domain).
                   V.42      --  International error correction standard.























             PCL4W Users Manual                                                Page 12
              4.2 Flow Control


              With  modems  using data compression, the modem to modem connection will run
              at various speeds depending on the quality of  the  line.  The  computer  to
              modem  connection  will be at a fixed baud rate. Therefore, a protocol (flow
              control) is necessary to synchronize the data flow between  and  modems  and
              the   computer  to  modem  connection.   Refer  to  your  modem  manual  for
              information on flow control protocols supported.

              Two flow control protocols are used by most all modems  which  require  flow
              control.  Software  flow  control  is called "XON/XOFF" (other software flow
              control character pairs are defined but operate the same  as  XON/XOFF)  and
              hardware  flow  control is called "RTS/CTS".  Most modems which require flow
              control enable hardware flow control by default.

              In XON/XOFF (software) flow control, the computer suspends transmitting data
              if it receives a XOFF character (13  hex)  from  the  modem,  and  continues
              transmitting  when  it  receives  a XON character (11 hex).  Similiarly, the
              computer can signal the modem not to send any more data  by  transmitting  a
              XOFF  to  it,  and  can tell the modem to continue transmission be sending a
              XON.

              In RTS/CTS (hardware) flow control, the RTS line is used by the computer  to
              signal  the  modem  ,  while the CTS line is used by the modem to signal the
              computer.  The RTS line is set OFF by the computer  to  tell  the  modem  to
              suspend  transmission,  and  set  to  ON  to  tell  the  modem  to  continue
              transmission.  The CTS line is set to OFF by the modem to tell the  computer
              to  stop  transmitting,  and  set  to  ON  to  tell the computer to continue
              transmitting.

              Given the choice, always choose hardware flow  control  over  software  flow
              control  so  that  all  data  transmission is transparent.  If hardware flow
              control is not the default (which it almost always is),  you  should  modify
              your modem initialization string to turn hardware flow control on.

              Both  software  and  hardware flow control is easy to implement using PCL4W.
              See TERM_IO.C for an example of hardware flow control.





























             PCL4W Users Manual                                                Page 13
              4.3 Modem Initialization


              If your application uses a modem (as opposed to using a null  modem  cable),
              then  you should always send an initialization string to your modem if it is
              a programmable modem such as those made by  Hayes.   Communication  programs
              such as PROCOMM and TELIX always send such a string automatically as soon as
              they start up.

              The particular initialization string depends on the make of your modem.  For
              Hayes  and  Hayes  AT  command  set  compatible modems, the following string
              (followed by a carriage return) should work:

                   AT E1 S7=60 S11=60 V1 X1 Q0 S0=0

              Refer to your Modem User's Guide for a full discussion of these commands.  A
              brief description is as follows:

                   AT     Modem attention command.
                   E1     Modem will echo what you send to it.
                   S7=60  Wait 60 seconds for carrier and/or dial tone.
                   S11=60 Use 60 milliseconds for tone dialing duration & spacing.
                   V1     Display result code as words (not numbers).
                   X1     Use the extended result message (CONNECT XXXX) set.
                   Q0     Modem returns result codes.
                   S0=0   Do not answer RING.

              If  your application will answer incoming calls, then set the S0 register to
              the ring on which to automatically answer.

              If you send the above codes by using SioPutc (as opposed to typing them from
              the keyboard), then follow these guidelines:

              (1) Send an initial carriage return before the initialization string.

              (2) Pause at least 150 milliseconds after each character sent as your  modem
              needs the time to perform its own internal processing. Pause a little longer
              if your modem is not accepting your initialization string.

              (3)  Pause  one  and a half seconds after sending any initialization command
              such as ATZ or AT&F since your modem must do quite a bit of processing.

              If you experience any problems in initializing your Hayes modem, you  should
              first reset it to factory settings by sending:

                   AT&F

              Refer to the TERM program (function SendToModem in the file MODEM_IO.C)  for
              an example of sending an initialization string to a Hayes compatible modem.


















             PCL4W Users Manual                                                Page 14
              5.0 Problems


              If  you  cannot  get your application to run properly, first compile and run
              the terminal emulator program SIMPLE provided  on  your  distribution  disk.
              Test  SIMPLE  by  connecting  two  computers  with  a null modem cable or by
              commanding a Hayes AT command set compatible modem.

              Once SIMPLE runs, compile and run the TERM program.  If you are using a null
              modem  cable  or a non-programmable modem, be sure to set the HAYES constant
              to 0 in the source code (#define AT_COMMAND_SET 0). If you are using a Hayes

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -