Jump to content

COM port listing


Graeme

Recommended Posts

Hi all,

I have a requirement to generate a list of all COM ports present on the localhost. Twist is, the list should be in numerical order, not the alphabetical(ish) order that the VISA Find Resource function returns. I have a VI or two that does the job but, as ever, a bit clunky and prone to failure under some circumstances. Can't help feeling there's a neat way to do it, it's just that I can't see it. It would be great if a solution could cope with the VISA Find Resource function returning the raw VISA name (e.g. ASRL2::INSTR) or its machine alias (e.g. COM2).

In addition, asking the VISA Find Resource function to return ASRL?+::INSTR returns all COM ports but the parallel port (LPT1) too (ASRL10::INSTR). For the life of me I can't come up with a regular expression that excludes the parallel port. Thoughts most welcome.

Regards.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.