VSPD XP Manual

Tech support: toll-free # +1-888-4ELTIMA [CET], support@eltima.com


VSPD XP Manual: Overview

Overview

Virtual Serial Ports Driver XP is an advanced configuration utility, which purpose is to emulate RS232 serial ports connected via virtual null-modem cable using Virtual Serial Ports Driver, which can be easily included in your own software providing simple and robust way to create and configure virtual serial ports directly from your application (if you purchase OEM version only). In other words, with VSPD XP you can create any number of pure virtual serial ports in your system connected into pairs via virtual null-modem cable without having real serial ports occupied.
Virtual Serial Ports appear to operating system or any Windows application as "standard" hardware serial ports. Virtual serial ports created by VSPD XP work exactly the same as real ports in your system managing all signal lines and emulating baud rate.

For instance, using Virtual Serial Ports Driver you can create two virtual serial ports: COM5 and COM6 and connect two different applications to them. Everything that the first application sends to COM5 will be received by the second application at COM6, and all data sent to COM6 by the second application will be received by the first one at COM5.

Features:
  • "Hot" installation - no reboot required after installation, creation or reconfiguration of virtual serial ports
  • You can create as many virtual serial ports pairs as you want
  • Full baud rate emulation (for Windows NT4/2000/XP/2003) NEW!
  • You can control virtual serial ports directly from your own application using Dynamic Link Library supplied with VSPD XP
  • Virtual Serial Ports are absolutely the same copies of real ones - other applications will never see the difference between real serial port and virtual serial port. You can manage different signal lines (DTR/DSR/CTS/RTS/DCD/RI) etc. NEW!
  • Full support of HandFlow control (Hardware/(Xon/Xoff)) etc
  • Real serial ports are not occupied (actually, you can even have no real serial ports in your system and work with virtual ones)
  • Link between virtual serial ports is much faster than real null-modem cable connection and solely depends on your processor speed. Average transfer speed is about 35-40 Kbytes/sec
  • VSPD XP uses advanced Windows kernel driver technology (supporting WDM, WMI, Power Management, PnP, etc.)
  • Virtual link is much more reliable than common physical link
  • Virtual Serial Port may have any name you like
  • Virtual Serial Port can have the same name as real serial port (virtual serial port overlapping). Application may connect to real port through virtual one and vise versa. This may result in may additional ways of VSPD XP utilization
  • Printers can be assigned to any Virtual Serial Port (available after Windows reboot) NEW!
  • Set custom signal lines wiring (custom pinout) (for Windows NT4/2000/XP/2003) NEW!
  • Set/unset line connection break (for Windows NT4/2000/XP/2003) NEW!
  • Get complete information about current virtual serial port state (current state, sent/received bytes, Baudrate/ControlLine/HandFlow state etc.)(for Windows NT4/2000/XP/2003) NEW!
  • User friendly GUI and on-the-fly help. It is very easy to configure virtual serial ports pair!
  • Automatic port creating during system boot (prior to user login) NEW!
Supported platforms:
  • Microsoft Windows 98 SE
  • Microsoft Windows ME
  • Microsoft Windows NT4
  • Microsoft Windows 2000
  • Microsoft Windows XP
  • Microsoft Windows 2003


VSPD XP Manual Overview

Installation

Virtual Serial Ports Driver XP installation process is quite straightforward. All you need to do is accomplish a few simple steps:

  • Download the latest version of Virtual Serial Ports Driver XP at:
    http://www.eltima.com/download/vspdxp
  • Double click it using any file manager or Windows Explorer in order to start installation process.
  • Follow the prompts given, study the License Agreement carefully, select the destination path, choose shortcuts you wish to be created and finish the installation.
  • Finally you will need to navigate either to the Start Menu and locate the launcher in Programs submenu or double-click the shortcut created on the desktop, if you chose this option, and Virtual Serial Ports Driver XP will be launched.


VSPD XP Manual Usage Scenario

Usage Scenario

Why do I need VSPD XP?
There is an endless variety or reasons why you may need additional virtual serial ports created in your system. GPS data replication, serial port data capture, serial port data reproduction, telecommunication and data transmission system, system debugging etc among them. On the other hand you might need to establish serial port connection to computer or device that has serial port that cannot be connected with null-modem cable directly due to remote location. In this case you may create application that uses Virtual Serial Port Driver to communicate with remote serial port by TCP/IP stack.

You may use Virtual Serial Ports for:
  • Testing/debugging different applications that use null-modem cable such as:
    • any existing terminal application

    • your own application that uses serial port.
      For instance: you write your own program that connects to modem and sends AT commands. In this case you may emulate connection by creating virtual serial port and send/receive commands to it. Debugging on the real device is quite cumbersome, slow and which is more important - it doesn't support multiple-threading.

    • you may want to create your own data sniffer application that works with serial port. In order to test or debug it you may create virtual serial port pair.

  • Testing/debugging different serial port device emulators such as modems, fax, GPS etc
  • Testing/debugging firmware or device drivers. You may even don't have this hardware in order to develop the driver for it.

  • Testing/debugging two applications that have different address space and have no direct way to contact each other.

  • Testing/debugging application for interception caching/proxying (as well as translation, logging) data sent over network

Usually you need second computer or expansion card to be able to perform such tests, however using VSPD XP you may do it on single computer using virtual port pair.


VSPD XP Manual: Purchase

OEM license: If you obtained this license agreement with the Software product, you are entitled to use it as a part of the Hard and Software packages according to this license agreement.

