1. COM Ports and Open

Hi everyone,
    I asked it before but I got no awnser, so here am I.

Is there any routine or anything else to know with wich parameters a COM
port is open.

Thanks for any feedback

Florian

new topic     » topic index » view message » categorize

2. Re: COM Ports and Open

Ýòî ñîîáùåíèå â ôîðìàòå 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* smile

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--

new topic     » goto parent     » topic index » view message » categorize

3. Re: COM Ports and Open

Hi again Florian,

Sorry my misprint:

getc(fn) gives
123     
49
44
50
125
-1
-1
-1

not
123
49
44
125
-1
-1
-1

Sorry please
Igor Kachan
kinz at peterlik.ru

new topic     » goto parent     » topic index » view message » categorize

4. Re: COM Ports and Open

--------------82224C704A3A0510BB442DCD

Hello Igor,

    on my computer (2 COM-ports), the open("COM1or2","rb") function return -1
each time I try to specify the speed (9600, 4800, 2400, 1200 or 600 bauds)
but works correctly without speed specification.

Is there any rule or to know what must be filled in?

Thanks for your help and sorry for the english.

Florian

> Hi Florian,
>
> Try program from attachment  (-: *AS IS* smile
>
> 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
>
>

--------------82224C704A3A0510BB442DCD
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>

<p>
Hello Igor,</p>

<p>
&nbsp;&nbsp;&nbsp; on my computer (2 COM-ports), the open("COM1or2","rb")
function return -1 each time I try to specify the speed (9600, 4800, 2400,
1200 or 600 bauds) but works correctly without speed specification.</p>

<p>
Is there any rule or to know what must be filled in?</p>

<br>Thanks for your help and sorry for the english.
<p>Florian
<blockquote TYPE=CITE><i>Hi Florian,</i><i></i>
<p><i>Try program from attachment&nbsp; (-: *AS IS* smile</i><i></i>
<p><i>On my machine, there are 4 COM-ports,</i>
<br><i>1- mouse, 2-modem, so I have tried COM4.</i><i></i>
<p><i>If I open("COM4","rb") --- fn = 3,</i>
<br><i>but machine *HANGS UP*, when getc(fn).</i><i></i>
<p><i>If I&nbsp; ** open("COM4 96","rb") ** --- fn = 3</i>
<br><i>and getc(fn) gives</i><i></i>
<p><i>123</i>
<br><i>49</i>
<br><i>44</i>
<br><i>125</i>
<br><i>-1</i>
<br><i>-1</i>
<br><i>-1</i><i></i>
<p><i>If I open("COM4 48","rb") --- fn = - 1</i>
<br><i>So, I think, open() function opens</i>
<br><i>COM-port at 96, (9600 baud), but</i>
<br><i>this speed must *be* in the command.</i>
<br><i>My machine run Win95 and hangs up</i>
<br><i>both on plain DOS and Win95.</i><i></i>
<p><i>All my actions are non-documented,</i>
<br><i>remember please, this area is among</i>
<br><i>BIOS interruptions and Win95 drivers.</i><i></i>
<p><i>This is the very rare thing.</i><i></i>
<p><i>Regards,</i>
<br><i>Igor Kachan</i>
<br><i>kinz at peterlink.ru</i>
<br><i></i>&nbsp;
<br>&nbsp;</blockquote>

--------------82224C704A3A0510BB442DCD--

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu