• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 818
  • Last Modified:

Check for actual COM port device connectivity

Hi,

Does anyone know a way to test to see if a device is actually connected to a given COM port?
The following code will return OK, as the port is open, but I need to know if a device is actually plugged in, not just an open port.

Thanks.

    If MSComm1.PortOpen = True Then
        MSComm1.Output = "e"
    Else
        MsgBox "Com port is not open...", vbExclamation, "Error"
    End If
0
tvtech
Asked:
tvtech
  • 4
  • 3
1 Solution
 
CSecurityCommented:
Your device should have a functionality like Pinging, you need to send a Ping request and if you received answer it means device is connected, no other method is available. With MSCOMM you can only understand if port is open or not.

0
 
tvtechAuthor Commented:
CSecurity, thanks, but no, there won't be any pinging, as the serial device is a trigger from a camera. It is totally passive, unless the camera is connected, however, the serial port does see the trigger device when it's connected to the port.
0
 
CSecurityCommented:
So when device connects, it sends some data to COM Port, you need to open and look for that data, if any data came through COM port, it means device is connected
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
tvtechAuthor Commented:
Sorry, this is a bit hard to explain  ... the device is totally passive, unless the camera is plugged into it and is triggered by a foot switch. As the people who setup the device will not actually be using the camera, there is no way to get them to confirm anything.

I need a way to auto-detect the actual existence of the device (With, or without the camera being plugged in) just by plugging it into the serial port.
0
 
CSecurityCommented:
It's not possible, look at here:
http://electronicdesign.com/Articles/Index.cfm?AD=1&ArticleID=6233

Your device should send signals to make you able detect it in PC
0
 
tvtechAuthor Commented:
Actually, yes it is possible. Thanks anyway.
0
 
tvtechAuthor Commented:
Moderator, please delete this question, as I found the answer elsewhere.

Thanks.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now