Here's a little something I threw together to help out anyone interested in coding applications to drive the parallel port under XP, and wishing to use WinIO under masm to achieve it.
I have a little hardware project in mind at my dayjob involving a cheap cnc retrofit of a machine for a specific and specialised operation.
To prove just how cheap I am, I drew my own rotary encoder, and designed and built my own channel-optics driver circuit.
Enclosed is an application which does nothing much but install / initialize WinIO, with a dos-mode "-r" option for removing WinIO from your system.
Also enclosed is a file describing my system for realtime quadrature decoding of the 2 output channels (A and B) of the rotary encoder.
Based on a DRO application in the public domain, I keep the last four values from the rotary encoder as four pairs of bits in a single byte.
I then use this "history byte" as the index into a byte array which in turn indicates either +1, -1, 0, or "decoder error".
I'm currently considering using an IC to perform this decoding, using a counter and 8-bit buffer on the interface, and then querying the buffer from my software (and then clearing the buffer to zero), and using the returned value as a signed modifier of the software counter. Those IC's have some mighty nice debouncing circuitry :)
Posted on 2002-11-27 01:35:49 by Homer
At least post code that you source. Using someone else's code to do your work adds nothing to the knowledge. Think WDM.
Posted on 2002-11-29 20:32:53 by sceptor
WinIO was coded in C by Yariv Kaplan of internals.com , and is public domain for non commercial purposes.
The package available from his site contains ALL sourcecode, plus includes for C and for VB, not for asm.

I have no intention of translating the sourcecode to the winio dll, or the winio device driver (sys), or the winio vxd into asm source.
Why would I? Besides, he WANTS us to interface to his code...
Have I done anyone a disservice? I hope not !

My intention here was to help those of us who are not proficient in HLL's by providing a masm version of Yariv's includefile. The fact that I included the release version of his driver support libs is so the example I provided was usable !!

If you were referring not to Yariv's code but to the DRO project source,
it is 100% public-domain C source, and has been rewritten by numerous authors already and released under various guises.
The original link I found was to DRO software but I have been relying more on this old dinosaur than anything else... here's an update of the io tester, geared towards ECP printer ports since they can emulate all the other kinds...
Posted on 2002-11-30 01:48:40 by Homer
I should have mentioned this too - an oversight on my part...

In order to remove WinIo drivers from your box, simply run the iotest app along with the commandline switch "-r"
ie
iotest -r

Also note that I've found Yariv's WinIo version 2 fix for XP is not working correctly under winME or win2K. Strange !! It works on win95, win98 and xp...
he says it works fine, but my betatesters say otherwise...
all I did is try to read ecr and control register values, and it returns successfully from GetPortVal, but returns -1 in the buffer !! lol Yariv.
Posted on 2002-11-30 01:57:14 by Homer
Another update of the iotester.
This will probably be the last public release.

I've implemented a variation of Chris Hobbs' AntiFlicker.
Windows MessagePump has been modified to spend process idle time reading the port registers, forcing cpu use to around 100%, emulating realtime.
Screen redraws occur twice a second or onKeyDown..
Realtime port register monitoring achieved.

ToDO: write a State Engine monitoring the port registers from within the messagepump, and forcing redraw onStateChange, and eliminating the need for the half-second timer which is being used at the moment.
Posted on 2002-12-01 00:04:02 by Homer

Also note that I've found Yariv's WinIo version 2 fix for XP is not working correctly under winME or win2K. Strange !! It works on win95, win98 and xp...


hi EvilHomer2k, a good one :alright:
is the bug still there?

thanks
Posted on 2002-12-17 02:26:06 by dion
The bug has been reported, and yes, it is still there. If you wish to use WinIo with ME/2K, I recommend downloading the version of WinIo released prior to the XP version... the older one. My code works fine with either WinIO dll.
As soon as the dll has been patched again, I'll release a final version of the io tester complete with bells and whistles - it's a Digital ReadOut for a single axis at the moment, I'm expanding it to eight axes/devices, and also adding D3D support for showing machine motion in realtime.
This will get us 70% of the way towards having a decent and modern CNC control.
Posted on 2002-12-17 06:40:57 by Homer