Source code license: This license grants the rights to: reproduce and distribute the Capsule;
display, perform, use, and compile the Source Code and execute the resultant binary Software on a computer;
prepare a Derived Product solely by compiling Additional Code, if any, together with the code resulting from operating a Patch on the Source Code;
execute on a computer and distribute to others Derived Products.

Purchase Information

Single License
Order via ShareIt!
order EUR USD
€ 89.95
$ 99.95
Order via Regnow
order EUR USD
€ 89.95
$ 99.95

2 to 5 licenses
Order via ShareIt!
order EUR USD
€ 79.95
$ 89.95
Order via Regnow
order EUR USD
€ 79.95
$ 89.95

6 to 10 licenses
Order via ShareIt!
order EUR USD
€ 69.95
$ 79.95
Order via Regnow
order EUR USD
€ 69.95
$ 79.95

11 to 20 licenses
Order via ShareIt!
order EUR USD
€ 59.95
$ 69.95
Order via Regnow
order EUR USD
€ 59.95
$ 69.95

21 and more
Order via ShareIt!
order EUR USD
€ 49.95
$ 59.95
Order via Regnow
order EUR USD
€ 49.95
$ 59.95

VSPD Bundle (30% discount)
Order via ShareIt!
order EUR USD
€ 174.95
$ 199.95

OEM license
Order via ShareIt!
order EUR USD
€ 1950.00
$ 2350.00

Source code license

Mail us

Single License:
! Please, note that prices in USD are based on EUR-to-USD conversion rate. Prices in USD are recalculated during the order process by the billing operator (ShareIt or RegNow) according to the currency rate at the date of your purchase.
! Please, note that prices in USD are based on EUR-to-USD conversion rate. Prices in USD are recalculated during the order process by the billing operator (ShareIt or RegNow) according to the currency rate at the date of your purchase.

For orders processing we are using ShareIt! and RegNow companies services - world's leading e-commerce providers for software and shareware sales via the Internet.

If you purchase our products via ShareIt! you will receive an automatically generated email from ShareIt! with a license code and registration details within several minutes. In case you place your order using RegNow it may take up to 6-12 hours to deliver your registration info.

share*it!
USA

ShareIt! Inc.
9625 West 76th Street, Suite 150
Eden Prairie, MN 55344, USA

Phone: +1 (952) 646-5747
Fax: +1 (952) 646-4552
E-mail: info@shareit.com
 Germany

Share-it!
Vogelsanger Str. 78
50823 Cologne, Germany

Phone: +49 (0)221 31088-20
Fax: +49 (0)221 31088-29
E-mail: info@shareit.de

regnow
USA

RegNow/Digital River

9625 West 76th Street
Eden Prairie, MN 55344
 Phone (US only): +1 (877) 353 7297
Phone: +1 (952) 646 5331

Fax: +1 (800) 442 3172

VeriSign, Inc. Security Guarantee. Online order placement page has been secured with a digital certificate by VeriSign, Inc. This is shown via the "site certificate" that sits on all secure pages. To view this certificate, click on the VeriSign logo at the bottom of the page or the solid key on the docs_bottom bar of your browser window. A small frame displaying site security information will appear.

Lifetime technical support is available 24 hours a day, 7 days a week, 365 days a year via email, phone or fax. If you have any problems using our products, please send us your detailed comments, suggestions, questions. We value every customer and will reply to you as soon as possible. If you are a registered user, you can use the technical support via email or fax. Our registered users can also submit support requests by e-mail for priority support customers.

Upgrade Policy. All program upgrades within one major version (that you purchase) are free to you as a registered user. As a registered customer, you can purchase all our other similar software at a discounted price. For more detailed information about our upgrade policy, please email to support@eltima.com

Money back guarantee. To insure that you are receiving quality service and ordered products work as they were announced to, Eltima offers an honor-based 14 days money-back-guarantee when you purchase any of our products. Honor-based means we will be glad to return your investment when we are sure the product is malfunctioning on client's PC and we receive assistance in finding out the reason on the side of our customers.

Flash Web programming


VSPD XP Manual: What's new?

What's new?

Virtual Serial Ports Driver XP 5.1
[Build 5.1.3.41]
Released: 8th of September, 2005

  • Virtual Serial Ports Driver works now under 64-bit Windows versions

Virtual Serial Ports Driver XP 5.0
[Build 5.0.3.31]
Released: 20th of July, 2005

  • Added ability to select Virtual Serial Port created by configuration manager in "Add a printer" wizard (after Windows reboot)

Virtual Serial Ports Driver XP 5.0
[Build 5.0.2.25]
Released: 5th of July, 2005

  • Security bug is fixed

Virtual Serial Ports Driver XP 5.0
[Build 5.0.2.21]
Released: 8th of June, 2005

  • Improved User Manual
  • Syntax errors in Configuration Utility were corrected
  • Minor interface enhancements (new icons)

Virtual Serial Ports Driver XP 5.0
[Build 5.0.2.20]
Released: 7th of June, 2005

  • Hardware pinout/wiring customization
  • Strict baudrate emulation for Windows NT
  • Line break emulation
  • Major interface changes (detailed information about virtual serial pair, custom pinout)
  • Get complete information about virtual serial port directly from driver(current state, sent/received bytes Baudrate/ControlLine/Handflaw state etc.)
  • Serial port overlapping (you may create virtual port with existing real name (COM1, COM2 etc) and operate it)
  • Virtual serial ports are created by driver at the Windows startup
  • Clients don't need to close all existing virtual serial ports to reconfigure them
  • Existing virtual port pairs are enumerated and graphically represented
  • Small enhancements and a few bugs are fixed

