AN232B-07 Configuring FTDI`s VCP Drivers to use Location IDs

Future Technology Devices
International Ltd.
AN232B-07 Configuring FTDI's VCP
Drivers to use Location IDs
Copyright © 2006 Future Technology Devices International Ltd.
I
AN232B-07 Configuring FTDI's VCP Drivers to use Location IDs
Table of Contents
Part I How To Configure VCP to Use a
Specific COM Port
2
1 Introduction
................................................................................................................................... 2
2 Location IDs
................................................................................................................................... 3
3 Implementation
................................................................................................................................... 4
4 USBView ................................................................................................................................... 5
5 Limitations
................................................................................................................................... 6
6 Requirements
................................................................................................................................... 7
Part II History, Disclaimer, and Contact
Information
8
1 Document...................................................................................................................................
Revision History
8
2 Disclaimer................................................................................................................................... 9
3 Contact Information
................................................................................................................................... 10
11
Index
Copyright © 2006 Future Technology Devices International Ltd.
How To Configure VCP to Use a Specific COM Port
1
How To Configure VCP to Use a Specific COM Port
1.1
Introduction
2
A common problem occurs in a manufacturing environment when it is required to test serial
converter cables by installing them as COM ports. When serialized cables are plugged in for
testing, the system allocates a new COM port for every cable. If the system limit of 256 COM ports
is reached, the only way to continue testing is to free up COM ports by uninstalling then reinstalling.
The problem occurs because the serialized cables appear to the system as unique devices, each
device identified by its serial number and the serial number is used by the VCP driver when it
creates a COM port. If the serial number was not used to create the COM port, then it would be
possible setup an environment where every cable installed as the same COM port. Therefore, only
one COM port would be needed to test any number of cables.
Here we describe how to configure the VCP driver to achieve this goal.
Copyright © 2006 Future Technology Devices International Ltd.
3
1.2
AN232B-07 Configuring FTDI's VCP Drivers to use Location IDs
Location IDs
The idea is to allocate a COM port using information derived from the cable's physical location on
USB instead of the serial number. If the cables are always plugged into the same USB port, then
they will appear to the system as the same COM port.
FTDIBUS.SYS can be configured to use location information and the configuration parameter
LocIds has been introduced for this purpose. LocIds is an array of device locations in the USB
tree. If LocIds is set up, then only devices that are plugged into these locations are supported by
the driver. So, if LocIds has been set up and a device is plugged into one of the supported
locations, it will be installed as a COM port. If LocIds has been set up and a device is plugged into
some other location, then it will not be installed as a COM port.
Copyright © 2006 Future Technology Devices International Ltd.
How To Configure VCP to Use a Specific COM Port
1.3
4
Implementation
Location IDs are used to define the set of USB ports supported by FTDIBUS. The driver's default
behaviour is that all USB ports are supported, but the default can be overridden via the binary value
LocIds in the FTDIBUS service key.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\FTDIBUS\Parameters\LocIds
LocIds is a binary value (REG_BINARY) that is interpreted as an array of Location IDs. A Location
ID is a 32-bit unsigned integer (DWORD) that represents the location of the device in the USB tree.
For example, if the driver creates a location string for the device of the form a&b&c, the Location ID
will be 0x00000abc.
The driver can be installed with support for one Location ID by changing FTDIBUS.INF to include
the following fragments:
[FtdiBus.NT.AddService]
AddReg = FtdiBus.NT.AddService.AddReg
[FtdiBus.NT.AddService.AddReg]
HKR,Parameters,"LocIds",1,23,00,00,00,00
Here, one USB port is supported, and Location ID 0x00000023 represents host controller 1 port 3.
The driver can be installed to support more than one Location ID by changing FTDIBUS.INF to
include the following fragment:
[FtdiBus.NT.AddService]
AddReg = FtdiBus.NT.AddService.AddReg
[FtdiBus.NT.AddService.AddReg]
HKR,Parameters,"LocIds",1,21,00,00,00,32,00,00,00,11,00,00,00,00
Here, three USB ports are supported. Location ID 0x00000021 represents host controller 1 port 1.
Location ID 0x00000032 represents host controller 2 port 2. Location ID 0x00000011 represents
host controller 0 port 1.
Note that Location IDs are represented in the LocIds field as 4 hexadecimal bytes and in bytereversed order.
Note also that although on USB host controllers are indexed from 0 and ports from 1, Location IDs
are calculated by adjusting the host controller number so that it is indexed from 1.
Copyright © 2006 Future Technology Devices International Ltd.
5
1.4
AN232B-07 Configuring FTDI's VCP Drivers to use Location IDs
USBView
Location IDs can be obtained using the utility USBView that is available from FTDI. To get the
Location ID for a specific USB port, run USBView and plug a device into the port that is required.
From the menu select Options > LocationIDs. Press F5 to refresh the display and the port
numbers are replaced with Location IDs of the form LocXY where X and Y are hexadecimal digits.
XY is the Location ID that is used in the LocIds field as described in the previous section.
Copyright © 2006 Future Technology Devices International Ltd.
How To Configure VCP to Use a Specific COM Port
1.5
6
Limitations
Although this technique can be used to control the number of COM ports created in the system, it
cannot prevent the installation of a new USB device for every unique device that is plugged in.
Location IDs are only supported on Windows 2000 and XP.
Copyright © 2006 Future Technology Devices International Ltd.
7
1.6
AN232B-07 Configuring FTDI's VCP Drivers to use Location IDs
Requirements
The following are required to use LocIds.
· VCP 1.00.2150 or later
· USBView with Location IDs
Copyright © 2006 Future Technology Devices International Ltd.
History, Disclaimer, and Contact Information
2
History, Disclaimer, and Contact Information
2.1
Document Revision History
Version
Release Date
Comments
1.0
March 2004
Initial release.
1.1
February 2006
1.2
February 2006
Format updated.
Various corrections throughout.
INF fragments updated for new driver release.
Copyright © 2006 Future Technology Devices International Ltd.
8
9
2.2
AN232B-07 Configuring FTDI's VCP Drivers to use Location IDs
Disclaimer
Copyright © 2006 Future Technology Devices International Ltd.
Neither the whole nor any part of the information contained in, or the product described in this
manual, may be adapted or reproduced in any material or electronic form without the prior written
consent of the copyright holder.
This product and its documentation are supplied on an as-is basis and no warranty as to their
suitability for any particular purpose is either made or implied.
Future Technology Devices International Ltd. will not accept any claim for damages howsoever
arising as a result of use or failure of this product. Your statutory rights are not affected.
This product or any variant of it is not intended for use in any medical appliance, device or system
in which the failure of the product might reasonably be expected to result in personal injury.
This document provides preliminary information that may be subject to change without notice.
Copyright © 2006 Future Technology Devices International Ltd.
History, Disclaimer, and Contact Information
2.3
Contact Information
Head Office - Glasgow, UK
Future Technology Devices International Limited
373 Scotland Street
Glasgow
G5 8QB
United Kingdom
Tel: +44 (0) 141 429 2777
Fax: +44 (0) 141 429 2758
E-Mail (Sales): [email protected]
E-Mail (Support): [email protected]
E-Mail (General Enquiries): [email protected]
Web Site URL: http://www.ftdichip.com
Web Shop URL: http://apple.clickandbuild.com/cnb/shop/ftdichip
Branch Office - Taiwan
Future Technology Devices International Limited (Taiwan)
4F, No 16-1, Sec. 6 Mincyuan East Road
Neihu District
Taipei 114
Taiwan
ROC
Tel: +886 2 8791 3570
Fax: +886 2 8791 3576
E-Mail (Sales): [email protected]
E-Mail (Support): [email protected]
E-Mail (General Enquiries): [email protected]
Web Site URL: http://www.ftdichip.com
Branch Office - Hillsboro, Oregon, USA
Future Technology Devices International Limited (USA)
5285 NE Elam Young Parkway
Suite B800
Hillsboro, OR 97124-6499
USA
Tel: +1 (503) 547-0988
Fax: +1 (503) 547-0987
E-Mail (Sales): [email protected]
E-Mail (Support): [email protected]
E-Mail (General Enquiries): [email protected]
Web Site URL: http://www.ftdichip.com
Agents and Sales Representatives
Please visit the Sales Network page of the FTDI Web site for the contact details of our
distributor(s) in your country.
Copyright © 2006 Future Technology Devices International Ltd.
10
AN232B-07 Configuring FTDI's VCP Drivers to use Location IDs
11
Index
-CCOM POrt 2, 3, 6
Contact Information
10
-DDisclaimer 9
Document Revision Histort
8
-FFTDIBUS Service Key
FTDIBUS.INF 4
FTDIBUS.SYS 3
4
-LLocation ID 5
Location IDs 3, 4, 6, 7
LocIDs 3, 5
-RRegistry
4
-UUSB Host Controller
USB Port 4
USB Tree 3, 5
USBView 5, 7
4
-VVCP
2, 7
-WWindows 2000 6
Windows XP 6
Copyright © 2006 Future Technology Devices International Ltd.