Embedded Tools
  Home arrow Embedded Tools arrow Page 4 - Programming Custom Hardware for Windows
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
EMBEDDED TOOLS

Programming Custom Hardware for Windows
By: Digvijay Chauhan
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 59
    2004-04-14

    Table of Contents:
  • Programming Custom Hardware for Windows
  • The Design
  • The Code
  • Points of Interest

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    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.

    Conclusion

    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.

    References

    1. Direct Port I/O and Windows NT by Dale Roberts
    (http://www.ddj.com/documents/s=961/ddj9605a/)
    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.

     

    EMBEDDED TOOLS ARTICLES

    - 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...







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek