home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ogicse!uwm.edu!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!csn!dashs!serls
- From: serls@dashs.denver.co.us (Dave Serls)
- Newsgroups: comp.os.os2.programmer
- Subject: Re: ASK: How to send a character to serial port from OS/2 pro
- Message-ID: <721660632snx@dashs.denver.co.us>
- Date: 13 Nov 92 13:17:12 GMT
- Article-I.D.: dashs.721660632snx
- References: <11NOV92.15133100@wl.aecl.ca>
- Distribution: world
- Organization: Sorry Software
- Lines: 24
-
- tranx@wl.aecl.ca writes in article <11NOV92.15133100@wl.aecl.ca>:
- >
- > A: I tried to write a program to communicate with my instrument through
- > a serial port(eg. COM1). I have C Set/ 2 and Work Frame but I couldn't
- > find a system call that allows me to "open COM1: for example" and return
- > a handle. So that I can use this handle to send a character to this serial
- > port. Would you like to help me out?
- >
- There is a control program call DosOpen which allows one to open a COM
- port. It is opened more or less like a file. You may also need to call
- DosDevIOCtl to condition to port to your requirements. It may also be
- beneficial to put the DosRead/DosWrite code in separate threads to
- allow the rest of your program to process while the COM port code
- is blocked on a read.
-
- The Ray Duncan book 'Advanced OS/2 Programming' ISBN: 1-55615-045-8,
- altough written fro OS/2 1.x, still contains valuable and valid
- examples in this area.
-
- --
- ============================================================================
- Dave Serls 303-973-6120
- serls@dashs.denver.co.us Sorry Software
- ============================================================================
-