Solved

Check for actual COM port device connectivity

Posted on 2008-09-29
7
777 Views
Last Modified: 2013-12-26
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
Comment
Question by:tvtech
  • 4
  • 3
7 Comments
 
LVL 17

Expert Comment

by:CSecurity
ID: 22603319
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
 

Author Comment

by:tvtech
ID: 22603448
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
 
LVL 17

Expert Comment

by:CSecurity
ID: 22603468
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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:tvtech
ID: 22603491
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
 
LVL 17

Accepted Solution

by:
CSecurity earned 350 total points
ID: 22603503
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
 

Author Comment

by:tvtech
ID: 22699786
Actually, yes it is possible. Thanks anyway.
0
 

Author Comment

by:tvtech
ID: 23765919
Moderator, please delete this question, as I found the answer elsewhere.

Thanks.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question