Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

direct access to parallel port

0 views
Skip to first unread message

Patrick Clauberg

unread,
Feb 26, 1999, 3:00:00 AM2/26/99
to
Hi,

I want to use the parallel port to remote control some applications

right now I do a while(1) loop with

y=_inp(0x3bd);

and for example

if ((y&8)==8)
to check the error line

which is quite bad

Somebody told me that I have do write a VxD or something

HOW?

Do I really need it?

doesn't something yet exist for this purpose?

Thanx

Patrick

Karen Hazzah

unread,
Mar 1, 1999, 3:00:00 AM3/1/99
to
In article , p...@uni.de says...

>
>I want to use the parallel port to remote control some applications
>right now I do a while(1) loop with
>y=_inp(0x3bd);
>and for example
> if ((y&8)==8)
>to check the error line
>Somebody told me that I have do write a VxD or something

Win95 allows applications (DOS, Win16 and Win32) to access I/O ports
freely *unless* a VxD has trapped the I/O port. While many of the I/O ports used
by standard PC devices are indeed trapped by VxDs, Windows does *not*
trap the parallel port I/O ports.

So your application may use code like the above.

Geoff Chappell

unread,
Mar 16, 1999, 3:00:00 AM3/16/99
to
Karen Hazzah wrote in message <7beh30$5...@drn.newsguy.com>...

>In article , p...@uni.de says...
>Win95 allows applications (DOS, Win16 and Win32) to access I/O ports
>freely *unless* a VxD has trapped the I/O port. While many of the I/O
ports used
>by standard PC devices are indeed trapped by VxDs, Windows does *not*
>trap the parallel port I/O ports.

We have discussed this before, but what did we conclude? The VPD does
trap application-level access to parallel ports and then disables this
trapping. However, there are circumstances in which the trapping gets
enabled again.

Does it matter in practice, though? Isn't the usual concern that IN and
OUT instructions are not legal in a Win32 application, so that using
them might result in the system's preemptive termination of the
application? If an IN or OUT instruction traps to the system but gets
emulated, then that will often be fine - and indeed, will often be what
is wanted.

----
Geoff Chappell
Consulting Software Analyst

email: geo...@ozemail.com.au
web: http://www.ozemail.com.au/~geoffch

Richard Van Fossan

unread,
Mar 17, 1999, 3:00:00 AM3/17/99
to
It depends on what you want to do. The parallel ports are quite stupid. They
have very little in the way of ability to tell the O/S that something is
wrong. You don't really need a VxD if you just want to tell when a specific
pin on one of the ports is asserted or disasserted. Simply place your little
test inside a thread that triggers using a multimedia timer. If the pin is
in its "normal" state, don't do anything. If the pin is in an "alert" state,
set a global variable, send a message, etc.

Now, if you're using EPP/or ECP, you'll need your own VxD to use interrupts
and/or DMA.

Richard Van Fossan
Microsoft Developer Support
Patrick Clauberg wrote in message <36d8122b...@129.217.240.1>...
>Hi,


>
>I want to use the parallel port to remote control some applications
>
>right now I do a while(1) loop with
>
>y=_inp(0x3bd);
>
>and for example
>
> if ((y&8)==8)
>to check the error line
>

>which is quite bad


>
>Somebody told me that I have do write a VxD or something
>

0 new messages