
Visit our shop for nerds in control lifestyle products.
- PC reliability?
- Windows, real time
- PID loops
- PCs vs. PLCs
- Replacing people
- MS 'monopoly'?
- Software quality
- Where do we go from here?
- Why pay?
is from the wrong kind of tree."
-- Professor W.
www.control.com/rss/
To get a personalized feed, become a member at no cost.
i'm doing a project in VB where i'm using comm port but when i try to open the port it gives the error as port already open though the port is not open.
my source code is as follows:
Private Sub Form_Load()
Dim str As String
MSComm1.CommPort = 1
MSComm1.Settings = "9600,n,8,1"
MSComm1.InputLen = 0
MSComm1.PortOpen = True
Text1.Text = "sending: hello"
MSComm1.Output = "hello"
Do
DoEvents
Loop Until MSComm1.InBufferCount = 0
str = MSComm1.Input
Text1.Text = "recived:" + str
MsgBox "recieved" + str
MSComm1.PortOpen = False
End Sub
I tried you code and it worked fine in my computer. You may have that port being used by an other program.
Try using the other serial port.
good luck!!
bye
Jim
Gregorio Cavazos C.
I hope ur problem is solved.I have a doubt to ask.U have sent text 'HELLO' to a port, what's the command i use in hyperterminal to read the string 'HELLO'.
Regards,
Nile
If in a previous test run of your code, the port was opened but an error halted execution thereafter, the port will still be open. If this is your problem, closing the VB IDE will close the port...
MSComm1.PortOpen = True
line, I put in a msgbox and ask for the status of the port.
Example:
msgbox("The port is open " & MSComm1.PortOpen)
when that message comes up, it says that the port is False. Then the very next line is
MSComm1.PortOpen = True
and then I get the error saying that the port is already open?!?!?!?!?!
HELP!!!!
need your help...
Joe
Please give me some insights.
Thanks!
1> Irda driver
2> bluetooth driver
3> nokia pc suite
check this.
Regards,
Shailesh C Patel
FDC - Control Systems And Instrumentation
Reliance Engineering Associates(P) Ltd.
Also, are you sure a modem dialer isn't using that port? Check out your "network connections" entries. Otehrwise, do a search of the Windows registry for strings COM1 or COM2 and maybe you'll find some tool claiming it.
- LynnL, www.digi.com
Absolutely spot on. Found the COM4 I needed assigned to another device even though it wasn't using it, it was talking to it all the time. I deleted the COM4 references and hardware assignment to the device that was hijacking it and rebooted and woohoo the port remained closed and is accessible to VB again... Thank you.
- Autodesk to buy Algor, analysis and simulation software
- Pushbuttons, in 3 sizes, change colors
- Software tool for modeling and simulation shaped by organizations in 85 countries
- Instrumentation: LXI Consortium releases Revision 1.3
- Gantry-Style Automated Accumulation
- Strongarm Designs unveiled the D755 line of industrially hardened computers, with help from Dell
- Arctic HMI: Human-machine interface performs in harsh Arctic Circle conditions
- From IT integration to panel building, one mine at a time
- HMIs: Kontron delivers new thin clients for industry
- HMIs: How Web access technologies affect visualization efforts
Patronize our advertisers!




