-
PortOpen
Hi!
I have the following problem with my code: when it goes through MSComm1.portopen=true, there is an error message "Port already open". If I step over that line, later, when the code is MSCOmm1.output=Chr$(stx),where Const stx=&H2, the error message is "Operation valid only when the port is open".
If I put my cursor over MScomm1.portopen, the variable is said to be False...I use the exact same code in an other form and it works very well.
Please help me!
Thanks
Valérie Pepin
-
Re: PortOpen
Maybe the COM port is used by another application (...or MSComm object in your app).
-
Re: PortOpen
So that means I can not use the MSComm control in 2 different forms within the same Project...?
Valérie Pepin
-
Re: PortOpen
You can do that, but you cannot open the same COM port with two
different MSComm controls.
-
Re: PortOpen
I dont know why it does it but i have had the same problem, It may be that we are both trying to write to the port outside a control. There is a good program at http://www.ontrak.net/visual.htm which a friend told me about and i have got this working
good luck
Jason
-
Re: PortOpen
Unless you want to access two different serial ports at the same time, you should only have one MsComm control in your project. You may want to move this to a separate (non-visible) form which is loaded at the beginning of the program, and then not unloaded until you exit.