Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comms port already open

Status
Not open for further replies.

GarryC

IS-IT--Management
Aug 14, 2000
36
0
0
NZ
Hi, I am going around the twist here. Using the following I get a 'port already open' when I try to open the port. On the very next line I get a message saying 'operation is valid only when the port is open' If I try to close the port form the command line with PortOpen=.F. I get 'type mismatch' Can anybody tell me whats going on?

oCom = CREATEOBJECT("MSCOMMLib.MSComm")
oCom.CommPort = 1
oCom.Settings = "9600,N,8,1"
oCom.InputLen = 0
oCom.PortOpen=.T.
oCom.Output = "BRMR00000"

Garry.
 
GarryC

I tested your code, and I cannot duplicate your error. Is it possible that the port is already opened? The PortOpen either sets or tests the port status, what happens when you test it?

Code:
oCom = Createobject("MSCOMMLib.MSComm")
oCom.CommPort = 1
oCom.Settings = "9600,N,8,1"
oCom.InputLen = 0
If oCom.PortOpen
	Messagebox("Port is already opened")
Else
	Messagebox("Port is closed")
	oCom.PortOpen = .T.
Endif
oCom.Output = "BRMR00000"



Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Hi Mike, Found my problem thanks. Active sync running in the background for a long gone palm pilot and keeping the port available. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top