Author Topic: I have virtual ports some may not be connected to anything  (Read 14315 times)

kp

  • Member
  • ***
  • Posts: 3
I have virtual ports some may not be connected to anything
« on: April 30, 2011, 12:38:58 am »
I need to try to open the virtual serial ports in vb net code and catch the error to see if anything is there at all.
it works but takes a long time about 15 to 20 seconds per virtual port to get catch error and go to the next one.
Is there a way to make this faster?
thanks in advance

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: I have virtual ports some may not be connected to anything
« Reply #1 on: April 30, 2011, 08:32:22 am »
Did you use the SerialPort.GetPortNames method to get valid port names?

Jan

kp

  • Member
  • ***
  • Posts: 3
Re: I have virtual ports some may not be connected to anything
« Reply #2 on: April 30, 2011, 11:18:16 am »
these virtual ports were installed with a "ethernet to serial" so that they will stay somewhere in the computer
even if the devices are not connected.  I want to find all connected (the ethernet to serial)
 devices faster. I have 5 com ports when I  get the serial port names, but nothing has to be there(it still gest the com ports names
 but no ethernet to serial devices). In this case I started my program and found out how long it takes to get all "real" serial ports- ones that have the ethernet to serial device connected at this time. I had no devices connected. it was 15 to 20 seconds each to attemp to serialport.open before Catching the error. I want to make this process faster. Please ask any question.
   

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: I have virtual ports some may not be connected to anything
« Reply #3 on: May 02, 2011, 10:22:16 am »
The ports are present but you can't open them unless something is attached?

What ethernet to serial device are you using?

Jan

kp

  • Member
  • ***
  • Posts: 3
Re: I have virtual ports some may not be connected to anything
« Reply #4 on: May 02, 2011, 11:11:28 am »
Moxa, and  Gw212 is another one.  Nothing is connected, no ethernet to serial. and no real com ports.
I am looking for a faster way to find out in code if something is connected.
Thanks
 

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: I have virtual ports some may not be connected to anything
« Reply #5 on: May 02, 2011, 11:18:51 am »
If you're looking for a specific device, one thing that can help is to save the port used last time and try that first.

Jan