  





UPPER CANADA TECHNOLOGIES


NTPORT OCX version 1.23 Copyright ? 2002,   Robert Woudsma
                      All Rights Reserved


DLPORTIO.SYS and DLPORTIO.DLL
Copyright ? Scientific Software Tools Inc.

Why would I use NTPORT?
In DOS based variations of the BASIC programming language programmers could 
easily access the IBM-compatible computers I/O ports with the INP and OUT 
commands. For many programmers Visual Basic has become programming 
language of choice to develop Windows based applications. As robust and simple as 
Visual Basic is to use, it does not contain the commands to access the computers 
I/O ports. NTPORT is a custom control that can be easily added to any Visual Basic 
project to provide 8-bit or 16-bit READ and WRITE capability to any port within the 
PCs I/O address space.  NTPORT is a 32-bit ActiveX /OCX control designed to be 
used with Visual Basic 5.0 or 6.0 under Windows 95, Windows 98 and Windows NT.

Shareware Notice
The NTPORT is distributed under the shareware principle. As such, you are 
welcome to use it for a trial period of up to 30 days.  If you find that NTPORT is 
useful to you and you wish to continue using it then please register this product and 
support software being produced under the shareware concept.  You may freely 
copy/distribute the shareware version in it's original form as long as you make no 
changes to any of the NTPORT files and you charge no fee for it beyond 
reproduction costs.  If you register NTPORT, then you may use it in your own 
personal software or in commercial products with no royalty fee.

NTPORT.OCX Installation 

1.	If you downloaded NTPORT from the Internet copy the NTPORT.ZIP file to a 
temporary directory on your hard drive and unzip it.  If you received NTPORT on 
a distribution diskette, then the files are not zipped and you can copy them 
directly from the diskette.



From version 1.01 NTPORT is distributed with a SETUP.EXE application setup file. 
To install NTPORT simply run the setup file. It will place the DLPORTIO.DLL and 
NTPORT.OCX files into your system directory and will also register these files in the 
Windows registry. Setup will also place the DLPORTIO.SYS file into your computers 
system/drivers or system32/drivers directory.
 
Running under Windows 95/98 or Windows NT Platforms
NTPORT works equally well under Windows 95 and Windows 98 as it does under 
Windows NT, 2000 and XP. The DLPORTIO.SYS kernel-mode driver is not required 
in Windows 95/98. If you plan to use NTPORT only under a Windows 95/98 platform 
you should consider using the IOPORT.OCX which is also available at the UPPER 
CANADA TECHNOLOGIES web site. IOPORT does not require the 
DLPORTIO.SYS driver file or the DLPORTIO.DLL library file and therefore operates 
with better efficiency. If you wish to write programs that will work under either the 
95/98 or the NT/2K/XP platform then use NTPORT.  NTPORT will allow hardware 
access under Windows 95/98 or Windows NT in the same way. Code that you write 
on Windows 95/98 will work equally well when you run it under Windows NT. There 
is a difference, however in making the program work under 95/98 or NT. 

Running under Windows NT/2000/XP
When running under Windows NT/2K/XP you must ensure that the file: 
DLPORTIO.SYS is placed in the Winnt\system32\drivers or the 
Windows\system32\drivers directory. This driver file must then be loaded before 
trying to write or read from a hardware port. In order to load the DLPORTIO.SYS 
driver; use the small driver loader program called LOADDVR.EXE which is included 
in the .ZIP file or on the distribution diskette. This file can be copied to any directory 
on your hard disk and executed from that directory or executed directly from the 
floppy disk. 

When the loaddrv program is run a dialog box will be displayed as shown below.

		
NOTE: The pathname above must be changed to the location of the 
DLPORTIO.SYS driver file which normally will be at:

c:\winnt(or windows)\system32\drivers\dlportio.sys. 

The driver must first be installed using the Install button, then started using the Start 
button. If the status message states the operation was successful in both of these 
operations the driver is installed and operating. The loader program can be closed 
by clicking on the OK button. From this point on the I/O hardware access will operate 
under Windows NT in the same way as it will under Windows 95/98. 

NOTE:	This driver file must be supplied with the distribution of any 
software written that makes use of NTPORT.OCX for Windows NT 
operating systems complete with the mechanisms to load and run 
the driver or the software will not be able to access hardware 
ports.

Automatic Driver Loading Under Windows NT
Once the DLPORTIO.SYS driver has been installed and run on an NT system it can 
be made to start automatically every time NT is started. To place the driver into this 
mode select the DEVICES icon  from the Windows NT Control Panel. From 
"Devices" dialog box that will appear select dlportio and click on the Startup... 
button


The device Startup Type dialog box will be shown as illustrated below.  From the 
option buttons select Automatic. The driver will now automatically start each time 
that Windows NT is restarted.


Driver Removal
Installing and running the driver allows access to hardware I/O ports under Windows 
NT. It should not present a conflict with other hardware devices. If, however, after 
loading and running the driver you experience difficulties with other hardware, when 
you finished working in Visual Basic the Loaddvr program should be used to stop 
and remove the driver.


Setting up the DLPORTIO.SYS driver in Windows 2000/XP

To set up the dlportio.sys driver file under Windows 2000. After installing the 
NTPORT.OCX and support files using the SETUP.EXE program, go to the Windows 
2000 System properties and select the Device Manager as shown below
 



















The "Non-Plug and Play Divers" entry may not be visible at first. If not, click on the 
View menu item in Device Manager and click on View Hidden Devices to make 
sure that hidden driver files are listed. Then it should be visible.
 
From the non-plug and play drivers list in Device Manager locate the dlportio device 
and double-click on it as shown below.



 
The dlportio properties page for the driver will be shown. Here you can set the 
current status to Started or Stopped. You can also set the action on startup of 
Windows. Set this to startup AUTOMATICALLY whenever Windows starts. It should 
now always be available. That's IT!!






Adding NTPORT to your Visual Basic Project
In order to use NTPORT control in your Visual Basic project it must be added to 
the tool box. To do this select Project from the Visual Basic main menu. From 
the Project drop-down menu select Components. A similar Components dialog 
box will appear as shown below. 

On the Controls page of the dialog box select the NTPORT_Custom_Control 
module and click on OK. The control icon below should now be displayed in the 
toolbox.

To place the NTPORT control on a form follow the procedure for most Visual Basic 
controls; click on the control icon in the toolbox and then use the mouse to drag a 
rectangle on the form. When the rectangle is drawn, the control will be displayed as 
shown below. The properties of the NTPORT control are now available to your 
Visual Basic code. 

NOTE: The control is visible only at design time on your Visual Basic form. It will 
disappear from the form when the Visual Basic program is executed.



Using NTPORT in Visual Basic
1)	NTTEST Sample Application
There is are several Visual Basic 6.0 project and .EXE files included in the 
NTPORT.ZIP file or on the distribution disk. The name of the test files are as 
follows:

nttest_vb6_wNT_C		for use if Windows NT is installed on drive C:
nttest_vb6_wNT_D		for use if Windows NT is installed on drive D:
nttest_vb6_w95_C		for use if Windows 95/98 is installed on drive C:

The design-time and run-time screens for the test application are shown 
below. The view to the left shows the form at design time. Notice that the 
NTPORT control, in blue at the lower right of the form is present only at 
design time and disappears in runtime. 

Loading Errors:
If, when loading the test program, loading errors appear and this control is 
shown as a blank gray control it means that the NTPORT.OCX, .DLL and/or 
.SYS  files on your computer are in a different location than the test program 
expects them to be. To correct this you must simply delete the blank control 
and re-load the NTPORT control as described in the section: "Adding 
NTPORT to your Visual Basic Project", above. The test application files 
include the form, project and executable files which are thoroughly 
documented. By viewing and running these files you can get a understanding 
of how the NTPORT OCX can be used in your own Visual Basic applications. 



2)	NTPORT Properties
The NAME property of the NTPORT.OCX control is NTPORT. When the 
control is first placed on a Visual Basic form it's default NAME property will be 
set to NTPORT1, following the control naming convention of Visual Basic. If a 
second NTPORT control is placed on the form it's NAME property would be 
set to NTPORT2. These names can be changed in the NTPORT property 
window but this should be done before any code is written using the 
NTPORT's properties.

Besides the general properties of almost all Visual Basic controls such as 
NAME, TOP, LEFT, INDEX etc. there are four unique properties in the 
NTPORT control; address, bitsize, USValue and value.  A description of 
each control property and how it is used follows.

