Direct Port I/O under WinNT

Direct Port I/O under WinNT

This is an old topic from the previous forum. I'm still searching for a solution, so here goes again.

I've written a program that runs a laboratory. Controls several racks of electronics, collects data and interactively displays/plots it for the user. I've tried to move as much of the equipment as possible to a GPIB interface, for which I have a convenient dll/lib interface. Unfortunately, several components must be controlled from a home-brewed digital I/O board. The weakest link (besides my programming skill) is my ability to perform direct read and writes to port addresses, necessary to talk with this board. In the previous DOS version of the program, I simply linked to a C routine which used the routines outp and inp. This does not work under NT because "user" level applications are prevented from directly addressing hardware. My current kludge is to use a commercially available kernel mode driver, which is designed to provide access to the paralel ports, is way over-designed for this task and has a couple of bugs in it, to boot. I'd like something like the SPort routines included in CVF for a general hardware address read and write. Another solution would be an example of how to use the operating system routines such as ReadPortUchar. Another would be a cost-effective (read that, cheap) package that automates writing kernel mode drivers. The WindRiver product is >$1500 even for academics, so doesn't fit this description.

Anyone out there with experience in this area?
Thanks in advance for any suggestions.

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Best Reply

1- Analog Devices had a Fortran library (ADIFOR.lib) which could be linked with MS Fortran 5.1 programs to communicate with their DAQ boards (e.g. RTI-800 series). This maybe shows that there should be some way to communicate with ports in Fortran. But this was for 16-bits environments only and AD took away this library from their packages since, I think, 1991.

2- Computer Boards has a "Universal Library" (for some $60) which contains a cbWin.dll and I/O routines for their boards. It seems to me that using this DLL and calls like cbInByte() and cbOutByte() in a Fortran program, and editing the configuration file of course, could be used to communicates with ports. I am not sure, but it maybe is worth to ask them. I have used such calls from within Fortran, but with CB's own DAQ boards.

Leave a Comment

Please sign in to add a comment. Not a member? Join today