Results 1 to 3 of 3

Thread: MSComm Device Connectivity

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Location
    England
    Posts
    135

    MSComm Device Connectivity

    Hi,

    I have written a VB app which connects perfectly well to the device I am trying to connect with, proividing the device is on and connected before I run the software.

    The question is this : is there a way of making the application accept incoming Comm traffic automatically without having to close and open the port again once the device is connected. I would like to be able to connect and disconnect the device whilst the software runs as it wont always be needed.

    I hope it's clear but let me know if you need any other info - thanks in advance.
    Cheers,
    Sparky.

  2. #2
    Fanatic Member
    Join Date
    Aug 2005
    Location
    Wisconsin
    Posts
    788

    Re: MSComm Device Connectivity

    In the program I use MSComm. I put this code in a function in the module:
    VB Code:
    1. Comm1.CommPort = Val(CommPort)
    2. Comm1.Settings = Params
    3. Comm1.InputLen = 8
    4. Comm1.PortOpen = True
    5. Comm1.Output = Signal
    6. Comm1.PortOpen = False
    and call it when I want to activate the device.

    Hope it helps....

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Location
    England
    Posts
    135

    Re: MSComm Device Connectivity

    Thanks for replying,

    I can get the connection working but I was just wondering if there was a way of avoiding having to call it each time I want to connect the device. i.e. is there a way of having an "always listening" comm port?

    If I disconnect the device I dont want to have to re-activate the comm port each time. Do you know if there is specifically a setting which affects this?

    Thanks for taking an interest.
    Sparky.

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