Results 1 to 9 of 9

Thread: RS232 communication

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2006
    Posts
    39

    RS232 communication

    I have a VB6 application that needs to open a COM port and output a string. However, it appears that another process has the COM port open at the time I want to open it. I am using an MSComm control, and of course, when I try to open the port already in use an error is generated.

    Does anyone know a way where I can output a string from my VB6 application when another thread has the port in use?

    Thanks in advance for the help.

  2. #2
    PowerPoster CDRIVE's Avatar
    Join Date
    Jul 2007
    Posts
    2,620

    Re: RS232 communication

    Are you using Dialup or are you posting here using broadband?
    <--- Did someone help you? Please rate their post. The little green squares make us feel really smart!
    If topic has been resolved, please pull down the Thread Tools & mark it Resolved.


    Is VB consuming your life, and is that a bad thing??

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2006
    Posts
    39

    Re: RS232 communication

    Interesting question. I'll take the non-responses to mean that this is not possible with VB6.

  4. #4
    Addicted Member aa9gg's Avatar
    Join Date
    Apr 2009
    Location
    Chicagoland
    Posts
    184

    Re: RS232 communication

    if your on dial-up...that's probably who(your modem) has the port control. Some where here on the net is VBcode to detect free com ports.

  5. #5
    PowerPoster CDRIVE's Avatar
    Join Date
    Jul 2007
    Posts
    2,620

    Re: RS232 communication

    Quote Originally Posted by jjsomer View Post
    Interesting question. I'll take the non-responses to mean that this is not possible with VB6.
    I take it that you know that another app has access to the port. The answer to your question is no. I doubt that VBNET will allow it either, as I believe this issue is more of a Windows convention than a VB issue.
    <--- Did someone help you? Please rate their post. The little green squares make us feel really smart!
    If topic has been resolved, please pull down the Thread Tools & mark it Resolved.


    Is VB consuming your life, and is that a bad thing??

  6. #6
    PowerPoster CDRIVE's Avatar
    Join Date
    Jul 2007
    Posts
    2,620

    Re: RS232 communication

    What do you want your app to do after it accesses the port? Perhaps there's another solution, like accessing a different port?
    Last edited by CDRIVE; Jun 25th, 2009 at 06:14 PM.
    <--- Did someone help you? Please rate their post. The little green squares make us feel really smart!
    If topic has been resolved, please pull down the Thread Tools & mark it Resolved.


    Is VB consuming your life, and is that a bad thing??

  7. #7
    Member
    Join Date
    Nov 2007
    Posts
    48

    Re: RS232 communication

    Once the comm port is open, it can not be open again by another program. The first program have to close it before it can re open again.

    Unlike files which can open as share. Comm port always open for 2 ways communication. You need a 2nd comm port in your case.

  8. #8
    Addicted Member arunb's Avatar
    Join Date
    Jul 2005
    Posts
    131

    Re: RS232 communication

    you cannot open the same port twice !!!

    there are several ways you can achieve the same result

    1. what you can do is open the port from one app, then when the second app wants to open it, it must send a command to the first app to close the port, now the port can be opened by the second app.

    2. Alternatively make a common program that receives instructions from both the apps, the common program (called 'comm. interface') can stream data to either of these apps. Of course you need to establish a system of communications between the apps and the 'comm interface' program.

    thanks
    ar

  9. #9
    PowerPoster CDRIVE's Avatar
    Join Date
    Jul 2007
    Posts
    2,620

    Re: RS232 communication

    This would be a bit of work... but if you create an app with an Browser Control & DialUp procedure on it, then you will have full control of the port while on line.
    <--- Did someone help you? Please rate their post. The little green squares make us feel really smart!
    If topic has been resolved, please pull down the Thread Tools & mark it Resolved.


    Is VB consuming your life, and is that a bad thing??

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width