📄 wsc4vb_u.txt
字号:
Windows Standard Serial Communications
Library for Visual Basic
(WSC4VB)
USERS 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 Users Manual Page 1
C O N T E N T S
Chapter Page
1.0 Introduction................................................3
1.1 User Support............................................4
1.2 ASP Ombudsman...........................................4
1.3 Awards..................................................4
1.4 Installation............................................5
1.5 Limitations on COM Ports................................5
2.0 Library Overview............................................6
2.1 Dynamic Link Libraries..................................6
2.2 Using the Library.......................................6
2.3 Win32 STDCALL and DECLSPEC..............................6
2.4 Using Threads...........................................6
3.0 Compiling Programs..........................................7
3.1 Compiling WSC...........................................7
3.2 Compiling Example Programs..............................7
3.3 EXCEL, ACCESS, and WORD.................................7
3.4 PowerBuilder and FoxPro.................................7
4.0 Modem I/O...................................................8
4.1 MIO Introduction........................................8
4.2 MIO Function Summary....................................8
5.0 XMODEM & YMODEM ............................................9
5.1 XYDRIVER Introduction...................................9
5.2 XYDRIVER Function Summary...............................9
6.0 ASCII File Transfer........................................10
7.0 Problems...................................................11
8.0 Example Programs...........................................12
8.1 EASY...................................................12
8.2 SELFTEST...............................................12
8.3 MODEM..................................................12
8.4 TERM...................................................13
8.5 FINDER.................................................13
9.0 Legal Issues...............................................14
9.1 Registration...........................................14
9.2 Academic Discount......................................14
9.3 License................................................15
9.4 Warranty...............................................15
10.0 Summary....................................................16
10.1 Revision History......................................16
10.2 WSC Function Summary..................................17
10.3 Further Reading.......................................18
11.0 Other MarshallSoft Computing Products for Visual Basic.....18
11.1 Personal Communications Library for Visual Basic......18
11.2 Personal Protocol Library for Visual Basic............18
11.3 Serial Libraries for Other Languages..................18
11.4 Internet Libraries....................................19
WSC4VB Users Manual Page 2
1.0 Introduction
The Windows Standard Serial Communications Library for Visual Basic
(WSC4VB) is an asynchronous communications dynamic link library
(DLL) which uses the standard Windows serial communications API.
Since it uses the Windows API, programs using the WSC library are
fully compatible with other Window applications which also use the
Windows serial communications API.
The WSC4VB dynamic link library (WSC32.DLL) can be called from any
WIN32 application capable of calling Windows API functions,
including those written in Delphi, Visual Basic, MS Access, MS Excel,
Fortran, COBOL, PowerBuilder, FoxPro, Power Basic Console Compiler,
dBase, etc. The library works under NT 4.0 and Windows 95/98, as well
as Windows 3.1 (Win16 only).
Using WSC is very straight-forward. For example, to write "HELLO" to
the serial port COM1:
Dim Text As String * 5
Dim Code As Long
Text = "HELLO"
Code = SioReset(COM1,512,512) 'open COM1 with 512 KB buffers
Code = SioPuts(COM1,Text,6) 'write "HELLO" to COM1
Code = SioDone(COM1) 'close COM1
Several Visual Basic example programs with full source code are included.
Refer to chapter 8 for more details on each of the example programs.
EASY : A simple terminal emulator.
SELFTEST : Performs COM port functionality testing.
MODEM :
TERM :
FINDER : Finds a modem connected to one of your serial ports.
WSC4VB contains over 25 functions. All functions return a negative
number if an error condition is detected. For more details, consult
the WSC4VB Reference Manual (WSC4VB_R.TXT) and the RS232 Reference
Manual (RS232.TXT).
Our goal is to provide a robust serial communications library that
you and your customers can depend upon. Contact us if you have any
questions.
The shareware and registered versions are identical except that the
shareware version displays the "shareware" screen when first
starting, after 20 minutes of run time, and every 10 minutes after
that. The registered version also includes source code.
WSC4VB Users Manual Page 3
1.1 User Support
We want you to be successful in developing your applications using
WSC4VB! We depend upon our customers to let us know what they need in
a communications library. This means we are committed to providing
the best communications library that we can. If you have any
suggestions or comments, please let us know.
If you are having a problem using WSC4VB, email us at
support@marshallsoft.com or call us at 256-881-4630 between 1:30 PM
and 9:30 PM CST Monday through Friday. You can also call at other
times and leave a message, and call back later for a reply.
However, we can only answer questions with respect to using the
WSC4VB library. We cannot help you program your application.
If you are on the Internet, email us at info@marshallsoft.com. You
can also get the latest versions of our products from our anonymous
ftp site:
ftp://ftp.marshallsoft.com/marshallsoft
The MarshallSoft Computing, Inc. newsletter "Comm Talk" is published
quarterly. It discusses various communications problems and
solutions using WSC4VB as well as related information.
The latest copy of our newsletter can be found on our anonymous ftp
site (directory /marshallsoft) as well as our web site.
http://www.marshallsoft.com
1.2 ASP Ombudsman
MarshallSoft Computing, Inc. is a member of the Association of
Shareware Professionals (ASP). ASP wants to make sure that the
shareware principle works for you. If you are unable to resolve a
shareware-related problem with an ASP member by contacting the member
directly, ASP may be able to help. The ASP Ombudsman can help you
resolve a dispute or problem with an ASP member, but does not provide
technical support for members' products. Please write to the ASP
Ombudsman at 157-F Love Ave., Greenwood, IN 26142 USA, FAX
1.3 Awards
WSC4VB has been rated 5 stars by ZDNET, which is their highest
rating.
Our other "Windows Standard Serial Communications Libraries" (for
C/C++ and Delphi) are one of the more popular downloads in the
shareware libaries category.
WSC4VB Users Manual Page 4
1.4 Installation
(1) Before installation of WSC4VB, your Visual Basic compiler should
already be installed on your system and tested. Note that Visual
Basic 4.0 (or up) is required in order to create Win32 programs.
(2) Start a command prompt window.
(3) Create your WSC project directory, copy the WSC archive, then
unzip the archive. For example:
MKDIR WSC
PKUNZIP WSC4VB23.ZIP WSC 'registered users unzip WSC4VB.ZIP
(4) Run the install program INSTALL.BAT which will copy the correct
files for your installation (Visual Basic 3.0 or Visual Basic 4.0+).
If you are using Visual Basic 3 or 16-bit VB 4, then type:
INSTALL 16 'for Windows 95/98 or Windows 3.1
INSTALL 16 NT 'for Windows NT
If you are using 32-bit Visual Basic 4 (or above), then type:
INSTALL 32 'for Windows 95/98
INSTALL 32 NT 'for Windows NT
The install program creates WSC4VB.BAS from either WSC16.BAS or
WSC32.BAS, and copies the proper DLLs. This way, the source code for
the example programs is identical for both Visual Basic 3 (Win16) and
Visual Basic 4 / Visual Basic 5 (Win32).
INSTALL will copy all DLLs to the C:\WINDOWS directory (or C:\WINNT
if running Windows NT), where Visual Basic can find them.
1.5 Limitations on COM Ports
The 32-bit version of WSC4VB (WSC32.DLL) can use any port from COM1
to COM16, provided that the port is known to Windows 95/98/NT and
there is physical hardware present. More ports can easily be added by
recompiling WSC32.C.
The UART FIFO level can only be set from the Windows Control Panel.
The recommended receive side trigger level is 8 or 14 for 16550
UARTs.
For more information on UARTS, see the RS232 Users Manual
(RS232.TXT).
WSC4VB Users Manual Page 5
2.0 Library Overview
2.1 Dynamic Link Libraries
WSC4VB uses a Win32 dynamic link library (WSC32.DLL). A DLL is
characterized by the fact that it need not be loaded until required
by an application program and that only one copy of the DLL is
necessary regardless of the number of application programs that use
it. Contrast this to the traditional static library which is bound to
each and every application that uses it at link time.
Since WSC4VB is a DLL, only one copy of the WSC4VB code is loaded
into memory regardless of the number of applications programs that
use it. For example, more than one instance of the test program
EASY can be started. All copies of EASY can run concurrently as
long as each uses a different COM port.
An important advantage that DLLs have over other "popular" library
formats such as VBX or OCX is that DLLs are callable by all Windows
applications. Since DLLs are the building blocks of the Windows
Operations System, they will not be replaced by a "newer technology".
2.2 Using the Library
The WSC4VB has been tested on multiple computers running Windows 3.1,
Windows 95/98, and Windows NT 4.0.
Please examine the WSC32.BAS file. Note that COM1 is defined as port
zero, not port one. The user must assume the responsibility for
passing the correct information when calling WSC4VB functions.
2.3 Win32 STDCALL and DECLSPEC
WSC32 is written in ANSI C and is compiled using the _stdcall and
_declspec keywords. This means that WSC4VB uses the same calling
conventions and file naming conventions as the Win32 API. In
particular, function names are NOT decorated. There is no leading
underscore nor trailing "@size" added to function names.
The WSC32.DLL functions may be called by any Windows application
program capable of calling the Windows API provided the proper
declaration file is used.
2.4 Using Threads
WSC4VB is thread safe, and can be used from any Windows application
capable of using threads.
WSC4VB Users Manual Page 6
3.0 Compiling Programs
Each of the example programs should be compiled and run. Before
beginning, be sure to run INSTALL that will copy the proper Win16 (or
Win32) files.
Refer to section 8.0 "Example Programs" for more information on the
example programs.
3.1 Compiling WSC
WSC32.DLL is written in standard ANSI C (WSC32.C), and has been
compiled using Microsoft Visual C/C++ with the STDCALL and DECLSPEC
compiler keywords. Source code for the WSC library is provided in the
registered version only.
WSC32.C may also be compiled using Borland C/C++ or Watcom C/C++
compilers. If you recompile WSC32.C using Borland or Watcom
compilers, the resulting WSC32.DLL can only be used by applications
compiled with the same compiler, unless the "_stdcall" and
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -