Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > sci.electronics.design > #485255

Re: Windows USB question

From John Devereux <john@devereux.me.uk>
Newsgroups sci.electronics.design
Subject Re: Windows USB question
Date 2017-11-15 07:03 +0000
Message-ID <87po8kf2ha.fsf@devereux.me.uk> (permalink)
References <ekpj0d1ovdd578gkp99rpo90vuv60i6h34@4ax.com> <32d3477f-ddf2-45c7-80e4-0108933742ca@googlegroups.com> <k91k0dt4jr6k1ppv40q591ut31nlcnptmo@4ax.com> <2364c479-1318-4b49-8b5f-5ca0d3c08dde@googlegroups.com> <igsk0dlv4qn1bev2cu9rf68quhesii4bf8@4ax.com>

Show all headers | View raw


John Larkin <jjlarkin@highlandtechnology.com> writes:

> On Mon, 13 Nov 2017 13:07:26 -0800 (PST), Lasse Langwadt Christensen
> <langwadt@fonz.dk> wrote:
>
>>Den mandag den 13. november 2017 kl. 21.51.33 UTC+1 skrev John Larkin:
>>> On Mon, 13 Nov 2017 12:43:38 -0800 (PST), Michael Elwood
>>> <mkelwoodut@gmail.com> wrote:
>>> 
>>> >John, this doesn't answer your question, but scanning the attached
>>> > port devices is not ridiculously messy. I wrote some code that
>>> > uses the Windows SetupAPI to scan the Ports Device Class, find
>>> > the desired device by matching to desired friendly name, then
>>> > extract the COM port number; a few dozen lines of C code. I can
>>> > send you the code if you're interested.
>>> >
>>> >With best regards,
>>> >
>>> >MKE
>>> >
>>> 
>>> 
>>> The code's not that hard, but we plug and unplug cables during tests,
>>> and we may get comm errors, so all sorts of locations in a program may
>>> have to re-scan the ports. And we may test multiple units, so it would
>>> be nice if we knew which unit a physical USB cable connects to.
>>
>>the same ftdi cable should get the same com port number every time you plug it in, it should be based on serial number 
>>
>
> I took one USB-serial adapter and plugged it into all open ports on my
> PC and its USB hub, one at a time. It started at COM3 and worked its
> way up one count at a time, independent of where it was plugged, but
> in time order of plugging in. If I unplugged it, the COMn port
> disappeared from the device manager. If I then plugged it into any
> open port, it came up as the com number that it was when I first
> plugged it in there. A physical USB port was bound to a com number by
> my plugging-in sequence. I don't now if that binding will survive a
> reboot... I'll try that.

Read that app note. I think they do that in the absence of an embedded
FTDI serial number (e.g. if you reprogram it with your own identifier).

>
> The first plug-in event created COM3, and I made it up to COM10.
>
> COM10 has to be opened in a program as device "\\.\COM10"

-- 

John Devereux

Back to sci.electronics.design | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Windows USB question John Larkin <jjlarkin@highland_snip_technology.com> - 2017-11-13 10:43 -0800
  Re: Windows USB question Lasse Langwadt Christensen <langwadt@fonz.dk> - 2017-11-13 12:11 -0800
  Re: Windows USB question George Herold <gherold@teachspin.com> - 2017-11-13 12:16 -0800
    Re: Windows USB question rickman <gnuarm@gmail.com> - 2017-11-15 10:11 -0500
  Re: Windows USB question Michael Elwood <mkelwoodut@gmail.com> - 2017-11-13 12:43 -0800
    Re: Windows USB question John Larkin <jjlarkin@highland_snip_technology.com> - 2017-11-13 12:51 -0800
      Re: Windows USB question Lasse Langwadt Christensen <langwadt@fonz.dk> - 2017-11-13 13:07 -0800
        Re: Windows USB question Don Kuenz <g@crcomp.net> - 2017-11-14 00:04 +0000
        Re: Windows USB question John Larkin <jjlarkin@highlandtechnology.com> - 2017-11-13 20:44 -0800
          Re: Windows USB question John Devereux <john@devereux.me.uk> - 2017-11-15 07:03 +0000
  Re: Windows USB question M Philbrook <jamie_ka1lpa@charter.net> - 2017-11-13 17:56 -0500
    Re: Windows USB question John Larkin <jjlarkin@highland_snip_technology.com> - 2017-11-13 15:21 -0800
  Re: Windows USB question TTman <kraken.sankey@gmail.com> - 2017-11-13 23:44 +0000
  Re: Windows USB question David Brown <david.brown@hesbynett.no> - 2017-11-14 09:42 +0100
    Re: Windows USB question Don Kuenz <g@crcomp.net> - 2017-11-14 18:00 +0000
  Re: Windows USB question Jeff Liebermann <jeffl@cruzio.com> - 2017-11-14 10:57 -0800
    Re: Windows USB question Jim Thompson <To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> - 2017-11-14 12:12 -0700
  Re: Windows USB question Robert Roland <fake@ddress.no> - 2017-11-14 19:58 +0100

csiph-web