What bus and what programming language? If you are talking about the GPIB bus, you can use a VISA Find Resources. That's what's it's called in LabVIEW but I don't know what the function is called in other languages. You can then write the "*IDN?" string to each and look at the response.