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

📄 wsc4vb_r.txt

📁 在VB中实现通讯的例子
💻 TXT
📖 第 1 页 / 共 4 页
字号:



                      Windows Standard Communications

                           Library for Visual Basic

                                 (WSC4VB)


                             REFERENCE MANUAL



                               Version 2.3

                               Aug 14, 1998




                     This software is provided as-is.
              There are no warranties, expressed or implied.




                           Copyright (C) 1998
                           All rights reserved




                           MarshallSoft Computing, Inc.
                           Post Office Box 4543
                           Huntsville AL 35815

                           Voice : 256-881-4630
                             FAX : 256-880-0925
                           email : info@marshallsoft.com
                             web : www.marshallsoft.com


                               _______
                          ____|__     |                (R)
                       --+       |    +-------------------
                         |   ____|__  |  Association of
                         |  |       |_|  Shareware
                         |__|   o   |    Professionals
                       --+--+   |   +---------------------
                            |___|___|    MEMBER




      MARSHALLSOFT is a registered trademark of MarshallSoft Computing.



     WSC4VB Reference Manual                                   Page 1

                            C O N T E N T S



        Chapter                                     Page

        Table of Contents.............................2

        WSC Functions.................................4

           SioBaud....................................4
           SioBrkSig..................................4
           SioCTS.....................................5
           SioDCD.....................................5
           SioDone....................................6
           SioDSR.....................................6
           SioDTR.....................................7
           SioFlow....................................7
           SioGetc....................................8
           SioGets....................................8
           SioInfo....................................9
           SioParms...................................9
           SioPutc...................................10
           SioPuts...................................10
           SioRead...................................11
           SioReset..................................11
           SioRI.....................................12
           SioRTS....................................12
           SioRxClear................................13
           SioRxQue..................................13
           SioStatus.................................14
           SioTimer..................................14
           SioTxClear................................14
           SioTxQue..................................15
           SioUnGetc.................................15
           SioWinError...............................16

        WSC Error Codes..............................16




















     WSC4VB Reference Manual                                   Page 2

                            C O N T E N T S

                              (continued)



        Chapter                                     Page

        Modem I/O Functions..........................17

           mioBreak..................................17
           mioDriver.................................17
           mioQuiet..................................18
           mioResult.................................18
           mioSendTo.................................19
           mioWaitFor................................19

        Xmodem/Ymodem Driver (XYDRV) Functions

           xyAbort...................................20
           xyAcquire.................................20
           xyDebug...................................21
           xyDriver..................................21
           xyGetMessage..............................22
           xyGetParameter............................22
           xyRelease.................................23
           xySetParameter............................23
           xyStartRx.................................24
           xyStartTx.................................24

        XYDRV Error Codes............................25

        ASCII Driver (ASDRV) Functions

           ascAbort..................................26
           ascDriver.................................26
           ascGetMessage.............................27
           ascGetParameter...........................27
           ascInit...................................28
           ascStartRx................................28
           ascStartTx................................29

        ASDRV Error Codes............................29

      NOTE: DefLng is assumed for all functions unless otherwise declared.
      Also note that all arguments are passed by value except for strings.
      When in doubt about a function, refer to the declarations in
      WSC32.BAS










     WSC4VB Reference Manual                                   Page 3

      +-------------+-----------------------------------------------------+
      |   SioBaud   |  Sets the baud rate.                                |
      +-------------+-----------------------------------------------------+


      Syntax Function SioBaud(ByVal Port, ByVal BaudCode) As Long
             ' Port     : Port selected.
             ' BaudCode : Baud code or actual baud rate.

      Remark The SioBaud Function sets the baud rate without resetting
             the port. It is used to change the baud rate after calling
             SioReset.

             SioBaud may be called with either the actual baud rate value
             or one of the baud rate codes as follows:

               Code   Rate    Name             Code   Rate   Name
                 0     300    Baud300            5    9600   Baud9600
                 1     600    Baud600            6   19200   Baud19200
                 2    1200    Baud1200           7   38400   Baud38400
                 3    2400    Baud2400           8   57600   Baud57600
                 4    4800    Baud4800           9  115200   Baud115200

      Return    IE_BADID : No such port.
             IE_BAUDRATE : Unsupported baud rate.

       Other See SioReset.



      +-------------+-----------------------------------------------------+
      |  SioBrkSig  |  Asserts, cancels, or detects BREAK signal.         |
      +-------------+-----------------------------------------------------+

      Syntax Function SioBrkSig(ByVal Port, ByVal PortCmd) As Long
             ' Port : Port selected.
             ' Cmd  : ASSERT, CANCEL, or DETECT.

      Remark The SioBrkSig Function controls the BREAK bit in the line
             status register. The legal commands are:

             ASSERT_BREAK : "A" to assert BREAK
             CANCEL_BREAK : "C" to cancel BREAK
             DETECT_BREAK : "D" to detect BREAK

             ASSERT_BREAK, CANCEL_BREAK, and DETECT_BREAK are defined in
             WSC4VB.BAS.

      Return  IE_NOPEN : Port not opened. Call SioReset first.
              IE_BADID : No such port.
             WSC_RANGE : Illegal command. Expected "A", "C", or "D".
                    >0 : BREAK signal detected (DETECT command only)

       Other None.




     WSC4VB Reference Manual                                   Page 4

      +-------------+-----------------------------------------------------+
      |   SioCTS    |  Reads the Clear to Send (CTS) modem status bit.    |
      +-------------+-----------------------------------------------------+

      Syntax Function SioCTS(ByVal Port) As Long
             ' Port : Port selected.

      Remark The SioCTS Function is used to detect if CTS (Clear To Send)
             is set (1) or clear (0). Some Windows Win16 COMM drivers
             cannot read the CTS bit correctly!

             The CTS line is used by some error correcting modems to
             implement hardware flow control.  CTS is dropped by the modem
             to signal the computer not to send data and is raised to
             signal the computer to continue.

             Refer to the RS232 User's Manual for a discussion of flow
             control.

      Return IE_NOPEN : Port not opened. Call SioReset first.
             IE_BADID : No such port.
                    0 : CTS is clear.
                   >0 : CTS is set.

       Other See SioFlow, SioDSR, SioRI, and SioDCD.













      +-----------+-------------------------------------------------------+
      |   SioDCD  | Reads the Data Carrier Detect (DCD) modem status bit. |
      +-----------+-------------------------------------------------------+

      Syntax Function SioDCD(ByVal Port) As Long
             ' Port : Port selected.

      Remark The SioDCD Function is used to read the Data Carrier Detect
             (DCD) modem status bit.

      Return IE_NOPEN : Port not opened. Call SioReset first.
             IE_BADID : No such port.
                    0 : DCD is clear.
                   >0 : DCD is set.

       Other See SioDSR, SioCTS, and SioRI.




     WSC4VB Reference Manual                                   Page 5

      +-------------+-----------------------------------------------------+
      |   SioDone   |  Terminates further serial processing.              |
      +-------------+-----------------------------------------------------+

      Syntax Function SioDone(ByVal Port) As Long
             ' Port : Port selected.

      Remark The SioDone Function terminates further serial processing,
             allowing other applications to use the port.

      Return IE_NOPEN : Port not opened. Call SioReset first.
             IE_BADID : No such port.

       Other See SioReset.









      +-------------+-----------------------------------------------------+
      |    SioDSR   |  Reads the Data Set Ready (DSR) modem status bit.   |
      +-------------+-----------------------------------------------------+

      Syntax Function SioDSR(ByVal Port) As Long
             ' Port : Port selected.

      Remark The SioDSR Function is used to detect if DSR (Data Set Ready)
             is set (1) or clear (0). Some Windows Win16 COMM drivers
             cannot read the DSR bit correctly!

      Return IE_NOPEN : Port not opened. Call SioReset first.
             IE_BADID : No such port.
                    0 : DSR is clear.
                   >0 : DSR is set.

       Other See SioCTS, SioRI, and SioDCD.


















     WSC4VB Reference Manual                                   Page 6

      +-------------+-----------------------------------------------------+
      |    SioDTR   |  Set, clear, or read Data Terminal Ready (DTR).     |
      +-------------+-----------------------------------------------------+

      Syntax Function SioDTR(ByVal Port, ByVal Cmd) As Long
             ' Port : Port selected.
             ' Cmd  : DTR command (see below).

      Remark The SioDTR Function controls the Data Terminal Ready (DTR) bit
             in the modem control register.  DTR should always be set when
             communicating with a modem.  Commands (defined in WSC4VB.BAS):

                  SET_LINE   : "S"  to set DTR (ON)
                  CLEAR_LINE : "C"  to clear DTR (OFF)
                  READ_LINE  : "R"  to read DTR

      Return IE_NOPEN  : Port not opened. Call SioReset first.
             IE_BADID  : No such port.
             WSC_RANGE : Not one of "S", "C", or "R".
                     0 : DTR is OFF (READ_LINE Command).
                    >0 : DTR is ON (READ_LINE Command).

       Other See SioRTS.

      +------------+------------------------------------------------------+
      |   SioFlow  |  Sets flow control.                                  |
      +------------+------------------------------------------------------+

      Syntax Function SioFlow(ByVal Port, ByVal Cmd) As Long
             ' Port : Port selected.
             ' Cmd  : Class of flow control (see below).

      Remark The SioFlow Function is used to enable or disable hardware
             flow control.  Hardware flow control uses RTS and CTS to
             control data flow between the modem and the computer.  To
             enable flow control, call SioFlow with Cmd set to:

                  Cmd  Flow Control
                  "H"  Hardware (RTS/CTS) flow control.
                  "S"  Software (XON/XOFF) flow control.
                  "N"  No flow control.

             In order for hardware flow control to work correctly, your
             modem must also be configured to work with hardware flow
             control, and your computer to modem cable must have RTS and
             CTS wired straight through. If you enable hardware flow
             control, do not modify the RTS line (by calling SioRTS). Flow
             control is disabled after resetting a port.

      Return IE_NOPEN : Port not opened. Call SioReset first.
             IE_BADID : No such port.
            WSC_RANGE : Cannot recognize Cmd.
                  -1  : Flow control disabled.
                  >0  : Flow control enabled.

       Other See SioPutc


     WSC4VB Reference Manual                                   Page 7

      +------------+------------------------------------------------------+
      |   SioGetc  |  Reads the next character from the serial line.      |
      +------------+------------------------------------------------------+

      Syntax Function SioGetc(ByVal Port) As Long
             ' Port : Port selected.

      Remark The SioGetc Function reads a byte from the selected serial
             port. WSC_NO_DATA (-100) is returned if no byte is available.


      Return    IE_NOPEN : Port not opened. Call SioReset first.
                IE_BADID : No such port.
             WSC_NO_DATA : If timed out (no data available).
                    >= 0 : Character read.

⌨️ 快捷键说明

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