Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COM3 and COM4 from QBASIC

Status
Not open for further replies.

NiallMac

IS-IT--Management
Feb 15, 2000
9
GB
Is it possible to access COM3 and COM4 from within either QBASIC or QuickBASIC Extended V7.1<br>
<br>
I am trying to write some test software that must access all 4 COM ports and be able to use them simultaneously.<br>
<br>
Thanks <br>
Niall Macdonald<br>
<br>
<A HREF="mailto:nmacdonald@pc-pos.co.uk">nmacdonald@pc-pos.co.uk</A><br>

 
You can access them with the INP function and write to them with the OUT statement but you have to know their port addresses (not so bad when you are working on your own machine and can look them up in Device Manager, but it would be a bugger trying to develop an app for others, since basic doesn't provide a way to find the port addresses by name (COMn, etc.).<br>
I'll look around and see what I can find.
 
Let me check my recent QB downloads; think I remember seeing one of the demos talking about COM ports above 2...will see if I can come up with anything for you <p>-Robherc<br><a href=mailto:robherc@netzero.net>robherc@netzero.net</a><br><a href= > </a><br>*nix installation & program collector/reseller. Contact me if you think you've got one that I don't :)
 
I know it's possible. I've seen Visual Basic extentions designed to do the same thing. Generally, if VB can do it today, QB could do it fourteen years ago.<br>
We just have to remember.... ahh! it's coming to me... check 65536 port addresses for a response! Naw, that was kind of inefficient on an 8086.<br>
But the machines are faster now and we can eliminate most of those 65536 checks. We could find the ports in less than a second.<br>
I'll keep working on it and post a good answer (when I find one). Robherc, please do the same.<br>

 
Hmmm...how about a generic get from each port address? (they're all listed in the help manual portion of the qb 4.5 IDE)...there's only a couple thousand of 'em; so sending 1 char to each; then retrieving any responses to give you a list of active ports shouldn't take over 2-3 sec ;) <p>-Robherc<br><a href=mailto:robherc@netzero.net>robherc@netzero.net</a><br><a href= shared.freeservers.com/searchmaster.html>SearchMaster Interface...11-in-1</a><br>Wanting to learn Assembler; please e-mail me any tutorials or links for it that are useful to you :)
 
I don't see an easy way to do this. Rob, have you had any luck?
 
The problem is irq sharing by com ports in PCs. com ports 1 and 3 do share irq and also 2 and 4. That is why even in windows once you use irq 1 you can't also use irq 3. To do so requires special software work around made by third parties. [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top