Jump to content
spaghetti_developer

reset the Serial Port enumerator

Recommended Posts

Hi guys,

Every time I connect RS232/USB converter to my USB port, windows sets a new COM number to my device. Now this number became too high and, even though it shouldn't create problems, I would like to reset it and start again from COM2 and go on (the COM1 is the physical RS232 on board of my desktop). Do you know how can I reset this enumerator?

Thank you in advance.

Share this post


Link to post
Share on other sites

Thank you asbo for the links, I've already read them and I've done a tool that do exactly what it is described on that posts automatically. I think it can be useful for the other users of this group. My software is specific for FTDI converter but I think it can be adapted for any other type of converter easily.

Attached the zip with my code!

COMPortsEnumCleaner.zip

Share this post


Link to post
Share on other sites

I've made a new version of this software, the difference of this one from the previous is that I've introduced a recursive function to clean the FTDI registry keys instead of the step-by-step clean function which presume you have to know the number of indent keys inside the root key you have passed. I leaved both of the solutions on the project to let you to choose which solution is better for your usage. Switch from one solution to the other is easy, simply change the function FTDI - regKeyCleaner_recursively with the FTDI - regKeyCleaner_byStep.

The feed-backs are welcome.

COMPortsEnumCleaner_V2.zip

Share this post


Link to post
Share on other sites

Well, I'd read that document before developed my software. In the document is described how to clean the registry key manually, but how about cleans hundreds of COM ports assigned? It's a very boring job, so I developed a software which does that, automatically.

Share this post


Link to post
Share on other sites

Hi, 

           Thank you, for project but I have a problem. When ı run your program. This error appear. 

"Possible reason(s):

LabVIEW:  Remote registry access denied."

Share this post


Link to post
Share on other sites
2 hours ago, Mustafa Acar said:

Hi, 

           Thank you, for project but I have a problem. When ı run your program. This error appear. 

"Possible reason(s):

LabVIEW:  Remote registry access denied."

Run the program as Administrator.

Share this post


Link to post
Share on other sites
3 minutes ago, Mustafa Acar said:

Actually, I want use in my VI . How can I do it ?

What is your issue?

Put COMPorts_EnumCleaner.vi onto your block diagram and you are ready to go.

In all cases you need Administrator privileges. If you want to run the code from within LabVIEW (by running the VI), you'll have to start LabVIEW as Administrator too.

Share this post


Link to post
Share on other sites

@spaghetti_developer

Thank you for your sharing. 

 

I do not think i can open your VI project which is named as PortsCleaner? It said that "Open Registry Key.vi" has error. Do you know what's wrong?

Share this post


Link to post
Share on other sites

The Open Registry Key.vi is a VI installed with LabVIEW.  It is part of the vi.lib.  If this VI is broken then there is probably something wrong with your install of LabVIEW and you should probably repair it.  I opened the posted code and nothing is broken.

Share this post


Link to post
Share on other sites

Join the conversation

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

Guest
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.