Re: Port LPT + ADA (whta do I wrong?)

From: Brian May (bam_at_snoopy.apana.org.au)
Date: 12/05/04


Date: Sun, 05 Dec 2004 17:45:59 +1100


>>>>> ""Sławo" == "Sławo <- MIR" <mszajac@poczta.onet.pl>> writes:

    "Sławo> Hello! Maybe someone tell me what do I wrong (??), or
    "Sławo> maybe everything is wrong ;-) :/ These are the fragments
    "Sławo> of my code:

Hello.

You seem to be getting high level access confused with low level
access. Possibly a source of this confusion is that the one word
"port" can mean different things (e.g. 1. connection from CPU to IO
card for low level access and 2. physical socket printer plugs
into). Both high level and low level access methods are very
incompatible with each other, and you definitely cannot mix the two as
you have. I am not going to describe the difference here; I suspect
that may not be beneficial at this stage. I recommend reading a good
book on operating systems and operating system drivers.

What operating system are you using? I assume this is not an embedded
system? I assume that it is a Windows based OS (since you are using
Windows definitions)?

I can only assume you require access to the LPT1 printer port. What
you need to use the high level Windows API. Windows will talk to the
hardware for you.

I have never done this myself for LPT1 (my COM serial routines might
be similar, not sure), but I suspect it involves opening "LPT1" as a
file, and reading/writing to this handle you get. There will be other
functions to call to get status information. You do not need to map
directly to any address.

I highly recommend asking the question again, but rephrase it as "How
do I access the LPT port under <insert windows OS here>?". With this
question, I think others will be able to help you better. It is often
better to ask for what you need as opposed to proposing a solution
that may not meet you requirements.

Hope this helps.

-- 
Brian May <bam@snoopy.apana.org.au>


Relevant Pages

  • Re: LPT port, anyone ?
    ... >> pull down a high level, but my sensor doesn't have the capacity. ... > have to reconfigure the port and access the data using IOControl ... electronic equipment is a new field to me. ... just some 5 sensors on one port. ...
    (comp.lang.pascal.delphi.misc)
  • Re: Canonical ACL ordering
    ... Does that combination mean that the high level tools and some high level APIs aren't part of Windows? ... The opinion that Windows does enforce canonical ordering, because that's the only ordering that makes sense and there's no need for denial ACEs, has to remain unchallenged. ... the Unix group permissions don't make much sense outside the ...
    (microsoft.public.win32.programmer.kernel)
  • Loading a Macro
    ... It gives me a warning that due to the high level of ... that I can change the security level. ... In the previous versions of Windows, it just asks me if I ... wanted to load a macro and I just say yes. ...
    (microsoft.public.windowsxp.security_admin)
  • how to I share a printer on windows with sparc
    ... I have basically got samba up and running with share level access and ... windows printer from sparc and print documents from sparc through my ... windows machine with the printer attached? ...
    (comp.unix.solaris)
  • Re: Resources and ACPI
    ... busdma so my knowledge is more of a high level overview. ... jnet0: alloc io port: 00a8 size: 1 ...
    (freebsd-hackers)