Re: COM Ports and Open
- Posted by Igor Kachan <kinz at peterlink.ru> Apr 10, 2001
- 479 views
Ýòî ñîîáùåíèå â ôîðìàòå MIME ñîñòîèò èç íåñêîëüêèõ ÷àñòåé. ------=_NextPart_000_01C0C1DA.522101A0 Hi Florian, >Is there any routine or anything else to > know with wich parameters a COM port is open. Try program from attachment (-: *AS IS*On my machine, there are 4 COM-ports, 1- mouse, 2-modem, so I have tried COM4. If I open("COM4","rb") --- fn = 3, but machine *HANGS UP*, when getc(fn). If I ** open("COM4 96","rb") ** --- fn = 3 and getc(fn) gives 123 49 44 125 -1 -1 -1 If I open("COM4 48","rb") --- fn = - 1 So, I think, open() function opens COM-port at 96, (9600 baud), but this speed must *be* in the command. My machine run Win95 and hangs up both on plain DOS and Win95. All my actions are non-documented, remember please, this area is among BIOS interruptions and Win95 drivers. This is the very rare thing. Regards, Igor Kachan kinz at peterlink.ru ------=_NextPart_000_01C0C1DA.522101A0 Content-Type: application/octet-stream; name="Md.ex" Content-Transfer-Encoding: 7bit Content-Description: Md.ex (EX ) Content-Disposition: attachment; filename="Md.ex" integer fn,a fn=open("COM4 96","rb") ?fn a= system_exec("mode COM4 /status",1) for i=1 to 8 do ? getc(fn) end for close(fn) -- "CON" - the console (screen) -- "AUX" - the serial auxiliary port -- "COM1" - serial port 1 -- "COM2" - serial port 2 -- "PRN" - the printer on the parallel port -- "NUL" - a non-existent device "black hole" ------=_NextPart_000_01C0C1DA.522101A0--