We use this where I work.
I had written a LabVIEW program to remove Registry entries and reset the bitfield for a production machine we had, but things were still iffy, so we moved over to this program. I don't know how well it will work via a command line. We just run it manually on ocassion.
Thanks, elrathia. I'll look into it. Do you know if after removing the (non-connected) devices, will LabView (VISA) be able to see a re-used port - when a new device with a different S/N is installed - without running MAX to manually assign that previously used port number to an ASRL? (Sorry for the long sentence!)
When we run this on unconnected devices and then connect a new device, it enumerates that port and our program runs just fine. We can pick the port without having to go via MAX. The previously used unconnected port is removed by the Device Remover program. We don't try to keep a lock on the same port name or number; one of our wizards wrote a vi that can autodetect active COM ports by consulting the Registry.
Thanks. I'll give it a try when I can. In the meantime, our production manager was in such a tizzy, we decided to reinstall Windows (in progress now). After setting up the PC the way we want it, we'll create a system image and back it up on our network. Then when we run into this problem again I'll give Device Remover a try.
I can try it on my PC. However I only have 20 or 30 hidden orphaned devices, and there doesn't seem to be any noticeable issue when I remove one using Device Manager. The issue with LabView appeared when we were up to COM891 or so. I think the only true way to verify that Device Remover works is to use it when Windows will no longer recognize new devices.
But maybe not... If we use it say once a month, and never run into the limit (might not know for several months) then I guess this would also confirm that it works. Has this been your experience?
We've had issues when we get above about 200 ports, as COM ports. I was under the impression that Windows could only address 255 COM ports on the USB system. Are you using USB? Our other issue is using an HID device; when we get up around 6000 unique HID devices, then we have problems. Is your computer on a network? It has been our problem too that network leases can pile up.
All our computers are on our network, but the PC in question is not running programs from the network. They are all installed locally.
Yeah, I was also surprised that we got up to about COM890.
Now I wish there were a tool similar to Device Remover built by National Instruments precisely for this purpose (to clear the old devices from VISA's database, wherever that may be)!!!
NI, are you listening?
FYI - I used Device Remover to remove 2 hidden ports from my PC but MAX still lists it. Obviously Device Remover knows nothing about (nor should it be expected to) NI drivers and software. Too bad "Clear All Aliases" doesn't really work as expected. As I said, when a new device is installed, MAX does not see the previously removed, newly installed, device and it (each device) must be assigned manually. So MAX's clear command is leaving some remnants. I would consider a bug unless I'm (we are) missing something. NI?
Oops, ComDB is not a file, it is a registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\COM Name Arbiter
But I wouldn't advise hacking it. Here's the API info: http://msdn.microsoft.com/en-us/library/ff546481.aspx
It looks like the database size can be resized in multiples of 1024. See: ComDBResizeDatabase()
Use one of the tools mentioned or write your own using the API. However this doesn't solve the LabView VISA problem.
UPDATE: We have done a clean install on our production PC and created a system image (Windows 7, even the Home Editions, now includes this feature - previously third-party software such as Norton Ghost was needed) as I described a few posts ago. When we run into problems we'll simply restore the image.
Now I'm wondering if I had used MAX to clear the aliases BEFORE running Device Remover instead of after, maybe when I re-install a device (which uses a previously-used COM port number as it should), now VISA would automatically see the new COM port number just as HyperTerminal does (I wouldn't have to manually add it in MAX to make it visible to my LabView program).
I'll keep this post updated when I have more information.