You could write a Python script using the pyserial library to query each COM port and send specific commands that identify the corresponding port and slots on the SIM bank.