M
Mota
Hi;
How to open a COM,such as com3 that my modem is connected to,to print and
read something from it.I use this syntax to send a Hayes command to modem
and get its reply but it doesnt work:
Open "COM3:" For Output As #1
Print #1, "ATI" 'ATI is a standard Hayes command to return modem
information
Close #1
Open "COM3:" For Input As #1
Input #1, strResponse
Msgbox StrResponse
Close #1
When i use this syntax,system hangs.Deleting the line: Input #1,StrResponse
solves the hanging problem,but obviously does nothing for me.In the other
hand,Opening it for Random,rather than reopening and closing it, and trying
to read from it causes Run time Error 54 "Bad File Mode".I dont know
why.So,How to send a Hayes command to modem and get its response?
Are serial ports UnReadable?!!!Can anyone please help me?
Thank you in advance for ur help.
How to open a COM,such as com3 that my modem is connected to,to print and
read something from it.I use this syntax to send a Hayes command to modem
and get its reply but it doesnt work:
Open "COM3:" For Output As #1
Print #1, "ATI" 'ATI is a standard Hayes command to return modem
information
Close #1
Open "COM3:" For Input As #1
Input #1, strResponse
Msgbox StrResponse
Close #1
When i use this syntax,system hangs.Deleting the line: Input #1,StrResponse
solves the hanging problem,but obviously does nothing for me.In the other
hand,Opening it for Random,rather than reopening and closing it, and trying
to read from it causes Run time Error 54 "Bad File Mode".I dont know
why.So,How to send a Hayes command to modem and get its response?
Are serial ports UnReadable?!!!Can anyone please help me?
Thank you in advance for ur help.