Windows Standard
Serial Communications
for eVB
Programmer's Manual
(WSC_4eVB)
Version 3.3
July 21, 2003
This software is provided as-is.
There are no warranties, expressed or implied.
Copyright (C) 2003
All rights reserved
MarshallSoft Computing, Inc.
Post Office Box 4543
Huntsville AL 35815
Voice : 1-256-881-4630
FAX : 1-256-880-0925
email : info@marshallsoft.com
web : www.marshallsoft.com
MARSHALLSOFT is a registered trademark of MarshallSoft Computing.
1 Introduction
1.1 Features2 Library Overview
1.2 Documentation Set
1.3 Example Code Segment
1.4 Installation
1.5 Uninstalling
1.6 Ordering
1.7 Updates
2.1 Dynamic Link Libraries3 Example Programs
2.2 Compiling Programs
3.1 WSCVER (WSC Version)4 Revision History
3.2 SIMPLE
3.3 DEVICE
3.4 MODEM
3.5 XMS and XMR
3.6 YMS and YMR
The Windows/CE Standard Serial Communications Library (WSC/CE) is an asynchronous communications dynamic link library (DLL) which uses the standard Windows API (Application Programmer's Interface) to communicate with any device connected to a serial port.
The evaluation and registered versions are identical except that the evaluation version displays the "SW Info" screen.
WSC/CE features include:
A good selection of Embedded Visual Basic (eVB) example programs with full source code are included. Refer to Section 6 for more details on each of the example programs.
[PROGRAM] [DESCRIPTION]
WSCVER : Program that displays the WSC version number and build.
SIMPLE : A simple terminal emulator program.
DEVICE : Sends a user command to a serial device.
MODEM : Same as SIMPLE but controls flow control, modem lines, etc.
XMS , XMR : XMODEM send/receive programs.
YMS , YMR : YMODEM send/receive programs.
The complete set of documentation consists of four manuals in three formats (MS WORD, ASCII text, and HTML). This is the first manual (WSC_CE_USR) in the set.
Each manual comes in three formats:
The WSC User's Manual (WSC_eUSR) discusses language independent serial communications programming issues. Read this manual after reading the WSC Programmer's Manual.
The WSC Reference Manual (WSC_eREF) contains details on each individual WSC function.
The Asynchronous Serial Communications Manual (ASYNC) contains background information on serial port hardware.
Use Microsoft Word or Microsoft WordPad to print the document files.
' pass keycode (0 for evaluation version) to WSC
Code = SioKeyCode(0)
' open the port
Code = SioReset(Port, 1024, 1024)
If Code<0 Then
Begin
' SioReset fails
MsgBox("Cannot open port")
End
Else
Begin
' set baud rate (default is 19200)
Code = SioBaud(Port, 115200)
' set DTR and RTS
SioDTR(Port, ASC("S"))
SioRTS(Port, ASC("S"))
' set hardware (RTC/CTS) flow control
Code = SioFlow(Port, ASC("H"))
' set parity, stop bits & data bits (default is 8N1)
Code = SioParms(Port, WSC_NoParity, WSC_OneStopBit, WSC_WordLength8)
' transmit "AT" followed by a carriage return
X = "AT" + Chr(13)
Code = SioPuts(Port, X, 3)
' close port
Code = SioDone(Port)
End
The SETUP program creates a directory (default WSC4eVB) on the desktop machine with the following sub-directories (folders).
APPS : All example code.
DOCS : All documentation.
LIBS : All LIB files for each of the different CPUs.
DLLS : All DLL files for each of the different CPUs.
COPY : Files to copy to your Win/CE machine's \WINDOWS directory.
After SETUP completes, the DLL's in the COPY directory (folder) must be copied to your Win/CE machine's \WINDOWS directory (folder) using ActiveSync.
Microsoft Embedded Tools v3.0 must be installed on your desktop in order to compile the example programs.
Uninstalling WSC4eVB is very easy. WSC4eVB does not modify the registry. First, delete the WSCeVB project directory created when installing WSC4eVB. Second, delete WSC32.DLL and XYM32.DLL your Win/CE machine's \WINDOWS directory (folder) using ActiveSync.
WSC4eVB can be registered for $115 (or $195 with source code). See the section "Ordering" in the WSC4eVB User's Manual (WSC_eUSR) for details on ordering.
An update for WSC4eVB may be purchased for $30 (for email delivery) if ordered within one year of the original purchase (or previous update). After one year, WSC4eVB can be updated for $55. See the section "Ordering" in the WSC/CE User's Manual (WSC_eUSR) for details on ordering.
Note that the registered DLL's do not expire.
WSC4eVB is implemented as a Win/CE dynamic link library (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.
Microsoft Embedded Tools v3.0 must be installed on your desktop computer in order to compile the example programs.
The first example program is the WSCVER ("WSC Version") program which displays the WSC library version number.
SIMPLE is a very simple communications program using WSC4eVB. Everything typed on the keyboard is sent to the serial port, and everything incoming from the serial port is displayed on the screen.
The easiest way to test SIMPLE is to connect to a modem. Typing "AT" should result in an "OK" being displayed.
The DEVICE program is designed for talking to an arbitrary serial device. Use this program as a guide when communicating with serial devices other than modems and other computers.
MODEM is similar to SELFTEST, but with enhanced capability. It can set flow control (hardware, software, or none), DTR line (set or clear), RTS line (set or clear), display the transmit & receive queue sizes, detect a break signal, detect changes in DSR and CTS. It can also check for various line errors such as parity error, framing error, data overrun, receive queue overflow, and transmit buffer full.
XMS (XMODEM Send) and XMR (XMODEM Receive) are programs that send and receive files using the XMODEM protocol.
YMS (YMODEM Send) and YMR (YMODEM Receive) are programs that send and receive files using the YMODEM protocol.
Version 3.3: July 21, 2003