Hello.
Whenever you plug your Maestro into a given computer, Windows will assign it to the same COM ports. So one solution would be to change the Maestro’s Command Port to, say, COM8 and just rely on it always being on COM8. You could hardcode COM8 into your program and just open COM8 without looking at any of the other ports. The reason this works is because the Maestros have serial numbers built into them, so a given Maestro will always be assigned to the same COM ports no matter where you plug it in to the computer.
I think that will be the easiest way for you, but if you wanted a more general way to identify Maestro COM ports then there are ways to do it using SetupAPI.
Your idea of having the Maestro send an ID to you would also work. The Maestro has several serial commands that result in a serial response (e.g. Get Position) and you could try sending one of those commands. That would allow you to make sure you are talking to a Maestro but it might not be so useful if you have multiple Maestros connected to the computer.
–David
