home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / os2 / programm / 6400 < prev    next >
Encoding:
Internet Message Format  |  1992-11-14  |  1.7 KB

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