Windows Standard
Serial Communications
Users Manual
(WSC_USR)
Version 3.0
July 12, 2000 Revised July 26, 2000
This software is provided as-is.
There are no warranties, expressed or implied.
Copyright (C) 2000
All rights reserved
MarshallSoft Computing, Inc.
Post Office Box 4543
Huntsville AL 35815 USA
Voice : 256-881-4630
FAX : 256-880-0925
email : info@marshallsoft.com
web : www.marshallsoft.com
MarshallSoft is a member of the Association of Shareware Professionals
MARSHALLSOFT is a registered trademark of MarshallSoft Computing.
1 Introduction
1.1 Documentation Set2 Applications Notes
1.2 User Support
1.3 Awards
1.4 ASP Ombudsman
1.5 Ordering
2.1 Dynamic Link Libraries3 Modem I/O (MIO)
2.2 GUI and Console Mode
2.3 Using the Library
2.4 Other Languages
2.5 UARTs and Serial Ports
2.6 USB Ports
2.7 PCMCIA Modems
2.8 Threads
3.1 MIO Introduction4 XMODEM and YMODEM
3.2 MIO Function Summary
4.1 XYDRIVER Introduction5 ASCII File Transfer
4.2 XYDRIVER Function Summary
5.1 ASCII Protocol6 Versions of WSC
5.2 ASCII Function Summary
6.1 Shareware Version7 Problems
6.2 Student Version
6.3 Professional Version
8 Legal Issues
8.1 Registration9 Summary
8.2 License
8.3 Warranty
9.1 WSC Function Summary
The Windows Standard Serial Communications Library (WSC) 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 WSC DLLs (WSC16.DLL and WSC32.DLL) can be called from any application capable of calling Windows API functions, including those written in C/C++, Delphi, Visual Basic, MS Access, MS Excel, Fortran, COBOL, PowerBuilder, FoxPro, Power Basic Console Compiler, dBase, Xbase++, etc. The library runs under Windows 95/98, NT/2000, and Windows 3.1.
We also have declaration files and example programs for a few other languages.
The complete set of documentation consists of four manuals in three formats. This is
the second manual
(WSC_USR) in the set.
Each manual comes in three formats:
The WSC_4x Programmer’s Manual is the language specific manual. All language dependent programming issues are discussed in this manual. Other language specific manuals are as follows:
[NAME] [DESCRIPTION] WSC_4C : WSC Programmer's Manual for C/C++ WSC_4D : WSC Programmer's Manual for Delphi WSC_4VB : WSC Programmer's Manual for Visual Basic WSC_4PB : WSC Programmer's Manual for PowerBASIC WSC_4CB : WSC Programmer's Manual for COBOL WSC_4FP : WSC Programmer's Manual for Visual FoxPro WSC_4DB : WSC Programmer's Manual for Visual dBase WSC_4XB : WSC Programmer's Manual for Xbase++
The WSC User’s Manual (WSC_USR) discusses language independent serial communications
programming issues. Read this manual after reading the WSC_4x Programmer’s Manual.
The WSC Reference Manual (WSC_REF) contains details on each individual WSC function.
Use Microsoft Word 97/99 or Microsoft WordPad to print the document files.
We want you to be successful in developing your applications using WSC! We are committed to providing the best library that we can. If you have any suggestions or comments, please let us know.
If you are having a problem using WSC, refer to Section 7.0 "Problems". If you still cannot resolve your problem, email us at
support@marshallsoft.comYou can also reach us at +1-256-881-4630 between 7:00 AM and 7:00 PM CST Monday through Friday. You can also often reach us on Saturday. The latest versions of our products are available on our web site at
http://www.marshallsoft.com and on our anonymous FTP site at ftp://ftp.marshallsoft.com/pubThe MarshallSoft Computing newsletter "Comm Talk" is published quarterly on our web site. It discusses various communications problems and solutions using our products as well as related information.
The professional version of WSC may be registered for $95 (US dollars) for email delivery.
The fastest and easiest way to order is on our web site at
http://www.marshallsoft.com/order.htmYou can also order by completing INVOICE.TXT (contained within the WSC zip file) and emailing (orders@marshallsoft.com), mailing (see our address at top), or faxing (+1-256-880-0925) it to us. Multiple copy discounts (3 or more) and site licenses are available. Please call for details. We accept American Express, VISA, MasterCard, Discover, checks in US dollars drawn on a US bank, International Postal Money Orders, and purchase orders (POs) within the USA from recognized US schools and companies listed in Dun & Bradstreet. For credit card orders, be sure to include the account number, the expiration date, the exact name on the card, and the complete card billing address (the address to which the credit card bill is mailed- not the bank’s). Please include card holder's signature on faxed orders. Print the file INVOICE.TXT if a "Pro Forma" invoice is needed. The registered package includes:
We offer an "academic price" of 30% off the normal price for prepaid email orders to faculty and full time students currently enrolled in any accredited high school, college, or university. To qualify for the discount, your school must have a web site and you must have an email address at your school.
When ordering, ask for the "academic discount", or enter "student at" (or "faculty at") and your schools web site address (URL) in the comments field of the order form on our web site order page . Your order will be sent to your email address at your school.
This offer is not retroactive and cannot be used with any other discount. Products bought with academic pricing can not be used for any commercial purpose.
When ordering WSC, a 3.5" HD disk can be purchased for $5 for delivery to the, US, Canada, and Mexico. For all other destinations, the disk is $8.
See INVOICE.TXT or http://www.marshallsoft.com/order.htm
Printed manuals (see Section 1.1 "Documentation Set") are the same as in the WSC shareware distribution. Printed manuals can be purchased for $20 for delivery to the US, Canada, and Mexico. For all other destinations, printed manuals are $25. Printed manuals also comes with a 3.5" HD disk.
See INVOICE.TXT or http://www.marshallsoft.com/order.htm
WSC includes both Win16 [WSC16.DLL] and Win32 [WSC32.DLL] dynamic link libraries (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 a static library which is bound at link time to each and every application that uses it.
WSC functions can be called from WIN32 console mode programs as well as GUI programs. A "console mode" program is a Windows 95/98/NT/2000 WIN32 command line program running in a command window. Although console mode programs look like DOS programs, they are WIN32 programs which have access to the entire Windows address space.
The best way to get familiar with WSC is to try out one of the example programs. The example programs are described in the WSC_4x Programmer's Manual:
[NAME] [DESCRIPTION] WSC_4C : WSC Programmer's Manual for C/C++ WSC_4D : WSC Programmer's Manual for Delphi WSC_4VB : WSC Programmer's Manual for Visual Basic WSC_4PB : WSC Programmer's Manual for PowerBASIC WSC_4CB : WSC Programmer's Manual for COBOL WSC_4FP : WSC Programmer's Manual for Visual FoxPro WSC_4DB : WSC Programmer's Manual for Visual dBase WSC_4XB : WSC Programmer's Manual for Xbase++
The Windows Standard Serial Communications DLL’s can also be used with any application written in any language capable of calling the Windows (3.1, 95/98/2000, NT) API. WSC16.DLL is required for all Win16 (Windows 3.1) applications, and WSC32.DLL is required for all Win32 (Windows 95/98/2000/NT) applications.
Declaration files have been defined by the following languages:
[LANGUAGE] [FILE] C/C++ WSC.H Visual Basic WSC16.BAS and WSC32.BAS VBA (Excel, Access,…) WSC32.BAS PowerBASIC WSC32.PBI Borland Delphi WSC16.PAS and WSC32.PAS Fujitsu COBOL WSC32.CBI ABSOFT FORTRAN WSC32.INC Visual FoxPro WSC32.FOX Visual dBase WSC16.CC and WSC32.CC Alaska Xbase++ WSC32.CHAdditional declaration files will be added. Give us a call if you need a declaration not listed above. If you have interfaced WSC to an unusual language, email us the declaration file!
SioEvent(Port, EV_RXCHAR)blocks the outgoing serial stream as well as the incoming serial stream.
The Modem I/O functions ease communicating with modems using AT commands.
The MIO functions are broken down into parts called states, and control is returned to Windows between executing each state. This allows other code to run while waiting for MIO functions to complete.
For example (C/C++ Example):
Code = mioSendTo(Port,100,"!ATDT1,800,555,1212")
The '!' characters are converted to carriage returns. The text string is copied into
the driver's data area.
mioDriver will return MIO_RUNNING if it is still processing. Any other return value
indicates that it is
still processing and the returned value is a character from the modem that can be
displayed if wanted.
Refer to the WSC Reference Manual (WSC_REF) for more information on individual MIO functions.
The XMODEM and YMODEM functions are implemented as DLL's (Dynamic Link Libraries), in XYDRV16.DLL and XYDRV32.DLL, and are state driven like the Modem I/O functions described in the previous section.
Files can be sent and received using XMODEM, XMODEM/CRC, XMODEM/1K, and YMODEM. The
basic procedure used to run XMODEM and YMODEM is as follows:
Refer to XMODEM.TXT for more information on the internal operation of the XMODEM protocol, and to YMODEM.TXT for more information on the internal operation of the YMODEM protocol. Also see the TERM example program.
Refer to the WSC Reference Manual (WSC_REF) for more information on individual XYDRIVER functions (XYDRV16 and XYDRV32 DLL’s).
The "ASCII Protocol" is not a defined protocol, but rather it is a loose set of
conventions developed over a
period of years by BBS operators. Because XON/OFF flow control is used, only ASCII text
can be
transferred. The ASCII protocol is implemented as a DLL and is state driven like the MIO
and
XYDRIVER code.
ascStartTx(FileName,CharPace,TermChar,EchoFlag), where
Then call ascDriver() until it returns IDLE (1).
ascStartRx(FileName,TermChar,FirstWait,CharWait,EchoFlag), where
Then call ascDriver() until it returns IDLE (1).
The Windows Standard Serial Communications (WSC) library is available in three versions. All three versions have identical functionality.
The shareware version can be differentiated from the other two versions by:
The student version can be differentiated from the other two versions by:
The professional version can be differentiated from the other two versions by:
The professional version may be distributed with your application as specified by the software license. See Section 1.5 "Ordering" for details on ordering and Section 8.2 for the license information.
Once SIMPLE runs, compile and run the SELFTEST program. This program will test your
serial ports'
functionality.
We recommend the following steps if you believe that you have discovered a bug in the library:
If the problem is an error in the library and can be solved with an easy work-around, we will publish the work-around. If the problem requires a modification to the library, we will make the change and make the modified library available to our customers without charge.
See Section 1.5 "Ordering" for information on ordering.
MarshallSoft Computing, Inc. grants the registered user of WSC the right to use one copy of the WSC DLL's on a single computer in the development of any software product. The user may not use the library on more than one computer at the same time.
The "student" ($66 USD) registered DLL's may not be distributed under any circumstances, nor may they be used for any commercial purpose.
The "professional" ($95 USD) registered DLL's may be distributed (without royalty) in object form only, as part of the user's compiled application. The registered DLL's may NOT be distributed as part of any software development system (compiler or interpreter) without our express written permission. The source code for the library (WSC16.C, WSC32.C, MIO.C, and XYDRV.C) is copyrighted by MarshallSoft Computing and may not be released in whole or in part.
MARSHALLSOFT COMPUTING, INC. DISCLAIMS ALL WARRANTIES RELATING TO THIS SOFTWARE, WHETHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND ALL SUCH WARRANTIES ARE EXPRESSLY AND SPECIFICALLY DISCLAIMED. NEITHER MARSHALLSOFT COMPUTING, INC. NOR ANYONE ELSE WHO HAS BEEN INVOLVED IN THE CREATION, PRODUCTION, OR DELIVERY OF THIS SOFTWARE SHALL BE LIABLE FOR ANY INDIRECT, CONSEQUENTIAL, OR INCIDENTAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE SUCH SOFTWARE EVEN IF MARSHALLSOFT COMPUTING, INC. HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES OR CLAIMS. IN NO EVENT SHALL MARSHALLSOFT COMPUTING, INC.'S LIABILITY FOR ANY SUCH DAMAGES EVER EXCEED THE PRICE PAID FOR THE LICENSE TO USE THE SOFTWARE, REGARDLESS OF THE FORM OF THE CLAIM. THE PERSON USING THE SOFTWARE BEARS ALL RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE.
Some states do not allow the exclusion of the limit of liability for consequential or incidental damages, so the above limitation may not apply to you.
This agreement shall be governed by the laws of the State of Alabama and shall inure to the benefit of MarshallSoft Computing, Inc. and any successors, administrators, heirs and assigns. Any action or proceeding brought by either party against the other arising out of or related to this agreement shall be brought only in a STATE or FEDERAL COURT of competent jurisdiction located in Madison County, Alabama. The parties hereby consent to in personam jurisdiction of said courts.
Refer to the WSC Reference Manual (WSC_REF) for detailed information on the WSC functions. A one line summary of each function follows.
There are 28 functions in the WSC library.