Virtual Serial Ports Driver XP 4.5

  • Strict baudrate emulation
  • Support for Windows XP SP2, Windows 2003 Server
  • Hyperthreading is supported
  • Interface is improved
  • Some bugs are fixed

Virtual Serial Ports Driver XP 4.0

  • VSPDXP and VSPD 9x are merged
  • Completely new and revised program interface
  • Windows XP SP1 support is added

Virtual Serial Ports Driver XP 3.0

  • Completely NEW kernel
  • Support of WDM, PnP, WMI technologies
  • Full compatibility of program interfaces with standard Windows "serial.sys"
  • Signal lines and flow control emulation
  • Multiple ports creation/manipulation
  • "Hot" installation and port creation is added
  • New improved interface

Virtual Serial Ports Driver XP 2.0

  • Windows NT support
  • Program interface improved
  • Few minor bugs are fixed

Virtual Serial Ports Driver 9x 2.0

  • Windows Me support
  • Program interface improved
  • Some bugs are fixed

Virtual Serial Ports Driver 9x 1.0

  • Windows 9x support
  • One virtual serial pair support
  • No signal lines emulation


VSPD XP Manual: Configuration Utility

Configuration Interface Usage

With configuration utility you can easily create, configure and remove virtual serial ports installed in your system. It outlines what you achieve using Virtual Serial Port Driver in you own application.

The Main Window

The Main window of the configuration utility provides easy and quick access to all function such as adding/deleting, enabling/disabling virtual pairs, setting full baudrate emulation, viewing extensive information as well as completely resetting the serial bus. Several items can be distinguished here:

  • Main menu
    • Ports
      • Add pair

        • Add virtual serial port pair. Next free serial port name will be assigned automatically
      • Delete pair

        • Delete virtual serial port pair chosen in System Explorer.
      • Delete pair

        • Delete virtual serial port pair chosen in System Explorer.
      • Reset bus

        • Delete all virtual serial pairs currently created at the system.
      • Exit

        • Close VSPD XP application.
    • Options
      • Enable strict baudrate by default
      • Confirm ports deleting
    • Help
      • User manual - show this manual
      • Homepage - open Eltima Software starting page
      • Enter registration code - register VSPD XP
      • About - get brief information about configuration utility

  • System Explorer

    • Tree view at the left side of the main window dynamically represents current system configuration, showing you not only virtual, but actual (physical) serial ports present in your system as well as other virtual serial ports created by other Eltima products. Each virtual serial ports pair is represented by the corresponding entry in this window

  • Control Panel

    • Control Panel consists of three tabs which are logically separated by their functionality:

    • Add/Remove ports

      • This tab provides functionality to add/remove virtual serial ports pairs, reset bus, enable/disable strict baudrate emulation and break line/restore connection.

    • Additional pair info

      • This tab provides additional information for selected virtual ports pair

    • Custom pinout

      • This is the last tab, it allows to choose from custom or preset pinout selection as well as save/delete user's own custom presets


VSPD XP Manual: VSPD Configuration Utility

Usage

Adding Virtual Serial Ports

To add Virtual Serial Pair do the following:

  • select "Add/Remove ports" tab in Control Panel area
  • choose the names of virtual serial ports from corresponding drop-down list (First port/Second port)
  • click "Add pair" button
  • repeat steps above as many times as many new pairs you need to create
Note: you will not be able to select port names if they are already present in your system.

Deleting Virtual Serial Ports

To delete Virtual Serial Pair do the following:

  • select Virtual Serial Pair in System Explorer by clicking it once
  • go to "Add/Remove ports" tab in Control Panel area
  • click "Delete pair" button
  • repeat steps above as many times as you need to remove existing pairs
    • Please, note that you may delete Virtual Serial pair only if both ports are free

Resetting Serial Bus

By resetting Serial Bus we mean removing all Virtual Serial pairs in one go. To perform this task select "Add/Remove ports" tab in Control Panel and click "Reset Bus" button.

Note: you will not be able to reset bus if any of the two ports in a pair is in use or there are Other Eltima ports present.

Enabling/Disabling full baudrate emulation

Starting with VSPD XP 4.5 you can enable full baudrate emulation per each pair of ports separately. To do this just add a pair of virtual ports (as described above), select the newly created pair in System Explorer and mark the checkbox "Enable strict baudrate emulation" below. This is it. Now you can set the baudrate in a standard way (SetCommConfig()) and it will not be ignored by the driver.

Note: this function is only available under Windows NT4/2000/XP/2003.

Breaking line/restoring connection

In order to programmatically break line without deleting Virtual Serial Port mark Break Line/Restore connection checkbox within "Add/Remove ports" tab.

Note: this function is only available under Windows NT4/2000/XP/2003.

Viewing additional information

To be able to view additional information such as sent/received bites, baudrate, data bits, stop bits, parity control etc. select Virtual Serial Pair in System Explorer and click "Additional pair info" tab in the Control Panel. Alternatively, you can select Virtual Serial Pair from drop-down menu at the "Additional pair info" tab.

Setting custom pinout

Starting with VSPD XP 5.0 you can choose which signal lines at one end should be connected to signal lines at the other end. In addition, you may save your custom settings as preset and use it later. In order to set custom pinout select "Custom pinout" tab in the Control Panel, select Virtual Serial Pair either at the System Explorer or from drop down menu at the "Custom pinout" tab, select one of the required signal lines (RTS, DTR, OUT1, OUT2) in "IN side of the pair" list for internal serial port and mark corresponding checkbox at the OUT side. Then click "Apply preset" button to finish.

