Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FOPEN() on COM port under DOS
Message
From
11/04/1998 15:54:30
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
FOPEN() on COM port under DOS
Miscellaneous
Thread ID:
00091336
Message ID:
00091336
Views:
92
Hi everybody!

I have to communicate under DOS on comports!!
So, I have the old FOX2.6DOS, but i never used this features. The two machines are installed correctly, I tested the phisical connection with Norton Commander, and the connection was good.
I used the following program schema to send a character string over the cable: (simplified)
Sender:
m.string="anything"
m.handle=fopen("COM2",12)
if (m.handle)>-1
m.count=fwrite(m.handle,m.string)
=fclose(m.handle)
endif

Acceptor:
m.handle=fopen("COM2",12)
if (m.handle)>-1
m.string=fread(m.handle)
=fclose(m.handle)
endif

I started the acceptor program first on the other machine. The port openings are always succesfull, the handle numbers are always positive. But on the sender machine at the fwrite() row, a system write error occurs, stating : Errror writing the port COM2
I issued the Mode Com2 9600,N,8,1 also all the two machines, but nothing changes.

Can someone help me?

TIA

BB
Next
Reply
Map
View

Click here to load this message in the networking platform