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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open Command

Status
Not open for further replies.

kaplana

Programmer
Jun 28, 2000
6
US
Is there a C opening command equivalent to &quot;OPEN &quot;COM2:9600,O,8,1&quot;&nbsp;&nbsp;in QBASIC language?<br>
 
Nope... Not unless you use a 3rd party libary that provides these functions. Standard C does not. Most compilers have some sort of function to access IO ports. Usually something like outp() and inp() for readin' and writin' to IO ports. Using these you could write your own COM port handler.... <p> <br><a href=mailto:Kim_Christensen@telus.net>Kim_Christensen@telus.net</a><br><a href= Page</a><br>
 
If you want to send data to the com ports using c you have to use the bios.h header file.&nbsp;&nbsp;It usually is specific to the compiler and i have only found it on the old dos or command line compilers.&nbsp;&nbsp;It might also be in a newer gui compiler but you would have to check. The function you want to use is usually called _bios_serialcom().&nbsp;&nbsp;It interface directely to the bios and i think does not interface with the os, not positive though.&nbsp;&nbsp;I know for sure that it is included in the borland 3.x dos c/c++ compiler i have been using for class for some time now.&nbsp;&nbsp;Exactly how to use the function is in C: The complete reference by&nbsp;&nbsp;Hebert Schildt, its only a couple pages so you can go to the library and photocopy it, on page 390.&nbsp;&nbsp;Tells you baud rate, how to set the parity bit etc..&nbsp;&nbsp;I think if you check borlands website the have a free command line base compiler which has this library.&nbsp;&nbsp;good luck, the hardest is modifing each bit,<br><br>&nbsp; <p>moses<br><a href=mailto:tmoses@iname.com>tmoses@iname.com</a><br><a href= my site</a><br>"In the beginning there was HTML, and it was good"<br>
by Nick Heinle, Designing with JavaScript<br>
<br>
<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top