Signal lines:

  • RTS (Request to Send) - This signal is asserted (logic '0', positive voltage) to prepare the DCE device for accepting transmitted data from the DTE device. Such preparation might include enabling the receive circuits, or setting up the channel direction in half-duplex applications. When the DCE is ready, it acknowledges by asserting Clear to Send.
  • DTR (DTE Ready) - This signal is asserted (logic '0', positive voltage) by the DTE device when it wishes to open a communications channel. If the DCE device is a modem, the assertion of DTE Ready prepares the modem to be connected to the telephone circuit, and, once connected, maintains the connection. When DTE Ready is deasserted (logic '1', negative voltage), the modem is switched to "on-hook" to terminate the connection.
  • OUT1 - signal is used only by specialized hardware (like the Hayes SmartModem internal board). The meaning of this bit is determined by the hardware using it. For example, if the computer has a Hayes SmartModem board then OUT1=1 resets the modem.
  • OUT2 - controls interrupt servicing for the UART: OUT2=0 blocks the interrupt generated by the UART. This allows the user to prevent UART interrupts from reaching the computer's priority interrupt controller, while still generating them within the UART.
  • CTS (Clear to Send) - This signal is asserted (logic '0', positive voltage) by the DCE device to inform the DTE device that transmission may begin. RTS and CTS are commonly used as handshaking signals to moderate the flow of data into the DCE device.
  • DSR (DCE Ready) - When originating from a modem, this signal is asserted (logic '0', positive voltage) when the following three conditions are all satisfied:
    1. The modem is connected to an active telephone line that is "off-hook"
    2. The modem is in data mode, not voice or dialing mode
    3. The modem has completed dialing or call setup functions and is generating an answer tone
  • DCD (Carrier Detect) - This signal is relevant when the DCE device is a modem. It is asserted (logic '0', positive voltage) by the modem when the telephone line is "off-hook", a connection has been established, and an answer tone is being received from the remote modem. The signal is deasserted when no answer tone is being received, or when the answer tone is of inadequate quality to meet the local modem's requirements (perhaps due to a noisy channel).
  • RI ( Ring Indicator) - his signal is relevant when the DCE device is a modem, and is asserted (logic '0', positive voltage) when a ringing signal is being received from the telephone line. The assertion time of this signal will approximately equal the duration of the ring signal, and it will be deasserted between rings or when no ringing is present.

DTE (Data Terminal Equipment) is a computer or terminal and has a male serial port connector attached.

DCE (Data Circuit-terminating Equipment) is a modem with female serial port attached.

At the image above default DB9 null-modem pinout is shown.


VSPD XP Manual: Controlling Virtual Serial Ports Directly

Controlling Virtual Serial Ports Directly

Starting from version 5.0, virtual serial ports can be controlled directly from your own application. You can do it using vspdctl.dll (for Windows 98/ME/NT4/2000/XP/2003).

What is VSPDCTL.DLL?

VSPDCTL.DLL is a dynamic-link library which allows you to control virtual serial ports directly from your own application. This lets you create and delete virtual serial ports on-the-fly without using included external configuration utility.

We have provided instructions and declarations for C/C++, Visual Basic 5.0 and higher, Delphi, and some pointers on getting it to work with other languages as well.

Important notice: if you want your virtual serial ports were correctly displayed in configuration, you have to manually insert port binary values and strict baudrate parameter at the following registry path:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\vsbus

For example, if you have COM port 1 and COM port 2 connected to each other and have strict baudrate enabled then you must insert the following value: 01 02 01. If the strict baudrate emulation is disabled between COM1 and COM2 then the value is: 01 02 00. In case you have several pairs then the values are sequenced: 01 02 01 03 04 00 05 06 01 and s on.


VSPD XP Manual: Functions

Functions

VSPDCTL.DLL gives you access to several functions. All of them return TRUE or FALSE depending on operation result. These functions are:

  • CreatePair
  • DeletePair
  • DeleteAll
  • SetStrictBaudrate
  • SetBreak
  • QueryBus
  • SetWiring


VSPD XP Manual: Functions

CreatePair

CreatePair creates a pair of virtual serial ports with given names. As input it takes two null-terminated strings determining what ports should be created. For example, "COM5" and "COM6"

BOOL CreatePair(
 | char* Port1, | // name of the virtual serial port
 | char* Port2 | // name of the virtual serial port
);

Parameters:

  • Port1
    A null-terminated string that defines the name of the first port in a pair
  • Port2
    A null-terminated string that defines the name of the second port in a pair

Return values:

CreatePair returns TRUE if Virtual Serial Pair was created successfully and FALSE otherwise


VSPD XP Manual: Functions

DeletePair

DeletePair deletes a pair of virtual serial ports with a given name. As input it takes name of any virtual serial port in a pair. For example, if you want to remove pair named "COM5"-"COM6", you can pass either "COM5" or "COM6" as argument to DeletePair function.

BOOL DeletePair(
char* Port, // name of the virtual serial port
);

Parameters:

  • Port
    A null-terminated string that defines one of the two port names in a pair you want to delete

Return values:

DeletePair returns TRUE if Virtual Serial Pair was successfully deleted and FALSE otherwise


VSPD XP Manual: Functions

DeleteAll

DeleteAll deletes all virtual serial ports currently present in a system. It takes no arguments at input.

