2

I'd like to send some instructions while one of pins of LPT port is on.

I was trying to do something like this:

When LPT port 379 (889 dec) is different from dec 120 then stop doing part of code.

while ((PortAccess.Output(889,120))

I don't know how to do it. I was trying to do something with construction:

while ((PortAccess.Equals())

but you need to compare 2 objects..

I suppose it must be very simple solution for this problem.. :)

TheBoyan
  • 6,802
  • 3
  • 45
  • 61
Elfoc
  • 3,649
  • 15
  • 46
  • 57
  • I didn´t found PortAccess in my Framework 4: What library are you using? – nabuchodonossor Jul 18 '11 at 08:32
  • @nabuchodonossor It's a code snippet wrapping inpout32.dll, found in various places like in http://social.msdn.microsoft.com/forums/en-US/csharpgeneral/thread/56ae3e6d-999d-4260-b19c-934775a9206a/ – CharlesB Jul 18 '11 at 08:53

1 Answers1

3

I think you will need PortAccess.Input:

while (PortAccess.Input(889) == 120)
{
   // do stuff
}

This assumes that "PortAccess" is a wrapper around the native inpout32.dll such as described in this tutorial.

Emile
  • 2,200
  • 27
  • 36