Solved

Check for actual COM port device connectivity

Posted on 2008-09-29
7
773 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

762 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

21 Experts available now in Live!

Get 1:1 Help Now