You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
Presently I am doing one small project which envolve LPT1 port. I want to know is Power Basic support parellel port programming.
Can any one give me detailes.
Originally posted by Code Warrior: Dear Bob Zale,
My real name is Deshmukh which is below the Code Warrior.
I understand. But I'd be willing to place a small wager that you have two names -- a first name and a last name (surname/family name). You need to register under your name, not under "Code Warrior".
To start parallel port programming you need to know how does
the parallel port working.
You can start reading from here: www.lvr.com/parport.htm .
I think this is the best resource on computer interfaces.
In PowerBASIC you may use these commands: INP and OUT.
INP - return a byte value from port
OUT - write a byte value to port
You can also use BIT function to test individual bits.
Dear Aslan,
Thank you very much for giving me such a nice link. Where are you from, can you tell me some thing about your self. You can write directly to my email ID.
Bye
Be careful when trying to us INP and OUT in some operating systems.
If you use these functions in a DOS-VDM in OS/2, for example, and
something goes wrong with the port connection, it can become very
hard to debug or handle the resulting mess for your program.
That problem was addressed in the old MIcrosoft PD7 compiler which
can produce both native DOS and OS/2 executables. In this case the
function only worked in the DOS compile runs. The INP and OUT fucntion
wasn't even normally available in the compiler for use in OS/2 native.
I have no experience in the WIN world at all. However, we read that
direct access to the ports is not permited at some point in WIN-NT
and upward. In order to gain such access, writing your own drivers
seems to be possible, but my guess is that anyone who does work at
the direct hardware level still has to consider things. If you yank
the cable or something goes wrong with the printer or whatever is
on that port, you'll have to provide a graceful way to recover from
that error as the programmer.
You can, by the way, set up a DOS-VDM in OS/2 so that it does give
the DOS application direct access to the hardware. And, as you may
guess of the INP and OUT issues I mention above, some DOS programs
do require that when used with OS/2. But if you do decide to use
or write programs which do these things, unhandled or badly handled
programs that do this can seriously lock up a box including other
programs running on it at the time.
Newer though that hardware programming under OS/2 with DOS-VDM could
cause troubles.I have never worked under OS/2,but anyway - well informative.
I have hardware control DOS project and I'm thinking to port it to QNX platform.
Now, I'm in the stage of reading documentation on QNX..... and see that almost everything
can be done with Watcom C compiler. It's pity. Just don't want to switch to C
Thanks all of you for replying to my posting. I also dont know much about WIN programming (But started learning) and I also heard that WIN does not allow direct access to I/O ports. Can any one tell me why WIN does not allow direct access to I/O ports or hardware.
Bye
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment