Home arrow Embedded Tools arrow Page 4 - Programming Custom Hardware for Windows

Programming Custom Hardware for Windows

The task of developing custom applications that access custom hardware can be daunting for even the most seasoned application developer and especially for someone who has just learned developing applications using Visual Basic and similar RAD tools. Here in this article I present an alternative way that may help even the non-programmers to do what they want. That is to develop a custom UI and then access a specific piece of hardware that is connected to their machine.

Author Info:
By: Digvijay Chauhan
Rating: 5 stars5 stars5 stars5 stars5 stars / 67
April 14, 2004
  1. · Programming Custom Hardware for Windows
  2. · The Design
  3. · The Code
  4. · Points of Interest

print this article

Programming Custom Hardware for Windows - Points of Interest
(Page 4 of 4 )

  • Short is a 16-bit integer in Win32 C++ whereas int is 32-bit integer in Win32 C++ use (short) to force returning 16-bit integer back to VB. So as you'll notice in the function InPort and OutPort I've used this convention.

  • There exist similar functions to _inp( ) and _outp( )  that have capacity to read words and double words from the specified port. Maybe if you're writing an I/O intensive application, for instance, a Data Acquisition card you might consider using them by changing the code in DLL appropriately.

  • If direct I/O is not achieved through the giveio driver there are other system APIs that'll allow you to do so but the process becomes very slow (approximately 20 times) so it's worth considering the use of GiveIO driver.

The VB Client Program

The sample program to use this DLL is developed using Visual Basic 6.0 and with a quick look at the source you'll know how can you perform I/O using this DLL. You'll see the exports InPort, OutPort, GetDriverStatus, and GetDLLStatus in action with their usage.


So finally we've developed a library that'll ease development of hardware accessing applications in VB and other RAD application development tools that may consume a DLL. I would not say that it's the most efficient way but certainly the most straightforward to understand and implement. Any comments and suggestions can be forwarded to me at Digvijay_Chauhan@hotmail.com.


1. Direct Port I/O and Windows NT by Dale Roberts
2. LoadDrv program and source code by Paula Tomlinson

DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

blog comments powered by Disqus

- A New Toolbar Can Boost Your Web Site Traffi...
- Programming Custom Hardware for Windows
- Developing Embedded Systems - A Tools Introd...
- WAP for Fun and Profit - Part 1 - Basic WML ...
- HTTP Requesting with eVC++ 3.0 on Windows CE...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials