General information
Title:
FOPEN() on COM port under DOS
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only