BOOL DeleteAll(
void,
);

Parameters:

  • None

Return values:

DeleteAll returns TRUE if all Virtual Serial Pairs were successfully deleted and FALSE otherwise


VSPD XP Manual SetStrictBaudrate

SetStrictBaudrate

SetStrictBaudrate enables/disables full baud rate emulation, needs the name of one of the paired virtual ports and boolean parameter that defines if strict baudrate emulation should be set or not.

BOOL SetStrictBaudrate(
 | char* Port, | // name of the virtual serial port
 | bool SetStrictBaudrate | // enables/disables emulation
);

Parameters:

  • Port
    A null-terminated string that defines one of the two port names in a pair
  • SetStrictBaudrate
    A boolean variable should have TRUE value if you want to set strict baudrate emulation and FALSE if you want to remove one

Return values:

SetStrictBaudrate returns TRUE if strict baudrate emulation was successfully set and FALSE otherwise


VSPD XP Manual SetBreak

SetBreak

SetBreak enables/disables line break emulation in virtual serial ports.

BOOL SetBreak(
 | char* Port, | // name of the virtual serial port
 | bool bBreak | // enables/disables line break
);

Parameters:

  • Port
    A null-terminated string that defines one of the two port names in a pair
  • bBreak
    A boolean variable should have TRUE value if you want to break line connection and FALSE if you want to re-establish connection

Return values:

SetStrictBaudrate returns TRUE if strict baudrate emulation was successfully set and FALSE otherwise


VSPD XP Manual: QueryBus

QueryBus

QueryBus: QueryBus sends request to get complete information from bus.

BOOL QueryBus(
 | void* inBuffer, | // pointer to buffer
 | long sizeInBuffer, | // size of buffer
 | void* OutBuffer, | // pointer to buffer
 | long sizeOutBuffer, | // size of buffer
);

Parameters:

  • InBuffer
    A pointer to VSBUS_QUERY or VSBUS_QUERY_EX structures. If you want to get information about all current Virtual Serial Ports then use VSBUS_QUERY structure and if you want to get extended information about single Virtual Serial Pair then use VSBUS_QUERY_EX structure.
  • OutBuffer
    A pointer to either PORT_INFORMATION or PORT_INFORMATION_EX linear list. If you have used VSBUS_QUERY than you should get PORT_INFORMATION list and if you used VSBUS_QUERY_EX then you should get PORT_INFORMATION_EX.

Return values:

CreatePair returns TRUE if Virtual Serial Pair was created successfully and FALSE otherwise

Code example:

Get information about all Virtual serial ports

    void		*Buffer;
    long		sizeBuffer;

    Query.Size = sizeof (VSBUS_QUERY);
    Query.QueryType = QUERYTYPE_PORTS;
    Buffer = new char[sizeBuffer];

    while (!QueryBus(&Query, Query.Size, Buffer, sizeBuffer)) {

        if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
            {
                delete[] Buffer;
                return;

            }
            else
            {
                delete[] Buffer;
                sizeBuffer = sizeBuffer * 2;
                Buffer = new char[sizeBuffer];
            }
    }

    PPORT_INFORMATION	portInfo = (PPORT_INFORMATION)Buffer;

    while (portInfo->NextOffset != 0)
        {
            if (portInfo->NameOffset != 0)
             {
                CString portName((PWCHAR)((ULONG)portInfo + portInfo->NameOffset));
                printf ("%s\n", portName);
            }

            portInfo = (PPORT_INFORMATION)((ULONG)portInfo + portInfo->NextOffset);
        }
    delete[] Buffer;

Get information about single port

    void		*Buffer;
    int		iSize = 1024;
    VSBUS_QUERY_EX	Query;
    PPORT_INFORMATION_EX portInfo;

    Query.Size = sizeof (VSBUS_QUERY_EX);
    Query.QueryType = QUERYINFO_PAIR;
    mbstowcs (Query.PortName, "COM5", MAX_PORTNAME_LEN);

    Buffer = new char [iSize];

    while (!QueryBus(&Query, Query.Size, Buffer, iSize)) {
        {
            if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
            {
                delete[] Buffer;
                return;
            }
            else
            {
                iSize *= 2;
                delete[] Buffer;
               Buffer = new char [iSize];
            }
        }

    while (portInfo->NextOffset != 0)
    {
        if (portInfo->NameOffset != 0)
        {
            CString portName((PWCHAR)((ULONG)portInfo + portInfo->NameOffset));
            printf ("%s send - %d recv - %d\n", portName, portInfo->TxCount, portInfo->RxCount);
        }

        portInfo = (PPORT_INFORMATION_EX)((ULONG)portInfo + portInfo->NextOffset);
    }

    portInfo = (PPORT_INFORMATION_EX)Buffer;
    delete[] Buffer;


VSPD XP Manual SetWiring

SetWiring

  • SetWiring sets custom pinout wiring.

    • BOOL SetWiring(
 | char *Port, | // name of the port
 | void* Buffer, | // pointer to buffer
 | long sizeBuffer, | // size of buffer
);

    Parameters:

    • Port
      A null-terminated string that defines one of the two port names in a pair
    • Buffer
      A pointer to VSERIAL_WIRING structure

    Return values:

    CreatePair returns TRUE if Virtual Serial Pair was created successfully and FALSE otherwise

    Code examples:

    Set custom wiring

        VSERIAL_WIRING	wiring;
    CString	name;

    wiring.DTR = WIRED_TO_DSR | WIRED_TO_DCD;
    wiring.RTS = WIRED_TO_CTS;
    wiring.OUT1 = 0;
    wiring.OUT2 = 0;

    SetWiring("COM5", &wiring, sizeof(wiring));


VSPD XP Manual

VSBUS_QUERY

typedef struct _VSBUS_QUERY{
IN ULONG Size;
IN ULONG QueryType;
}VSBUS_QUERY, *PVSBUS_QUERY;

Members

  • Size

    • VSBUS_QUERY structure size

  • QueryType

    • Has QUERYTYPE_PORTS = 1 value. Could be extended in the future.

Tech support: Toll-free #: +1-888-4ELTIMA [CET], support@eltima.com


VSPD XP Manual

VSBUS_QUERY_EX

typedef struct _VSBUS_QUERY_EX{
IN ULONG Size;
IN ULONG QueryType;
IN WCHAR PortName[MAX_PORTNAME_LEN];
}VSBUS_QUERY_EX, *PVSBUS_QUERY_EX;

Members

  • Size

    • VSBUS_QUERY_EX structure size

  • QueryType

    • Has QUERYTYPE_PORTS = 1 value to query all ports or QUERYINFO_PAIR = 2 to query particular virtual pair. Could be extended in the future.

Tech support: Toll-free #: +1-888-4ELTIMA [CET], support@eltima.com


VSPD XP Manual Comments

PORT_INFORMATION

typedef struct _PORT_INFORMATION{
ULONG NextOffset;
ULONG NameOffset;
ULONG Instance;
ULONG ConnectedInstance;
}PORT_INFORMATION, *PORT_INFORMATION;

Members

  • NextOffset

    • Offset of the next PORT_INFORMATION structure

  • NameOffset

    • Offset of the name

  • Instance

    • Instance of the virtual serial pair

Tech support: Toll-free #: +1-888-4ELTIMA [CET], support@eltima.com


VSPD XP Manual: Comments

PORT_INFORMATION_EX

typedef struct _PORT_INFORMATION_EX{
ULONG NextOffset;
ULONG NameOffset;
ULONG Instance;
ULONG ConnectedInstance;
ULONG TxCount;
ULONG RxCount;
SERIAL_BAUD_RATE Baudrate;
SERIAL_LINE_CONTROL LineControl;
VSERIAL_WIRING HandFlow;
VSERIAL_STATE State;
}PORT_INFORMATION_EX, *PORT_INFORMATION_EX;

Members

  • NextOffset

    • Offset of the next PORT_INFORMATION_EX structure

  • NameOffset

    • Offset of the name

  • Instance

    • Instance of the virtual serial pair

  • TxCount

    • Number of bytes transmitted through this port

  • RxCount

    • Number of bytes received by this port

  • Baudrate

    • instance of SERIAL_BAUD_RATE structure that holds current baud rate value

  • LineControl

    • instance of SERIAL_LINE_CONTROL structure that holds current LineControl state value

  • Wiring

    • instance of VSERIAL_WIRING structure that represents current signal line pinout settings

  • State

    • instance of VSERIAL_STATE structure that holds current port state value

Tech support: Toll-free #: +1-888-4ELTIMA [CET], support@eltima.com


VSPD XP Manual Serial Wiring

VSERIAL_WIRING

typedef struct _VSERIAL_WIRING{
UCHAR DTR; // data-terminal-ready
UCHAR RTS;// request-to-send
UCHAR OUT1;
UCHAR OUT2; // Interrupt enable (IE) line
}VSERIAL_WIRING, *PVSERIAL_WIRING;

Members

  • DTR, RST, Out1, Out2

    • [in] line signals may have following values depending on which port you want connect to:

    Value | Meaning | Hex
WIRED_TO_DCD | setting connection to remote DCD line | 0x80
WIRED_TO_RI | setting connection to remote RI line | 0x40
WIRED_TO_DSR | setting connection to remote DSR line | 0x20
WIRED_TO_CTS | setting connection to remote CTS line | 0x10

Tech support: Toll-free #: +1-888-4ELTIMA [CET], support@eltima.com


VSPD XP Manual: Using in C/C++

Using it With C/C++

In C and C++, you have to dynamically load the DLL file, find the function(s) you want to use, and call them. A sample function to do this in Visual C++ is shown below:

typedef
                        bool (__stdcall *CreatePairFn)(char *Port1, char *Port2);
typedef bool (__stdcall *DeletePairFn)(char *Port1);
typedef bool (__stdcall *DeleteAllFn)(void);
typedef bool (__stdcall *SetStrictBaudrateName) (char *Port, bool StrictBaudrate);
typedef bool (__stdcall *SetStrictBaudrateHandle) (HANDLE hPort, bool StrictBaudrate);
typedef bool (__stdcall *CreatePairFn)(char *Port1, char *Port2);
typedef bool (__stdcall *DeletePairFn)(char *Port1);
typedef bool (__stdcall *DeleteAllFn)(void);
typedef bool (__stdcall *SetStrictBaudrateFn)(char *Port, bool StrictBaudrate);
typedef bool (__stdcall *SetBreakFn)(char *Port, bool bBreak);
typedef bool (__stdcall *QueryBusFn)(void* InBuffer, long sizeInBuffer, void* OutBuffer, long sizeOutBuffer);
typedef bool (__stdcall *SetWiringFn)(char *Port, void *Buffer, long sizeBuffer);

Code example:

bool CreateVSPair(char *Port1, char *Port2) {

OSVERSIONINFO VersionInfo;
HINSTANCE libInst;
bool returnvalue = false;

VersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&VersionInfo);

if (VersionInfo.dwPlatformId != VER_PLATFORM_WIN32_NT)
libInst = LoadLibrary("VSPDCTL.DLL");
else
libInst = LoadLibrary("VSPDCTL.DLL");

if (!libInst) return false; /* Couldn't load library */
/* Substitute the typedefs above for functions other than CreatePairFn */
CreatePairFn CreatePair=(CreatePairFn)GetProcAddress(libInst, "CreatePair");
if (CreatePair==0) return false; /* Couldn't find function */
returnvalue=CreatePair(Port1, Port2); /* For example, Port1 = "COM5" and Port2 = "COM6" */
FreeLibrary(libInst);
return returnvalue;
};


