Solved

Check for actual COM port device connectivity

Posted on 2008-09-29
7
774 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

920 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now