?	Address	This property sets the address of the I/O port that the programmer 
wishes to read from or write to. The value can be an integer 
number from 0 to 65535.
?	Bitsize	This property defines whether the value to be written or read will be 
a byte (8-bits) or a word (16-bits). The only valid values for this 
property is 8 or 16, any other values will result in no change of the 
property.
?	Value	1) 	8-bit operation: (bitsize = 8)
During a write operation the value contained in the value property 
will be delivered to the I/O port defined by the address property. 
Valid write values are from 0 to 255.
During a read operation the value of the contents of the I/O port 
defined by the address property will be returned to the value 
property. Values returned will be from 0 to 255.
2)	16-bit operation:  (bitsize = 16)
In 16-bit operation the value property operates the same as in 8-bit 
mode. The only difference is that in 16-bit mode the values written 
or read are considered to be signed 16-bit words. As such valid 
write and returned values range from -32768 to +32767.
?	USValue	16-bit mode only: (bitsize = 16)
This property operates in the same way as the value property, 
above but uses unsigned 16-bit values and is only valid in 16-bit 
mode. When in 16-bit mode it may be desired by programmers that 
the 16-bit value being written or returned be of the unsigned integer 
format where valid values range from 0 to 65535. 


NTPORT Software Registration

Registration of the NTPORT control with Upper Canada Technologies grants you a 
single user license. As such, you may install NTPORT on as many computers as 
you wish provided that only the registered person uses it and that no two copies of 
NTPORT will be in use at the same time. You are required to purchase one copy of 
NTPORT for each person that will use it. 
As a registered user you may include NTPORT OCX in any software that you 
develop and distribute so long as NTPORT is only a component of your software 
and does not constitute your software's major function.

To register, please fill out the registration form on the last page of this document and 
mail it, along with your payment, to:

		Robert Woudsma
		UPPER CANADA TECHNOLOGIES
		R.R. #1, 2699  Lakefield Dr.
		Inverary, Ontario
		K0H 1X0
		E-mail: rjw@uct.on.ca

Registered users receive free updates to the current version (ie 1.x to 1.y).  Major 
revision upgrades (ie 1.x to 2.x) will only cost $5.00.

Constructive comments/criticism are always welcome at the above snail-mail or E-
mail address. 

NTPORT Pricing

   	Copies      	  Price (includes Taxes)
1  to  9      	$15.00 each
10 to 19	$13.50 each 
    	20 to 29	$12.00 each
	30 to 50	$10.50 each
	50+		$  8.50 each

Site License arrangements are available on a per unit cost basis. Please E-mail at 
the above address for Site License pricing.  
	
Educational Prices
As an educator, I have a soft spot for accredited educational institutions, all of which 
seem to be undergoing fiscal restraint. Special pricing is in place for educational 
facilities on unit or site license basis. Please E-mail Upper Canada Technologies for 
details.


NTPORT Registration Form

Please fill out the following form and mail with your payment to:

Robert J. Woudsma
UPPER CANADA TECHNOLOGIES
R.R.#1, 2699 Lakefield Dr.
Inverary, Ontario Canada
K0H 1X0

Name: 	______________________________
Company:	______________________________
Address:	______________________________
______________________________                               
______________________________
E-Mail:	______________________________

Copies        	Price (includes taxes) 	Number of copies: ________

1  to 9   	$15 each                   	      Price per copy: ________
10 to 19      	$13.50 each
20 to 29      	$12.00 each                    		Total price: ________
30 to 50       	$10.50 each
50+		$  8.50 each    	     	  Amount enclosed: ________

How did you hear about NTPORT? ____________________________________

Where did you get NTPORT?         ____________________________________

What will you use NTPORT for?  ______________________________________

________________________________________________________________

Features you would like to see added: _________________________________

 ________________________________________________________________

Comments: _______________________________________________________

________________________________________________________________

Thank You for purchasing NTPORT.OCX !



NTPORT Revision History

Version	Date		Description

1.0		10/98		NTPORT.OCX  Initial release

1.01	11/98	NTPORT distributed with Setup.exe to ease the 
installation procedure.

1.20	09/99	Updated NTTEST files and NTPORT documentation.

1.21	04/2000	Updated Windows 2000 to documentation

1.22	10/2001	Highlighted "hidden non-plug and play devices" issue in 
		Device Manager for Windows 2000 portion of 
documentation.

1.23	02/2002	Clarify that LOADDRV utility required for Windows NT, 
Windows 2000 and Windows XP installation



1
                   Copyright?  2000 Robert Woudsma,                                UPPER CANADA TECHNOLOGIES