VSPD XP Manual Using it with Visual Basic

Using it With Visual Basic

Visual Basic users can install the functions much simpler. Just paste the following lines into your Visual Basic source file:

Declare Function CreatePair Lib "VSPDCTL.DLL" (ByVal Port1$, ByVal Port2$) As Boolean
Declare Function DeletePair Lib "VSPDCTL.DLL" (ByVal Port$) As Boolean
Declare Function DeleteAll Lib "VSPDCTL.DLL" () As Boolean
Declare Function SetStrictBaudrateName Lib "VSPDCTL.DLL" (ByVal Port$, ByVal StrictBaudrate As Boolean) As Boolean
Declare Function SetStrictBaudrateHandle Lib "VSPDCTL.DLL" (ByVal Handle As Long, ByVal StrictBaudrate As Boolean) As Boolean
Declare Function CreatePair Lib "VSPDCTL.DLL" (ByVal Port1$, ByVal Port2$) As Boolean
Declare Function DeletePair Lib "VSPDCTL.DLL" (ByVal Port$) As Boolean
Declare Function DeleteAll Lib "VSPDCTL.DLL" () As Boolean
Declare Function SetStrictBaudrate Lib "VSPDCTL.DLL" (ByVal Port$, ByVal StrictBaudrate As Boolean) As Boolean
Declare Function SetBreak Lib "VSPDCTL.DLL" (ByVal Port$, ByVal bBreak As Boolean) As Boolean
Declare Function QueryBus Lib "VSPDCTL.DLL" (ByVal InBuffer As String, sizeInBuffer As Long, ByVal OutBuffer As String, sizeOutBuffer As Long) As Boolean
Declare Function SetWiring Lib "VSPDCTL.DLL" (ByVal Port1$, ByVal Buffer As String, sizeBuffer As Long) As Boolean

Put VSPDCTL.DLL in your program's directory or somewhere on the path. Now you can call function directly.


VSPD XP Manual: Using it with Delphi

Using it With Delphi

These are the function declarations for Delphi:

Function
        CreatePair(Port1, Port2 : PChar) : Boolean; stdcall; external 'VSPDCTL.DLL';
Function DeletePair(Port : PChar) : Boolean; stdcall; external 'VSPDCTL.DLL';
Function DeleteAll : Boolean; stdcall; external 'VSPDCTL.DLL';
Function SetStrictBaudrateName(Port: PChar, StrictBaudrate: Boolean) : Boolean; stdcall; external 'VSPDCTL.DLL';
Function SetStrictBaudrateHandle(hPort: THandle, StrictBaudrate: Boolean) : Boolean; stdcall; external 'VSPDCTL.DLL';
Function CreatePair(Port1, Port2 : PChar) : Boolean; stdcall; external 'VSPDCTL.DLL';
Function DeletePair(Port : PChar) : Boolean; stdcall; external 'VSPDCTL.DLL';
Function DeleteAll : Boolean; stdcall; external 'VSPDCTL.DLL';
Function SetStrictBaudrate(Port: PChar, StrictBaudrate: Boolean) : Boolean; stdcall; external 'VSPDCTL.DLL';
Function SetBreak (Port: PChar, bBreak: Boolean) : Boolean; stdcall; external 'VSPDCTL.DLL';
Function QueryBus (InBuffer: Pointer, sizeInBuffer: Integer, OutBuffer: Pointer, sizeOutBuffer: Integer) : Boolean; stdcall; external 'VSPDCTL.DLL';
Function SetWiring (Port: PChar Buffer: Pointer, sizeBuffer: Integer) : Boolean; stdcall; external 'VSPDCTL.DLL';

Delphi can load ArmAccess either dynamically or statically. Here is a sample code for dynamic loading:

Function CreatePairFn(PortName1, PortName2 : String) : Boolean;

Type TCreatePair = function(Port1, Port2 : PChar) : Boolean; stdcall;

Var Handle : THandle;
CreatePair : TCreatePair;

Begin

CreatePairFn := False;
Handle := LoadLibrary('VSPDCTL.DLL');
If (Handle <> 0) Then
Begin
@CreatePair:=GetProcAddress(Handle, 'CreatePair');
If (CreatePair <> Nil) Then
CreatePairFn := CreatePair(PChar(PortName1), PChar(PortName2));
FreeLibrary(Handle);

End;
End;


VSPD XP Manual: Using it with other programming languages

Using it With Other Programming Languages

Any language which allows you to access a dynamic-link library (DLL file) should be able to use VSPDCTL*.DLL. Note that the strings these functions use are null-byte terminated (C-style) strings; if your language uses a different type of string, you may have to add the null-byte (a byte with the ASCII value of zero) to the end of them manually. Please consult your language documentation for further details.


