Home

WSC4C Programmer`s Manual

image

Contents

1. include lt stdio h gt include wsc h void main void int Code SioKeyCode 0 0 is evaluation version key code reset open COM1 Code SioReset COM1 1024 1024 if Code lt 0 char Temp 80 display error message SioWinError char Temp 80 printf ERROR d s n Code LPSTR Temp SioDone COM1 exit 1 set the DTR line printf Setting DTR n SioDTR COM1 S wait for user to quit printf Type any character to exit n getch close port SioDone COM1 Refer to section 6 0 for complete examples with source 1 4 Installation 1 Before installation of WSC4C a Windows C C compiler should already be installed and tested 2 Unzip WSC4C54 ZIP evaluation version or WSCxxxxx ZIP where xxxxx is the developer s Customer ID using any Windows unzip program 3 Run the installation program SETUP EXE which will install all WSCAC files including copying WSC64 DLL and WSC32 DLL to the Windows directory Note that no DLL registration is required 1 5 Uninstalling Uninstalling WSCAC is very easy First delete the WSC project directory created when installing WSCAC Second delete WSC64 DLL and WSC32 DLL from the Windows directory normally CANWINDOWS That s it 1 6 Pricing A developer license for the Windows Standard Serial Communications Library WSC4C can be purchased for 115 or 195 with ANSI C source code to the library DLL s Purchasing details can be found in the
2. unzip vs2010 64bit vcxproj Visual Studio 2012 32 bit unzip vs2012 32bit vcxproj Visual Studio 2012 64 bit unzip vs2012 64bit vcxproj Visual Studio 2013 32 bit unzip vs2013 32bit vcxproj Visual Studio 2013 64 bit unzip vs2013 64bit vcxproj Visual Studio 2015 32 bit unzip vs2015 32bit vcxproj Visual Studio 2015 64 bit unzip vs2015 64bit vocxproj 5 3 CONSOLE The CONSOLE program is a console mode program similar to SIMPLE It also demonstrates how to acquire and manipulate the standard input handle so that a KeyPress function can be implemented CONSOLE takes the port and baud rate as arguments For example to start CONSOLE on COMI at 38 400 baud CONSOLE 1 38400 Makefiles amp project files are Microsoft Microsoft Microsoft Borland Borland Watcom 1 LCC WIN32 MinGW C Poon St amp 0 0 0 0 5 0 6 0 6 0 32 bit 32 bit 32 bit 32 bit 32 bit 32 bit 32 bit 32 bit console32 console ma k console dsp console32 b console32 i console32 w m makefile unzip microsoft60 zip project file project file makefile unzip Makefiles Borland50 zip makefile unzip Makefiles Borland55 zip makefile unzip Makefiles Watcom11 zip console lcc bat makefile unzip Makefiles LCC zip console gcc bat makefile unzip Makefiles GCC zip VC_CONSOLE CPP if the Visual Studio C NET version of CONSOLE Visual Stud Vis
3. Ability to specify the parity word size and number of stop bits Supports binary and text data transfer Is fully thread safe Can send Windows messages on completion of events incoming character etc Supports all versions of Windows through Windows 10 License covers all programming languages Royalty free distribution with a compiled application There are no run time fees Evaluation versions are fully functional No unlock code is required Can be used from GUI mode or console mode programs Is fully thread safe Implemented as a standard Windows DLL which will work with all versions of Windows Is native Windows code but can also be called from managed code Will run on machines with or without NET installed Works with all versions of Microsoft Visual C C v1 52 through Visual Studio 2015 Works with Microsoft Visual Studio NET and Visual C Works with Borland C C v5 0 v5 5 and Borland C Builder Also works with Microsoft Foundation Class Watcom v11 MinGW Digital Mars and LCC Does not depend on support libraries Makes calls to core Windows API functions only Can be used with any program in any language capable of calling Windows API functions such as Visual Basic VB NET Visual FoxPro Delphi Xbase dBASE COBOL Access or Excel Can be purchased with or without source code Free updates for one year License includes technical support for one year Documentation online as well as in printable f
4. Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page oO 00000000 J 1 J10O0 O5 CO CO CO N ID IB EO B IO B EO po i p iB p iO B p E i B B EO S 0 NOI 0 0000 1 1OOv Ui Ut 0 I2PPOO OO O 1 Introduction The Windows Standard Serial Communications Library for C C WSC4C is a toolkit that allows software developers to quickly develop serial communication applications in C C Visual C NET and Visual C The Windows Standard Serial Communications Library WSC is a component DLL library used to create serial communications programs that access data from a serial port using RS232 or multi drop RS422 or RS485 ports WSC also supports virtual serial ports such as Bluetooth serial and USB to serial converters The WSC component library uses the Windows API for all communication and can be used to easily write applications to control serial devices such as barcode scanners modems lab instruments medical devices USB serial devices scales GPS navigation etc This Windows Standard Serial Communications Programmer s Manual provides information needed to compile programs in a C C C programming environment WSCAC includes more than 25 C C example programs demonstrating serial port communication functions Microsoft Visual Stud
5. generated will be executed by the Windows WOW64 Windows on Windows 64 bit component If a compiler generates 64 bit application code and is running on a 64 bit version of Windows then the compiler must be reconfigured to generate 32 bit application code if the application will call 32 bit DLL s such as WSC32 DLL The 32 bit application code generated will be executed by the Windows WOW64 Windows on Windows 64 bit component 2 12 1 Visual Studio C Versions 2005 through 2015 With a project selected in Solution Explorer on the Project menu click Properties Click the Configuration Manager button in upper right corner Click the drop down button below Platform Click lt New gt then choose x86 Win32 2 12 2 Visual Studio Visual Basic Versions 2005 through 2015 With a project selected in Solution Explorer on the Project menu click Properties Click Build then Configuration Manager Click the drop down button below Active Solution Platform Click lt New gt then change Any CPU to x86 11 2 12 3 64 bit Application Programs and WSC 64 bit DLLs such as WSC64 DLL may only be used by 64 bit application programs running on 64 bit Windows computers This means that 64 bit application programs must be linked with WSC64 LIB instead of WSC32 LIB There are several 64 bit example programs 64 bit Visual Studio 2008 2010 2012 2013 project files Unzip vs2008 64bit vcproj zip for VS2008 project files
6. 1 3 Microsoft Visual Studio VC v5 0 To open an existing project choose File then Open Workspace and then select makefiles from the list of file types Most of the example programs have Microsoft Developer C C project makefiles ending with MAK such as WSCVER MAK To create a new project in MSVC v5 0 choose File then New then Win32 Application or Win32 Console Application and the project name Check Create new workspace Select Project then Add to Project Add all filenames including any resource file RC and WSC32 LIB Lastly select Rebuild All If the compiler complains that it cannot find main Console Application was chosen but the program being compiled is a GUI application If the compiler complains that it cannot find WinMain Application was chosen but the program being compiled is a Console Mode application Be sure to specify YX rather than Yu in the project settings Build Settings C C 3 1 4 Microsoft Visual Studio VC v6 0 To open an existing project follow the same directions as for MSVC v5 0 except that a DSP project file may be used instead of the MAK project makefile To create a new project in MSVC v6 0 follow the same directions as for MSVC v5 0 above 3 1 5 Microsoft Visual Studio 2003 through 2015 Open the VC project file files ending in vcproj or dsp build and run as in previous versions of Visual Studio Unzip vs2008 32bit vcproj zip for all
7. SioRead function e Added Borland C Builder example program Version 2 2 October 1 1997 e Fixed problem in XYDRV C renamed from XYDRIVER C e Added xyGetFileName function to XYDRV e WSC4C supports up to 16 ports e WSCA4C runs under Windows NT e Added Microsoft Foundation Class MFC Example e Added ASCII protocol Version 2 3 July 15 1998 e Multiple changes to XYDRV for added capability e SioTimer function added to WSC16 and WSC32 e FINDER example modem search program added e CONSOLE example console mode program added e ECHOPORT example multi thread program added e SioBaud amp SioParms can be called before SioReset e WSC32 C modified so that the number of supported ports can be easily increased Version 2 4 May 17 1999 e SioEvent function added WIN32 only e New xyDriver code e New XMODEM example programs XMS and XMR e New RS485 example program e Specify default DTR amp RTS behavior with SioReset Version 3 0 July 12 2000 e Added SioMessage function e New WORD and HTML documentation e New example programs Version 3 1 April 19 2001 e RESETDEV Win API call not called allows USB serial converters e SioPutc and SioPuts return immediately e WSC32 C can be recompiled for Win CE 34 Version 3 2 July 17 2002 e Modified so can be compiled for Windows CE USE_WIN_CE e Default for RESETDEV is not called SioDebug R to enable e SioGetc amp SioGe
8. VS2008 project files Unzip vs2008 64bit vcproj zip for all VS2008 project files nzip vs2010 32bit vexproj zip for all VS2010 project files nzip vs2010 64bit vexproj zip for all VS2010 project files aq nzip vs2012 32bit vexproj zip for all VS2012 project files nzip vs2012 64bit vexproj zip for all VS2012 project files GG c nzip vs2013 32bit vexproj zip for all VS2013 project files nzip vs2013 64bit vexproj zip for all VS2013 project files G nzip vs2015 32bit vexproj zip for all VS2015 project files nzip vs2015 64bit vexproj zip for all VS2015 project files aq Also refer to Section 4 2 below 3 1 6 Microsoft Visual C Express The Express Edition of Microsoft C is available as a free download at http www microsoft com express download Open the VC project file files ending in vcproj or dsp build and run as in previous versions of Visual Studio Also see Section 4 2 below 14 3 2 Microsoft Visual C C Sharp WSC functions can be called from Visual C C sharp in the same manner as Win32 API functions All Visual C projects end with extension csproj For example CS vers csproj In order to open an existing Visual C project choose File Open and then Project from the Microsoft Cit Development Environment Specify the directory containing the Visual C project files for example C WSC4C APPS In order to call WSC functions from
9. WSC User s Manual WSC USR Section 1 3 How to Purchase http www marshallsoft com wsc 4c pdf Also See INVOICE TXT or http www marshallsoft com order htm 1 7 Updates When a developer license is purchased for WSCAC the developer will receive a new set of registered DLLs plus a license file WSCxxxx LIC The license file is used to download updates to the registered DLL s for a period of one year from purchase Updates can be downloaded from http www marshallsoft com update htm After one year your license must be updated to be able to download updates A developer license can be updated for e 30 if the update is ordered within one year of the original purchase or previous update e 55 if the update is ordered between one and three years of the original purchase or previous update e 75ifthe update is ordered after three years of the original purchase or previous update The update price includes technical support for an additional year If source code was previously purchased updates to the source code can be purchased for 40 along with the DLL update Note that the registered WSC DLLs never expire 2 Library Overview 2 1 Using the WSC Library The Windows Standard Communications Library for C C has been tested on multiple computers running Windows 95 98 Me XP 2003 2012 Vista Windows 7 Windows 8 Windows10 and Windows NT 2000 The WSCAC library has been tested with several C C compilers including Mic
10. for the GCC command line compiler For example MAKE f SIMPLE LIB 32 G_ Command line batch files ending with GCC BAT are provided for several of the projects For example compile SIMPLE using MinGW GCC by typing SIMPLE GCC BAT on the command line 21 5 Example Programs Some of the example programs are written in GUI mode WSCVER MFC PGM TERM SELFTEST SIMPLE although most are written in Win32 Win64 console mode This was done in order to provide the clearest possible code without the complication and complexity of GUI code All console mode programs can be converted to GUI mode by adding the necessary Windows interface code Example programs are located in the VAPPS directory Microsoft project files are classified as e mak icrosoft VC 4 0 5 0 6 0 project files Win32 e dsp icrosoft VC 6 0 project files Win32 only e vcproj icrosoft Visual Studio project files Win32 only e VS2008 32bit vcproj icrosoft Visual Studio 2008 project files Win32 e VS2008 64bit vcproj icrosoft Visual Studio 2008 project files Win64 e VS2010 32bit vcxproj icrosoft Visual Studio 2010 project files Win32 e VS2010 64bit vcxproj icrosoft Visual Studio 2010 project files Win64 e VS2012 32bit voxproj icrosoft Visual Studio 2012 project files Win32 e VS2012 64bit vcxproj icrosoft Visual Studio 2012 project files Win64 e VS2013 32bit vcxproj icrosoft Visual Stu
11. this remove all code from WSC C provided when the source code is purchased from ifndef STATIC LIBRARY through the following fendif 2 6 Using Threads WSCAC is thread safe Refer to the ECHOPORT C example program which demonstrates the use of multiple threads ECHOPORT also demonstrates the use of the Win32 Win64 Sleep function Also examine the EVENT C example program which uses both threads and the SioEvent function 2 7 Calling WSC functions from C Like Windows itself WSC functions are coded in ANSI C but they can be called directly from both ANSI C programs and from C and C programs WSC functions can also be called using the C class wrapper fSio Refer to HELLO CPP for an example 2 8 Adding WSC Functions to an Existing Program In order to call WSC functions from an existing program 1 add include wsc h to your application source code 2 link with WSC32 LIB for MSVC WSC32BCB LIB Borland C C and C Builder WSC32 LIB Watcom or WSC32LCC Win32 LCC and recompile from source For Win64 applications link with WSC64 LIB rather then WSC32 LIB 2 9 SioEvent Logic SioEvent SioEventChar and SioEventWait will block until the specified event occurs If a call to SioEvent SioEventChar or SioEventWait is placed in a thread then the thread will block but the application calling the thread will not e SioEvent blocks until the specified event occurs e SioEventWait blocks until the specif
12. your Visual C programs do the following to your existing C source code Add the contents of file wsc_ funs cs to source code after public class wsc System Windows Forms Form Add the constants from wsc_cons cs to your program as they are needed Look at the cs vers program in the APPS directory for an example Note that if pointers are to be passed to Visual C programs the C programs must be compiled in unsafe mode This is necessary only when calling those functions such as SioPuts SioGets or SioWinError that pass pointers 3 3 Microsoft C C 16 bit only Support for Winl6 was dropped beginning with version 5 2 Version 5 1 is still available free when purchasing the current version for those wanting Win16 support 15 3 4 Borland C C Borland C C version 5 0 programs can be compiled from either the command line using makefiles ending with b or from within the Borland development environment using Borland v5 0 or above Borland C C Version 5 5 which can be downloaded from www borland com is a free Win32 console mode compiler no IDE Makefiles for BC v5 5 end with 1 and like Borland C Builder use ILINK32 rather than TLINK32 Be careful with linker response files RSP they must NOT end with a carriage return line feed Borland programs always link with WSC32BC5 LIB 3 4 1 Borland Command Line Makefiles Programs can be compiled using command line makefiles All Borland Win32 comm
13. 005 32 bit vc_event vcproj Visual Studio 2008 32 bit unzip vs2008 32bit vcproj Visual Studio 2008 64 bit unzip vs2008 64bit vcproj Visual Studio 2010 32 bit unzip vs2010 32bit vcxproj Visual Studio 2010 64 bit unzip vs2010 64bit vcxproj Visual Studio 2012 32 bit unzip vs2012 32bit vcxproj Visual Studio 2012 64 bit unzip vs2012 64bit vcxproj Visual Studio 2013 32 bit unzip vs2012 32bit vcxproj Visual Studio 2013 64 bit unzip vs2013 64bit vcxproj Visual Studio 2015 32 bit unzip vs2015 32bit vcxproj Visual Studio 2015 64 bit unzip vs2015 64bit vcxproj 5 12 FINDER The FINDER program is a console mode program that searches for a connected modem The modem must be turned on FINDER takes no arguments Makefiles amp project files are Microsoft 4 0 6 0 32 bit finder32 m makefile unzip microsoft60 zip Microsoft 4 0 6 0 32 bit finder mak project file Microsoft 6 0 32 bit finder dsp project file Borland 5 0 32 bit finder32 b makefile unzip Makefiles Borland50 zip Borland 51 5 32 bit finder32 i makefile unzip Makefiles Borland55 zip Watcom SONS 32 bit finder32 w makefile unzip Makefiles Watcomll zip LCC WIN32 32 bit finder 1cc bat cmd file unzip Makefiles LCC zip MinGW GCC 32 bit finder gcc bat cmd file unzip Makefiles GCC zip Borland C Bld 32 bit finder prj bpr project file VC FINDER is the Visual Stu
14. Borland 545 32 bit Watcom 117 0 32 bit 5 10 EchoPort 1 256 555 1212 Dial32 Dial mak Dial dsp Dial32 Dial32 Dial32 m b i ER makefile unzip microsoft60 zip project file project file makefile unzip Makefiles Borland50 zip makefile unzip Makefiles Borland55 zip makefile unzip Makefiles Watcom11 zip The EchoPort console mode program demonstrates the use of threads Connect COMI and or COM to another computer or serial device using a NULL modem cable EchoPort will echo back to the remote anything that it receives on the serial port EchoPort takes no arguments Makefiles amp project files are Microsoft 4 0 6 0 32 bit Microsoft 4 0 6 0 32 bit Microsoft 6 0 32 bit Borland 5 0 32 bit Borland DID 32 bit Watcom 11 0 32 bit EchoPort m_ EchoPort EchoPort EchoPort EchoPort EchoPort makefile unzip microsoft60 zip project file project file makefile unzip Makefiles Borland50 zip _ makefile unzip Makefiles Borland55 zip makefile unzip Makefiles Watcom11 zip 27 5 11 Event EventC EventW The EVENT console mode program demonstrates the use of SioEvent in efficiently waiting for serial input SioEvent blocks until the requested event occurs Also see the EventC example program that uses SioEventChar and the EventW example program that uses SioEventWait Refer to Section 2 9 for information on the SioEvent functions Makefiles amp projec
15. E32 The file Makefiles Watcom1 1 zip contains the WATCOM 11 command line makefiles for most of the example programs 3 7 2 Watcom IDE To create a new project choose File then New Project Enter the project name and then choose Win32 as the target Use the INS Insert key to pop up a dialog box into which the project file names are entered Select Options from the main window then C Compiler Switches then 10 Memory Models and Processor Switches Check 80386 Stack based calling 3s then check 32 bit Flat model mf 17 3 8 LCC C C The LCC WIN32 and LCC WIN 64 compilers were developed by the University of Virginia See http www cs virginia edu lcc win32 The file Makefiles lcc zip contains the LCC command line makefiles for most of the example programs 3 9 MinGW C MinGW Minimalist GNU for Windows is part of the GNU Compiler Collection GCC and GNU Binutils for use in the development of native Microsoft Windows applications See http www mingw org The file Makefiles GCC zip contains the MinGW GCC project command line makefiles for most of the example programs Note The GCC make executable make exe is used which requires libiconv2 dll and libintl3 dll 3 10 Digital Mars C The Digital Mars Win32 C compiler is distributed by Digital Mars See http www digitalmars com The file Makefiles mars zip contains the Digital Mars command line makefiles for most of the example p
16. LFTEST SELFTEST is a GUI mode program that performs serial port I O functionality testing using a loopback adapter Refer to LOOPBACK TXT for an explanation of how to make a loopback adapter without tools Makefiles amp project files are Microsoft 4 0 6 0 32 bit self32 m makefile unzip microsoft60 zip Microsoft 4 0 6 0 32 bit selftest mak project file Microsoft 6 0 32 bit selftest dsp project file Borland 520 32 bit self32 b makefile unzip Makefiles Borland50 zip Borland 5x5 32 bit self32 i makefile unzip Makefiles Borland55 zip Watcom 140 32 bit self32 w makefile unzip Makefiles Watcom11 zip 5 6 TERM TERM is a simple GUI mode ANSI terminal emulator suitable downloading or uploading files using XMODEM or YMODEM The TERM program uses MIO32 DLL for modem control commands and XYDRV32 DLL for XMODEM amp YMODEM file transfer Selecting Dial from the menu bar will result in a pop up dialog requesting the phone number to dial Once entered the number is dialed and the program will wait for up to 60 seconds for the CONNECT string from the modem This wait can be terminated at any time by choosing BREAK on the menu bar Once logged on files can be uploaded or downloaded by selecting Send or Receive from the menu bar To abort a file transfer choose BREAK from the menu bar then type a series of Ctrl X X characters from the keyboard TERM uses ANSI C which provides ANSI terminal
17. Windows Standard Serial Communications for C C Programmer s Manual WSC_4C Version 5 4 August 11 2015 This software is provided as is There are no warranties expressed or implied Copyright C 2015 All rights reserved MarshallSoft Computing Inc Post Office Box 4543 Huntsville AL 35815 Email info 9 marshallsoft com Web www marshallsoft com MARSHALLSOFT is a registered trademark of MarshallSoft Computing TABLE OF CONTENTS 1 2 3 4 5 6 7 1 I 1 1 1 1 I 1 1 L 2 2 2 2 2 2 2 2 24 2 2 2 S 3 3 3 3 3 3 3 3 3 3 OMAAINDUBWNHRONDOBWN HS OarATNA OB WN 1 1 1 9 1 ntroduction Features Documentation Set Example Program Installation Uninstalling Pricing Updates rary Overview Using the Library Keycode License Key Console Mode Limitations on COM Ports Static Linking Using Threads Calling WSC Functions from C Adding WSC Functions to an Existing Program SioEvent Logic 0 Virtual Serial Ports 1 Explicitly Loading the WSC DLL 2 Targeting a 64 Bit CPU upported Compilers EAE Microsoft Visual C Microsoft Visual C4 C Sharp Microsoft C C 16 bit Borland C Turbo C C for Windows Borland C Builder Watcom C C LCC C MinGW C 0 Digital Mars ompiling Programs 4 1 Compiling WSC Source Code 4 2 Compiling Example Programs Example Programs Additional Examples Revision History
18. and line makefiles end with 32 b or 32 i for Borland 5 5 To compile using a makefile use the Borland MAKE utility For example MAKE f SIMPLE LIB 32 B The file Makefiles Borland50 zip contains the Borland C C 5 0 command line makefiles the file Makefiles Borland55 zip contains the Borland C C 5 5 command line makefiles 3 4 2 Borland IDE To create a new project first turn off LINKER case sensitivities Choose Options Projects Linker General Turn off the case sensitive link and case sensitive exports and imports boxes Next choose Files then New Project Use the INS Insert key to pop up a dialog box into which the project file names are entered Lastly add WSC32BCB LIB to your project WSC32BCB LIB can also be created from WSC32 DLL using the Borland IMPLIB utility IMPLIB WSC32BCB LIB WSC32 DLL Select GUI or Console for the Target Model Only Static or Dynamic should be checked for Standard Libraries NOTEI If after linking in the IDE you get unresolved external references to the library functions in which each function name is all upper case then you have NOT turned off case sensitivity as described above NOTE2 If you get errors compiling the windows header file WINDOWS H turn on Borland Extensions in Options Project Compiler Source 3 5 Turbo C C for Windows Borland Turbo C C for Windows does not have command line tools so all program
19. cxproj CS_VERS is the Visual Studio C version of WSCVER VC_VERSION Visual Studio C 2003 2005 2008 32 bit CS vers csproj 23 5 2 SIMPLE SIMPLE is a very straightforward GUI mode terminal communications program using WSC4C 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 Makefiles amp project files are Microsoft 4 0 6 0 32 bit simple32 m makefile unzip microsoft60 zip Microsoft 4 0 6 0 32 bit simple mak project file Microsoft 6 0 32 bit simple dsp project file Borland 5 40 32 bit simple32 b makefile unzip Makefiles Borland50 zip Borland 5 5 32 bit simple32 i _ makefile unzip Makefiles Borland55 zip Watcom Jd 32 bit simple32 w makefile unzip Makefiles Watcomll zip LCC WIN32 32 bit simple 1cc bat batch unzip Makefiles LCC zip MinGW GCC 32 bit simple gcc bat batch unzip Makefiles GCC zip Borland C Bld 32 bit simple prj bpr project file VC_SIMPLE is the Visual Studio C NET version of SIMPLE Visual Studio 2003 2005 32 bit vc_simple vcproj Visual Studio 2008 32 bit unzip vs2008 32bit vcproj Visual Studio 2008 64 bit unzip vs2008 64bit vcproj Visual Studio 2010 32 bit unzip vs2010 32bit vcxproj Visual Studio 2010 64 bit
20. d Line Makefiles Some of the example programs can be compiled using command line makefiles All Microsoft Win32 command line makefiles end with 32 m To compile using a makefile use the Microsoft NMAKE utility For example NMAKE f SIMPLE LIB 32 M WSC can be used with Microsoft Foundation Class MFC programs Use the MFCPGM32 MAK makefile to compile the MFC_PGM example program NMAKE f MFCPGM32 MAK The file Makefiles Microsoft zip contains the Microsoft Visual C C 4 0 5 0 6 0 and Visual Studio through VS 2015 command line makefiles for most of the example programs Project files for Microsoft C C 4 0 thru 6 0 have extensions mak and dsp 3 1 2 Microsoft Developer Studio VC v4 0 To open an existing project choose File then Open Workspace and then select makefiles from the list of file types Most of the example programs have Microsoft Developer C C project makefiles ending with MAK such as WSCVER MAK To create a new project in MSVC v4 0 choose File then New then Project Workspace Select Application or Console Application for Type and the project name for Name Choose Win32 for platform Then select Create Select Insert then Files into Project Add all filenames including any resource file RC and WSC32 LIB Lastly select Build then Rebuild All Be sure to specify YX rather than Yu in the project settings Build Settings C C 13 3
21. dio C NET version of FINDER Visual Studio 2003 2005 32 bit vo finder vocproj Visual Studio 2008 32 bit unzip vs2008 32bit vcproj Visual Studio 2008 64 bit unzip vs2008 64bit vcproj Visual Studio 2010 32 bit unzip vs2010 32bit vcxproj Visual Studio 2010 64 bit unzip vs2010 64bit vocxproj Visual Studio 2012 32 bit unzip vs2012 32bit vcxproj Visual Studio 2012 64 bit unzip vs2012 64bit vcxproj Visual Studio 2013 32 bit unzip vs2012 32bit vcxproj Visual Studio 2013 64 bit unzip vs2013 64bit vcxproj Visual Studio 2015 32 bit unzip vs2015 32bit vcxproj Visual Studio 2015 64 bit unzip vs2015 64bit vcxproj 5 14 HELLO The Hello cpp console mode example program demonstrates how to use the fSio C class Microsoft 4 0 6 0 32 bit Hello m makefile unzip microsoft60 zip Microsoft 4 0 6 0 32 bit Hello mak project file Microsoft 6 0 32 bit Hello dsp project file Borland 5 0 32 bit Hello b_ makefile unzip Makefiles Borland50 zip Borland 5 5 32 bit Hello i makefile unzip Makefiles Borland55 zip Watcom 11 0 32 bit Hello w makefile unzip Makefiles Watcom11 zip 5 15 HOST The HOST console mode program answers an incoming modem call It functions as a very simple BBS Bulletin Board System program HOST uses both WSC32 DLL and MIO32 DLL Start HOST from the command line passing the port and baud rate For example HOST 1 19200 Ma
22. dio 2013 project files Win32 e VS2013 64bit vcxproj icrosoft Visual Studio 2013 project files Win64 e VS2015 32bit vcxproj icrosoft Visual Studio 2015 project files Win32 e VS2015 64bit vcxproj icrosoft Visual Studio 2015 project files Win64 e bpr Borland C Builder project fil Command line makefiles are classified as M Microsoft C C makefiles B Borland C C 5 0 makefiles I Borland C C 5 5 makefiles e W Watcom C C makefiles L D LCC C makefiles Digital Mars C makefiles Microsoft Visual C Developer Studio files end in MAK and can be loaded with Open Workspace and include simple mak term mak console mak event mak rs485 mak xms mak xmr mak yms mak ymr mak finder mak echoport mak host mak device mak wscver mak dial mak amp hello mak Other files ending with MAK and BPR include MFCPGM32 MAK Microsoft Foundations Class MFC makefile Win32 SIMPLE PRJ MAK Borland C Builder makefile BCB version 1 through 3 SIMPLE PRJ BPR Borland C Builder makefile BCB version 4 and above NOTE Unfortunately the extension MAK is used by computer manufacturers for both makefiles and project files Further a makefile that works with one compiler will not usually work with another 22 5 1 WSCVER WSCVER WSC Version is a GUI program that displays the WSC library version number Its purpose is to display the WSC version build and re
23. e programs look like DOS programs they are Win32 Win64 programs that have access to the Win32 Win64 API and the entire Windows address space Programming using console mode programs reduces the complexity of using GUI code All console mode programs can be converted to GUI mode by adding the necessary Windows interface code 2 4 Limitations on COM Ports The 32 bit and 64 bit versions of WSC4C WSC32 DLL and WSC64 DLL can use any port from COM1 to COM256 provided that the port is known to Windows and there is physical hardware present 2 5 Static Linking The registered user can statically link WSC so that the DLL is not needed Static linking requires the object file WSC32 OBJ or WSC64 OBJ version of WSC included in the registered package or source code For example to create an application that links WSC32 OB J statically Make sure that all application code that includes WSC H must define STATIC LIBRARY before including WSC H If using Microsoft Developer Studio make these changes 1 To the project file Do NOT add WSC32 LIB to your project file 2 To the settings See Build Settings or Project Settings 3 C C Tab Add STATIC LIBRARY to preprocessor definitions 4 Link Tab Add WSC32 OBJ to object library modules 5 Add include wsc h to all source files that make calls to WSC functions Alternatively WSC C can be edited so that they can be compiled and linked like any other program file In order to do
24. eck per ISO 1155 e SioQuiet and SioWaitFor verify the passed port number e SioWaitFor verifies that the passed baud rate is gt 0 e SioSetInteger no longer requires an open port for global all ports parameters e Modified SioReset to make it more tolerant opening slow virtual ports Version 5 4 August 11 2015 e Added makefiles for GCC LCC and Digital Mars C compilers e Added SioCRC16 that computes 16 bit CCITT CRC polynomial 1021 hex e Added SioCRC32 that computes 32 bit CCITT CRC polynomial 04C11DB7 hex e Added SioCountWait that waits for a specified number of incoming bytes before returning e Added support for Visual Studio 2013 and Visual Studio 2015 36
25. ect files are Microsoft 4 0 6 0 32 bit Microsoft 4 0 6 0 32 bit Microsoft 6 0 32 bit Borland 5 0 32 bit Borland 5 5 32 bit Watcom 13 50 32 bit Device m Device mak Device dsp Device b_ Device i Device w makefile unzip microsoft60 zip project file project file makefile unzip Makefiles Borland50 zip makefile unzip Makefiles Borland55 zip makefile unzip Makefiles Watcom11 zip VC DEVICE is the Visual Studio C NET version of DEVICE Visual Studio 2003 2005 32 bit Visual Studio 2008 32 bit unzip Visual Studio 2008 64 bit unzip Visual Studio 2010 32 bit unzip Visual Studio 2010 64 bit unzip Visual Studio 2012 32 bit unzip Visual Studio 2012 64 bit unzip Visual Studio 2013 32 bit unzip Visual Studio 2013 64 bit unzip Visual Studio 2015 32 bit unzip Visual Studio 2015 64 bit unzip 5 9 DIAL vc device vcproj vs2008 32bit vcproj vs2008 64bit vcproj vs2010 32bit vcxproj vs2010 64bit vcxproj vs2012 32bit vcxproj vs2012 64bit vcxproj vs2012 32bit vcxproj vs2013 64bit vcxproj vs2015 32bit vcxproj vs2015 64bit vcxproj The DIAL console mode example program uses the MIO module to dial up using the port baud rate and phone number specified by the user on the command line For example DIAL 1 38400 Makefiles amp project files are Microsoft 4 0 6 0 32 bit Microsoft 4 0 6 0 32 bit Microsoft 6 0 32 bit Borland 50 32 bit
26. ed for the Borland IDE unzip BC50 IDE ZIP and command line makefiles files ending in B for the Borland command line compiler Forexample MAKE f SIMPLE LIB 32 B 4 2 5 Compiling Using Borland C C 5 5 Borland C C 5 5 is a command line compiler that can compile both 32 bit programs only Command line makefiles ending in I are provided For example MAKE f SIMPLE LIB 32 I 20 4 2 6 Compiling Using Borland C Builder Borland C Builder BCB is an IDE that features drag and drop forms building like Delphi and Visual Basic BCB compiles 32 bit programs only BCB project files end with the extension bpr Load projects simple_prj bpr and finder_prj bpr 4 2 7 Compiling Using Watcom 11 Programs can be compiled with Watcom 11 using either the Watcom IDE or the command line compiler Several command line makefiles files ending in W are provided for the Watcom command line compiler For example WMAKE f SIMPLE LIB 32 W_ 4 2 8 Compiling Using LCC Several LCC command line makefiles files ending in _L_ are provided for the LCC command line compiler For example MAKE f SIMPLE LIB 32 L Command line batch files ending with LCC BAT are provided for several of the projects For example compile SIMPLE using LCC WIN32 by typing SIMPLESLCC BAT on the command line 4 2 0 Compiling Using MinGW C Several GCC command line makefiles files ending in _G_ are provided
27. emulator support Makefiles amp project files are Microsoft 4 0 6 0 32 bit term32 m_ makefile unzip microsoft60 zip Microsoft 4 0 6 0 32 bit term mak project file Microsoft 6 0 32 bit term dsp project file Borland 5 0 32 bit term32 b makefile unzip Makefiles Borland50 zip Borland Da 32 bit term32 i makefile unzip Makefiles Borland55 zip Watcom 11 0 32 bit term32 w makefile unzip Makefiles Watcom11 zip LCC WIN32 32 bit term 1cc bat batch unzip Makefiles LCC zip MinGW C 32 bit term gcc bat batch unzip Makefiles GCC zip 5 7 CALLBACK The Callback example program demonstrates how to implement a WSC callback function The code necessary to perform the callback is encapsulated in the SioCallback c file Makefiles amp project files are Microsoft 4 0 6 0 32 bit CallBack m makefile unzip microsoft60 zip Microsoft 4 0 6 0 32 bit CallBack mak project file Microsoft 6 0 32 bit CallBack dsp project file Borland Sui 32 bit CallBack b makefile unzip Makefiles Borland50 zip Borland 545 32 bit CallBack i makefile unzip Makefiles Borland55 zip Watcom T3440 32 bit CallBack w makefile unzip Makefiles Watcoml1 zip 26 5 8 DEVICE The DEVICE console mode program is designed for talking to an arbitrary serial device Use this program as a guide when communicating with all serial devices other than modems and other computers Makefiles amp proj
28. gistration string as well as to verify that WSC64 DLL 64 bit apps or WSC32 DLL 32 bit apps is being found and loaded by Windows Makefiles amp project files are Microsoft 4 0 6 0 32 bit Microsoft 4 0 6 0 32 bit Microsoft 6 0 32 bit Borland 570 32 bit Borland errs 32 bit Watcom 13 50 32 bit LCC WIN32 32 bit MinGW GCC 32 bit wscver32 b wscver32 i wscver32 w wscver lcc b wscver gcc b Wwscver32 m wscver mak wscver dsp makefile project file project file unzip microsoft60 zip VC_VERSION is the Visual Studio C NET version of WSCVER Visual Studio 2003 2005 32 bit vc_ver Visual Studio 2008 32 bit unzip Visual Studio 2008 64 bit unzip Visual Studio 2010 32 bit unzip Visual Studio 2010 64 bit unzip Visual Studio 2012 32 bit unzip Visual Studio 2012 64 bit unzip Visual Studio 2013 32 bit unzip Visual Studio 2013 64 bit unzip Visual Studio 2015 32 bit unzip Visual Studio 2015 64 bit unzip makefile unzip Makefiles Borland50 zip makefile unzip Makefiles Borland55 zip makefile unzip Makefiles Watcom11 zip at batch unzip Makefiles LCC zip at batch unzip Makefiles GCC zip sion vcproj vs2008 32bit vcproj vs2008 64bit vcproj vs2010 32bit vcxproj vs2010 64bit vcxproj vs2012 32bit vcxproj vs2012 64bit vcxproj vs2013 32bit vcxproj vs2013 64bit vcxproj vs2015 32bit vcxproj vs2015 64bit v
29. hortToByte functions for converting 8 bit Character Buffer to and from 16 bit Unicode ASCII The project file is Visual Studio C 2003 2005 2008 2010 2012 2013 2015 32 bit cs at ok 2 csproj 521 LoadLib The LoadLib console mode example program demonstrates how to load WSC functions dynamically from a specified location Makefiles amp project files are Microsoft 4 0 6 0 32 bit LoadLib m makefile unzip microsoft60 zip Microsoft 4 0 6 0 32 bit LoadLib mak project file Microsoft 6 0 32 bit LoadLib dsp project file Borland 5 0 32 bit LoadLib b makefile unzip Makefiles Borland50 zip Borland 9 5 32 bit LoadLib i makefile unzip Makefiles Borland55 zip Watcom 11 0 32 bit LoadLib w makefile unzip Makefiles Watcoml1 zip 32 6 Additional Examples We have other examples programs including programs for controlling voice modems which use the Rockwell voice data chip set an example of handling continuously incoming data and others Please contact us if you need an example program not listed above 33 7 Revision History Version 1 0 September 6 1996 e The initial release of WSCAC Version 2 0 January 25 1997 e Includes Win32 libraries Microsoft Borland Watcom e Added XMODEM amp YMODEM DLL XYDRIVER DLL e Added TERM example program Version 2 1 June 2 1997 e Added ANSI terminal emulator support e Added expires option to SioInfo Evaluation version ONLY e Added
30. ied event occurs or the timeout period expires e SioEventChar blocks until the specified character is received or the timeout period expires See the VC Event cpp Event c EventChar c and EventWait c example programs 2 10 Virtual Serial Ports A virtual serial port is COM port that appears to be a real RS232 serial port to the Windows API and thus to WSC but is in reality a COM port emulator Common examples of virtual COM ports are Bluetooth serial ports and USB serial converter ports More information about virtual serial ports can be found in WSC User s Manual WSC_USR Section 2 13 http www marshallsoft com wsc usr pdf 10 2 11 Explicitly Loading the WSC DLL When an application program runs that makes calls to WSC32 DLL or WSC64 the Windows operating system will locate WSC32 DLL or WSC64 DLL by searching the directories as specified by the Windows search path If the WSC DLL WSC64 DLL or WSC32 DLL is placed in the WINDOWS directory or WINNT for Windows NT 2000 it will always be found by Windows However WSC32 DLL or WSC64 DLL can also be loaded from a specified directory by using the GetProcAddress Win32 or Win64 API function For an example refer to the LoadLib c program 2 12 Targeting a 64 Bit CPU If a compiler generates 32 bit application code and is running on a 64 bit version of Windows then compiling and linking is the same as it were on a 32 bit Windows system The 32 bit application code
31. io Microsoft Foundation Class MFC Borland C Builder BCB Microsoft Visual C NET and Visual C C sharp examples are included The Windows Serial Communications Library for C C WSC4C supports and has been tested with C C Microsoft Visual C Visual Studio NET Framework Visual C Express Visual C Borland C C Borland Turbo C for Windows Borland C Builder Watcom C C MinGW C Digital Mars C and LCC C compilers WSC4C can also be used with most other C C Windows compilers The Windows Standard Communications Library SDK includes Win64 and Win32 DLLs WSC64 DLL and WSC32 DLL The DLLs can also be used from any language Visual Basic VB NET ACCESS EXCEL VBA Borland Delphi Visual FoxPro COBOL Xbase Visual dBase etc capable of calling the Windows API WSCAC runs under all versions of Windows through Windows 10 Evaluation versions may be downloaded from our web site at http www marshallsoft com serial communication library htm Our goal is to provide a robust serial communication component library that you and your customers can depend upon A fully functional evaluation version is available Contact us if you have any questions When comparing the Windows Standard Serial Comm Library against our competition note that 1 WSC4C is a standard Windows DLL NOT an OCX or ActiveX control and is much smaller than a comparable OCX or ActiveX control 2 Win64 and Win32 are included 3 WSCAC doe
32. io 2010 64 bit unzip vs2010 64bit Visual Studio 2012 32 bit unzip vs2012 32bit Visual Studio 2012 64 bit unzip vs2012 64bit Visual Studio 2003 2005 32 bit vc xmr vcproj Visual Studio 2008 32 bit unzip vs2008 32bit Visual Studio 2008 64 bit unzip vs2008 64bit Visual Studio 2010 32 bit unzip vs2010 32bit Visual Studio 2010 64 bit unzip vs2010 64bit Visual Studio 2012 32 bit unzip vs2012 32bit Visual Studio 2012 64 bit unzip vs2012 64bit Visual Studio 2013 32 bit unzip vs2012 32bit Visual Studio 2013 64 bit unzip vs2013 64bit Visual Studio 2015 32 bit unzip vs2015 32bit Visual Studio 2015 64 bit unzip vs2015 64bit 5 17 YMS and YMR Vcproj Vcproj VCXproj VCXproj VCXproj VCXproj Vcproj Vcproj VCXproj VCXproj VcXproj VCXproj VCXproj VCXproj Vcxproj VCXproj YMS YMODEM Send and YMR YMODEM Receive are console mode programs that send and receive files using the YMODEM protocol Makefiles amp project files are Microsoft 4 0 6 0 32 bit YMS32 m makefile unzi Microsoft 4 0 6 0 32 bit YMS mak project file Microsoft 6 0 32 bit YMS dsp project file Borland 5 0 32 bit YMS32 b makefile unzi Borland 5 5 32 bit YMS32 i makefile unzi Watcom 11 0 32 bit YMS32 w makefile unzi Microsoft 4 0 6 0 32 bit YMR32 m makefile unzi Microsoft 4 0 6 0 32 bit YMR mak project file Microsoft 6 0 32 bit YMR dsp project file Borland 5 0 32 b
33. it YMR32 b makefile unzi Borland DD 32 bit YMR32 i makefile unzi Watcom 11 0 32 bit YMR32 w _ makefile unzi p p p p p p p p microsoft60 zip Makefiles Borland50 zip Makefiles Borland55 zip Makefiles Watcom11 zip microsoft60 zip Makefiles Borland50 zip Makefiles Borland55 zip Makefiles Watcom11 zip 31 5 18 MFC_PGM MFC_PGM is a Microsoft Foundation Class C GUI mode program similar to SIMPLE The file NAFXCW LIB may have to be copied from MFC LIB on your Microsoft Visual C C CD disProject files are Microsoft C 32 bit mfcpgm32 mak project file 5 19 CS_AT OK The CS AT OK example Visual Cft program transmits the 3 byte character string AT n on COMI at 19200 baud After sleeping a short period of time the port is read for any response This example program demonstrates how to send and receive using SioPutc and SioGetc from a Visual C application program Recall that if AT n is sent to a modem where word response codes are enabled the string OK without the quotes will be returned by the modem Note that the program must be compiled using the unsafe Visual C keyword Also refer to Section 3 2 Microsoft Visual C above The Project file is Visual Studio C 2003 2005 2008 2010 2012 2013 2015 32 bit cs at ok csproj 520 CS AT OK 2 The CS AT OK example C program is similar to CS AT OK except that it uses the SioByteToShort and SioS
34. kefiles amp project files are Microsoft 4 0 6 0 32 bit Host32 m makefile unzip microsoft60 zip Microsoft 4 0 6 0 32 bit Host mak project file Microsoft 6 0 32 bit Host dsp project file Borland 5 0 32 bit Host32 b makefile unzip Makefiles Borland50 zip Borland 545 32 bit Host32 i makefile unzip Makefiles Borland55 zip Watcom 11 0 32 bit Host32 w makefile unzip Makefiles Watcomll zip 29 5 13 LISTER The LISTER program lists all serial ports LISTER takes no arguments Makefiles amp project files are Microsoft 4 0 6 0 32 bit lister32 m_makefile unzip microsoft60 zip Microsoft 4 0 6 0 32 bit lister mak project file Microsoft 6 0 32 bit lister dsp project file Borland 5 0 32 bit lister 32 b makefile unzip Makefiles Borland50 zip Borland 53 5 32 bit lister 32 i makefile unzip Makefiles Borland55 zip Watcom 1d 32 bit lister32 w makefile unzip Makefiles Watcom11 zip LCC WIN32 32 bit lister Slcc bat cmd file unzip Makefiles LCC zip MinGW GCC 32 bit lister gcc bat cmd file unzip Makefiles GCC zip Borland C Bld 32 bit lister prj bpr project file VC_LISTER is the Visual Studio C NET version of LISTER Visual Studio 2003 2005 32 bit vc_lister vcproj Visual Studio 2008 32 bit unzip vs2008 32bit vcproj Visual Studio 2008 64 bit unzip vs2008 64bit vcproj Visual Studio 2010 32 bit unzip vs2010 32bi
35. l Studio 2013 64 bit unzip vs2013 64bit vcxproj Visual Studio 2015 32 bit unzip vs2015 32bit vcxproj Visual Studio 2015 64 bit unzip vs2015 64bit vcxproj 30 5 16 XMS and XMR XMS XMODEM Send and XMR XMODEM Receive are console mode programs that send and receive files using the XMODEM protocol Makefiles amp project files are Microsoft 4 0 6 0 32 bit XMS32 m makefile unzi Microsoft 4 0 6 0 32 bit XMS mak project file Microsoft 6 0 32 bit XMS dsp project file Borland 5 0 32 bit XMS32 _b_ makefile unzi Borland 5 5 32 bit XMS32 i makefile unzi Watcom 11 0 32 bit XMS32 w makefile unzi Microsoft 4 0 6 0 32 bit XMR32 m makefile unzi Microsoft 4 0 6 0 32 bit XMR mak project file Microsoft 6 0 32 bit XMR dsp project file Borland 5 0 32 bit XMR32 _b makefile unzi Borland 5 5 32 bit XMR32 i makefile unzi Watcom 11 0 32 bit XMR32 w makefile unzi p p p p p p p p microsoft60 zip Makefiles Borland50 zip Makefiles Borland55 zip Makefiles Watcom11 zip microsoft60 zip Makefiles Borland50 zip Makefiles Borland55 zip Makefiles Watcom11 zip VC_XMS and VC_XMR CPP are the Visual Studio C NET versions of XMS and XMR Visual Studio 2003 2005 32 bit vc xms vcproj Visual Studio 2008 32 bit unzip vs2008 32bit Visual Studio 2008 64 bit unzip vs2008 64bit Visual Studio 2010 32 bit unzip vs2010 32bit Visual Stud
36. mpilers 4 2 1 Compiling Using Visual C VC v4 0 v5 0 and v6 0 Microsoft Visual C v4 0 v5 0 v6 0 compiles only 32 bit programs Programs can be compiled with Microsoft Visual C using either Developer Studio Microsoft Visual Studio or the command line compiler Project makefiles files ending in MAK are provided for Developer Studio Visual Studio Command line makefiles files ending in M are provided for use with the command line compiler e g NMAKE f SIMPLE LIB 32 M 4 2 2 Compiling Using 16 bit Visual C VC v1 52 Support for Winl6 was dropped beginning with version 5 2 Version 5 1 is still available free when purchasing the current version for those wanting Win16 support 4 2 3 Compiling Using Microsoft Visual Studio C Net Microsoft Visual C NET compiles only 32 bit programs Programs can be compiled with Microsoft Visual C NET using either Visual Studio NET or the command line compiler Project files files ending in VCPROJ are provided for Visual Studio eg VC SIMPLE VCPROJ Command line makefiles files ending in M are provided for use with the VC NET command line compiler e g NMAKE f SIMPLE LIB 32 M 4 2 4 Compiling Using Borland C C 5 0 Borland C C 5 0 can compile 32 bit programs Programs can be compiled with Borland C C using either the Borland IDE or the command line compiler Several Project files files ending in IDE are provid
37. ormat A selection of C C example programs with full source code is included Refer to Section 6 for more details on each of the example programs PROGRAM BCB CALLBACK CONSOLE CS AT OK CS VERS DEVICE DIAL ECHOPORT EVENT DESCRIPTION Borland C Builder 32 bit C example Demonstrates how to implement a WSC callback function A Win32 console mode program similar to SIMPLE C program that transmits AT and expects OK back C program that displays the WSC version number Program to communicate with serial device Dials up host or BBS Multi threaded console mode program echoes all input Blocking version of SIMPLE that uses SioEvent Blocking version of SIMPLE that uses SioEventChar Blocking version of SIMPLE that uses SioEventWait Finds a modem connected to one of your serial ports Example program which uses the C fSio class Simple one line host program Lists all serial ports Loads WSC32 DLL WSC64 DLL dynamically Microsoft Foundation Class MFC C example program RS485 version of CONSOLE Performs COM port functionality testing A simple terminal emulator Terminal emulator with XMODEM YMODEM and ANSI support Visual Studio version of the console c program Visual Studio version of the device c program Visual Studio version of the even
38. rograms 18 4 Compiling Programs 4 1 Compiling WSC Source Code This section applies only to those who have purchased ANSII C source code for the WSC DLLs WSC32 DLL and WSC64 DLL have been compiled using Microsoft Visual C C and are callable from applications written using Microsoft Borland or Watcom compilers If you recompile WSC32 C using Borland or Watcom compilers then the resulting DLL can only be used by applications compiled with the same compiler unless the stdcall and _declspec keywords are specified Microsoft Visual C is also used to create WSC32 0BJ and WSC64 OBJ for static linking For Microsoft C type NMAKRI NMAKRI f WSC32 M f WSC64 M For Borland C type MAKE f WSC32 B_ For Watcom C type WMAKE f WSC32 W Alternatively WSC32 C can be included in a project along with MSC VS C and MSC STR C like any other C file Before compiling define the symbol STATIC LIBRARY WSC64 DLL has been compiled using Microsoft Visual Studio 2008 and is callable from 64 bit applications programs 19 4 2 Compiling Example Programs The example programs can be compiled by using either the command line compiler or the compiler integrated development environment IDE Most compiler vendors provide both IDE and command line tools although some compilers are command line only Borland C C 5 5 and LCC WIN32 or IDE only Borland C C Builder Refer also to Section 3 0 Supported Co
39. rosoft Visual C all versions including Visual Studio NET and Visual Studio C Borland C C Borland C Builder Turbo C C for Windows and Watcom C C The SETUP installation program will copy the Lib s and DLL to the Windows directory Refer to Section 1 4 Installation After SETUP is run the WSC4C files are copied to the directory specified default WSCAC Three sub directories are created as follows DOCS All documentation files APPS All example cod DLLS All DLLs 2 2 Keycode License Key The WSC DLLs each has a keycode encoded within them The keycode is a 9 or 10 digit decimal number unless it is 0 and will be found in the file KEYCODE H The keycode for the evaluation version is 0 The developer will receive a new keycode and a new set of WSC DLL s after purchasing a license The KEYCODE is passed to SioKeyCode If an error message value 74 is returned when calling SioKeyCode it means that the keycode in the WSC application does not match the keycode in the DLL After purchasing a license it is best to remove the evaluation versions of the WSC64 DLL and WSC32 DLL from the Windows search path or delete them before installing the purchased version 2 3 Console Mode WSCAC functions can be called from Win32 Win64 console mode programs as well as GUI Graphical User Interface programs A console mode program is a Windows Win32 Win64 command line program running in a command window Although console mod
40. s NOT depend on ActiveX or Microsoft Foundation Class MFC libraries or similar support libraries 4 The WIN32 WSC64 versions of WSC are fully threadable 5 The WSC functions can be called from applications not capable of using controls MarshallSoft also has versions of the Windows Standard Serial Communications Library for Visual Basic WSC4VB Delphi WSCAD PowerB ASIC WSCAPB Visual FoxPro WSCAFP Visual dBASE WSC4DB and Xbase WSC4XB All versions of WSC use the same DLLs WSC64 DLL and WSC32 DLL However the examples provided for each version are written for the specified computer programming language The latest versions of the Windows Standard Serial Communications Library WSC can be downloaded from our web site at http www marshallsoft com serial communication library htm 1 1 Features Some of the many features of the Windows Serial Communications Library are Comes with 64 bit and 32 bit DLLs Supports RS232 and multidrop RS422 amp RS485 ports Can control any serial device connected to a serial port Can be used from GUI mode or console mode programs Can control up to 256 ports simultaneously Can be used with virtual serial ports using Bluetooth serial or a USB to serial converter Includes 46 functions plus modem control Comes with ANSI emulation and ASCH XMODEM and YMODEM protocols Supports hardware and software flow control Supports for any baud rate 32 bit amp 64 bit versions
41. s must be compiled from the Turbo C C integrated environment Follow the same directions as above Borland IDE except that the Target Model can be any listed 16 3 6 Borland C Builder Borland C Builder does not have command line tools so all programs must be compiled from the Borland C Builder integrated environment To load the SIMPLE_PRJ example project Choose File Open Project on the menu bar Load SIMPLE _PRJ BPR Then choose Build All from Project to create the executable Note that WSC32BCB LIB is the LIB file used with Borland C Builder WSC32BCB LIB can be created from WSC32 DLL by using the Borland IMPLIB program IMPLIB WSC32BCB LIB WSC32 DLL 3 7 Watcom C C Watcom C C programs can be compiled from either the command line or from within the Watcom development environment Watcom v10 5 and v10 6 do not recognize the declspec keyword 3 7 1 Watcom Command Line Makefiles Win32 programs can be compiled using command line makefiles All Watcom command line makefiles end with 32 w_ for Win32 makefiles To compile using a makefile use the Watcom WMAKE utility For example WMAKE f SIMPLE LIB 32 W_ Win32 programs can also be compiled using command line batch files See SIMPLES BAT for an example of a console mode command line batch file and SIMPLES BAT for an example of a GUI mode command line batch file To run these command line batch files from the command line type SIMPL
42. t vcxproj Visual Studio 2010 64 bit unzip vs2010 64bit vcxproj Visual Studio 2012 32 bit unzip vs2012 32bit vcxproj Visual Studio 2012 64 bit unzip vs2012 64bit vcxproj Visual Studio 2013 32 bit unzip vs2012 32bit vcxproj Visual Studio 2013 64 bit unzip vs2013 64bit vcxproj Visual Studio 2015 32 bit unzip vs2015 32bit vcxproj Visual Studio 2015 64 bit unzip vs2015 64bit vcxproj 5 22 ProXR The ProXR console mode example program demonstrates how to control the ProXR relays boards manufactured by ControlAnything com Makefiles amp project files are Microsoft 4 0 6 0 32 bit ProXR m makefile unzip microsoft60 zip Microsoft 4 0 6 0 32 bit ProXR mak project file Microsoft 6 0 32 bit ProXR dsp project file Borland 5 0 32 bit ProXR b makefile unzip Makefiles Borland50 zip Borland 5 5 32 bit ProXR i makefile unzip Makefiles Borland55 zip VC ProXR is the Visual Studio C NET version of ProXR Visual Studio 2003 2005 32 bit vo ProXR vcproj Visual Studio 2008 32 bit unzip vs2008 32bit vcproj Visual Studio 2008 64 bit unzip vs2008 64bit vcproj Visual Studio 2010 32 bit unzip vs2010 32bit vcxproj Visual Studio 2010 64 bit unzip vs2010 64bit vocxproj Visual Studio 2012 32 bit unzip vs2012 32bit vcxproj Visual Studio 2012 64 bit unzip vs2012 64bit vcxproj Visual Studio 2013 32 bit unzip vs2012 32bit vcxproj Visua
43. t c program Visual Studio version of the finder c program he lister c program Visual Studio version of the simple c terminal Visual Studio version of the wscver c version program Program that displays the WSC version number Console mode XMODEM programs Console mode YMODEM programs CE ot ah ct cb ct ct S S S Visual Studio version of S S 1 2 Documentation Set The complete set of documentation consists of four manuals This is the first manual WSC_4C in the set e WSC 4C Programmer s Manual WSC 4C PDF e WSC User s Manual WSC USR PDF e WSC Reference Manual WSC REF PDF e SERIAL Users Manual SERIAL PDF The WSC_4C Programmer s Manual is the language specific C C manual and provides information needed to install and compile example programs in a C C environment Read this manual first The WSC User s Manual WSC_USR discusses language independent serial communications programming issues including modem control Purchasing and license information is also provided The WSC Reference Manual WSC REF contains details on each individual WSC function The Serial Communications Manual SERIAL contains background information on serial port hardware All manuals can be viewed online at http www marshallsoft com wsc4c htm 1 3 Example Program The following example demonstrates some of the Windows Serial Communications library functions include lt windows h gt
44. t files are Microsoft 4 0 6 0 32 bit Event32 m makefile unzip microsoft60 zip Microsoft 4 0 6 0 32 bit Event mak project file Microsoft 6 0 32 bit Event dsp project file Borland 5 0 32 bit Event32 b makefile unzip Makefiles Borland50 zip Borland 245 32 bit Event32 i makefile unzip Makefiles Borland55 zip Watcom 11 0 32 bit Event32 w_ makefile unzip Makefiles Watcoml1l zip LCC WIN32 32 bit EventSlcc bat makefile unzip Makefiles LCC zip MinGW C 32 bit Event gcc bat makefile unzip Makefiles GCC zip Microsoft 4 0 6 0 32 bit EventC m_ makefile unzip microsoft60 zip Microsoft 4 0 6 0 32 bit EventC mak project file Microsoft 6 0 32 bit EventC dsp project file Borland 5 0 32 bit EventC b makefile unzip Makefiles Borland50 zip Borland 55 32 bit EventC _i_ makefile unzip Makefiles Borland55 zip Watcom TIS 32 bit EventC w_ makefile unzip Makefiles Watcomll zip Microsoft 4 0 6 0 32 bit EventW m makefile unzip microsoft60 zip Microsoft 4 0 6 0 32 bit EventW mak project file Microsoft 6 0 32 bit EventW dsp project file Borland 5 0 32 bit EventW b_ makefile unzip Makefiles Borland50 zip Borland 579 32 bit EventW i makefile unzip Makefiles Borland55 zip Watcom dd 32 bit EventW w makefile unzip Makefiles Watcoml11 zip VC_EVENT is the Visual Studio C NET version of EVENT Visual Studio 2003 2
45. ts zero unused bits DataBits 5 6 7 e Corrected problem with SioBaud 1 BaudRateCode e SioDebug returns 1 if no match e Added SioDebug W toggle SioPuts wait for I O completion e Added code to detect active threads amp to close thread handles e Added USE THREADS so can compile version of WSC32 C without threads e Comm handle not saved in SioReset unless it is good e SioEvent returns mask that caused the event e Added SioInfo B to get build number Version 3 3 October 28 2003 e Can now order either with or without source code to the DLLs e Added SioSetInteger function to set port specific integer parameters e Added SioKeyCode function to pass the key code to the DLL e Added SioGetReg function to return the registration string e Added Burst Size parameter for setting the TX burst size e Added ability to signal blocked thread which was blocked by SioEvent Version 4 0 November 12 2003 e Added support for Microsoft VC Net Version 4 1 August 12 2004 e Fixed problem with SioTxClear e Added overlapped I O for non Win95 so can signal threads to exit w o killing them e Increased default burst size to 256 e SioFlow returns WSC RANGE if cannot recognize parameter e Added support for Microsoft C e Adjusted XModem YModem timing for faster transfers Version 4 2 February 1 2006 e SioFlow returns 1 if OK e SioSetInteger Port S 1 always forces SioEvent to unblock e Event m
46. ual Stud Visual Stud Visual Stud Visual Stud Visual Stud Visual Stud Visual Stud Visual Stud Visual Stud Visual Stud 5 4 RS485 The RS485 example console mode program operates like SIMPLE except that it assumes an RS485 port io io io io io io io io io io io 2003 2005 32 bit 2008 32 bit f unzi 2008 64 bit unzi 2010 32 bit unzi 2010 64 bit unzi 2012 32 bit z unzt 2012 64 bit unzi 2013 32 bit i unzi 2013 64 bit unzi 2015 32 bit unzi 2015 64 bit unzi p p p p p p p p p p vc console vcproj vs2008 32bit vcproj vs2008 64bit vcproj vs2010 32bit vcxproj vs2010 64bit vcxproj vs2012 32bit vcxproj vs2012 64bit vcxproj vs2012 32bit vcxproj vs2013 64bit vcxproj vs2015 32bit vcxproj vs2015 64bit vcxproj RTS is set before transmitting data and cleared after the last bit of the last byte has been sent Makefiles amp project files are Microsoft Microsoft Microsoft Borland Borland Watcom i rPOOan St amp z 0 0 0 0 zo 0 6 0 6 0 32 bit 32 bit 32 bit 32 bit 32 bit 32 bit RS485 m RS485 mak RS485 dsp RS485 b_ RS485 i_ RS485 w_ makefile unzip microsoft60 zip project file project file makefile unzip Makefiles Borland50 zip makefile unzip Makefiles Borland55 zip makefile unzip Makefiles Watcoml11 zip 25 5 5 SE
47. utex code added to EventThread to prevent race conditions e Message box displays error if SioWinError Buffer 0 called e Major change in overlapped I O e Fixed problem SioEvent returning wrong code e SioRxClear clears byte saved by SioUnGet e Number of supported ports increased to a maximum of 256 e Added SioEventChar and SioEventWait functions Version 4 3 September 25 2007 e Fixed problem with SioTxQue returning wrong values e Changed SioParms so it checks the range of passed arguments e Portis verified in SioEventChar e SioStatus returns 1 if port is not functioning USB serial port disconnected e Added SioByteToShort and SioShortToByte WSC32 only e LoadLib c and Callback c example programs added 35 Version 4 4 January 19 2009 e Added SioSetTimeouts function sets TX and RX time outs Version 5 0 November 16 2009 e Added SioHexView function e Supports 64 bits WSC64 DLL e Added several Visual Studio examples Version 5 1 August 19 2011 e Added SioRxWait function e Added support for MinGW GCC compiler e Added support for Visual Studio 2010 C C compiler e Added LISTER C example program Version 5 2 July 2 2012 e Added function SioQuiet e Added function SioWaitFor e Added example program ProXR c e Win16 support dropped but available on request when ordering Version 5 3 November 4 2013 e Added SioLRC that computes the longitudinal redundancy ch
48. vs2010 64bit vcproj zip for VS2010 project files vs2012 64bit vcproj zip for VS2012 project files or vs2013 64bit vcproj zip for VS2013 project files VS2008 vc console vcproj vc device vcproj vc finder vcproj vc simple vcproj vc xmr vcproj vc xms vcproj VS2010 vc console vcxproj vc device vcxproj vc finder vcxproj vc simple vcxproj vc xmr vcxproj vc xms vcxproj VS2012 vc console vcxproj vc device vcxproj amp 2013 vc finder vcxproj vc simple vcxproj vc xmr vcxproj vc xms vcxproj vc event vcproj vc version vcproj vc lister vcproj vc event vcxproj vc version vcxproj vc lister vcxproj vc event vcxproj vc version vcxproj vc lister vcxproj However if a compiler generates 32 bit code the application must be linked with WSC32 LIB even though it may be running on a 64 bit machine 12 3 0 Supported Compilers The Windows Standard Serial Comm Library WSC4C has been tested and works with all versions of the following compilers Microsoft Visual C Visual C Net through Visual Studio 2015 Visual C Borland C C Borland C Builder Borland Turbo C C Watcom C C MinGW C LCC Digital Mars Other Windows C C compilers may work as well Refer also to Section 4 0 Compiling Example Programs 3 1 Microsoft Visual C all versions Microsoft Visual C programs can be compiled from either the command line or from within the Microsoft Visual Studio development environment 3 1 1 Microsoft Comman

Download Pdf Manuals

image

Related Search

Related Contents

  電波時計(メロディ報時付掛時計) 取扱説明書 アフターサービスについて  Valueline VLTP90200W20 telephony cable  バッシュ(EX13 Ver.)  Alcatel T22  

Copyright © All rights reserved.
Failed to retrieve file