If your instruments accept GPIB commands, you can try to send *IDN? command for them to identify themselves. You make a for loop going through all your COM's (I believe you can get a list of them with property nodes related to MAX) and asking if anyone is connected to it. If the string response is known, you can identify where is each instrument.
Don't forget the termination char when sending the command!!
Mariana