VSPD XP Manual Technical Support and Upgrades

Tech Support and Upgrades

You can easily request support via any of the following methods:

Support via e-mail:

You can always reach our Support Team via the following e-mail:
support@eltima.com

Support via instant messengers:

ICQ #: 133156588
MSN Messenger ID: softinfinity@hotmail.com
AOL Messenger ID: SoftInfinitySP
Yahoo! Messenger ID: serge_softinfinity

Support via phone:

Toll-free support line #: +1-888-4ELTIMA [CET]

Contact us now! (requires a connection to the Internet)

If you have any questions or comments, please, feel free to use the following form to contact us.

Your name:
Your e-mail:
Your company (optional):
Your country:
Your question most closely concerns:
Contact me back via:
You contact details (Messenger account, phone number):
Your message:


VSPD XP Manual: Feedback

Feedback

Let us know what do you use Virtual Serial Port Driver XP for and get an upgrade to VSPD XP 5.0 for free!

Contact us right now! (requires a connection to the Internet)

Your name:
Your e-mail:
Your company (optional):
Your country:
Contact me back via:
You contact details (Messenger account, phone number):
Your message:


VSPD XP Manual: FAQ - Frequently Asked Questions

FAQ - Frequently Asked Questions

  • How many virtual serial ports pairs can I create?
  • Are hardware signal lines (DTR/DSR, RTS/CTS, RING, ERROR, DCD, etc.) emulated in VSPD XP?
  • Can I use VSPD XP with my GPS mapping software?
  • Can I create "Direct cable connection" in Windows 2000/XP and connect application on the first port to PPP/SLIP server on the second port?
  • Will VSPD XP work on Windows 98/ME?
  • I have older versions of VSPD XP. Can I get an upgrade?
  • Can I use VSPD XP with VMWare and SoftIce?
  • Do you have version of VSPD for WinCE?
  • Can I distribute VSPD XP bundled with my application?
  • During the installation I got two Error Messages: UpdateDriverForPlugAndPlayDevice FAILURE and Main FAILURE.
  • Seems I cannot create ports with index higher than 9, for instance, when I try to create COM10, "File not found" is returned. Am I doing anything wrong?
  • It seems that I cannot use Baud Rate emulation under Windows 98.
  • There are cases when I can't delete the ports I just created, what's wrong?
  • Why reset bus doesn't work properly?
  • I have problems using Serial Port Splitter by Eltima Software after installing VSPD XP. What I did wrong?

How many virtual serial ports pairs can I create?

The number of virtual serial ports pairs is unlimited. From VSPD Configuration utility you can create up to 127 pairs, but if you need more, contact ELTIMA Software for instructions.

Are hardware signal lines (DTR/DSR, RTS/CTS, RING, ERROR, DCD, etc.) emulated in VSPD?

Yes, all signal lines are emulated and supported. As in real null-modem connection, DRT of the first port connected to DSR and DCD of the second port, and RTS of the first port connected to CTS of the second port.

Can I use VSPD XP with my GPS mapping software?

Yes, virtual serial ports will be visible as real ports for GPS mapping software.

Can I create "Direct cable connection" in Windows 2000/XP and connect application on the first port to PPP/SLIP server on the second port?

Yes, you can. No problems were detected with this type of connection.

Is flow control implemented in virtual serial ports?

Yes, flow control is fully implemented in VSPD XP.

Will VSPD XP work on Windows 98/ME?

Yes. Starting from version 5.0 VSPD XP supports all Microsoft Windows platforms, including Windows 98 and ME.

I have older versions of VSPD XP. Can I get an upgrade?

If you are registered user, most upgrades are free. However, please, send your request to support@eltima.com for final clarifications.

Can I use VSPD XP with VMWare and SoftIce?

Yes, virtual serial ports are fully supported by SoftIce and VMWare.

Do you have version of VSPD for mobile platforms?

Yes. Please visit http://www.eltima.com/products/vspdce for details.

Can I distribute VSPD XP bundled with my application?

Yes, but you will need OEM version. Please, contact sales@eltima.com for details.

During the installation I got two Error Messages: UpdateDriverForPlugAndPlayDevice FAILURE and Main FAILURE.

This problem is known to happen on laptops. Please, check that you have the following key present in your registry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
If it is not, just create it! We faced this problem some time ago and must say, there can be a possibility that some of the software deletes this key and later you won't be able to add any devices via installers without this key. Additionally, you can try to reboot and start the installation once again.

Seems I cannot create ports with index higher than 9, for instance, when I try to create COM10, "File not found" is returned. Am I doing anything wrong?

Serial ports in Windows are considered to be standard physical devices, that is why you should open any device in the following way: "\\.\COM10". Using the shortened name ("COM1" or "COM3") you can open only first 9 serial ports. More information on this issue can be found in MSDN.

It seems that I cannot use Baud Rate emulation under Windows 98.

As we were planning to add full baud rate emulation under all supported OS in VSPD XP 5.0, but we received a lot of requests from our customers who need it now, we only realized this feature for Windows NT4/2000/XP/2003.

There are cases when I can't delete the ports I just created, what's wrong?

The most possible reason is that one of the ports you created (or both) is currently open by application. To delete them, please, close all connections at those ports.

Why I cannot reset bus properly?

If you have any Virtual Serial Ports in Other section which are created by other Eltima Software application Reset Bus button will not function.

I have problems using Serial Splitter by Eltima Software after installing VSPD XP. What I did wrong?

Please, reinstall Serial Splitter and then VSPD XP in this case.