‎09-02-2021 11:09 AM - edited ‎09-02-2021 11:13 AM
You can check out this link, it may do what you want if you are using Windows. (I think the dlls are only 32 bit though, not sure if that is a problem for you. If you recompile to 64 bit, please post an update, although the links to the original source code no longer seem valid.)
I do something similar for DAQmx devices. Instead of using an array, I use a Set. There is a built in function for "Set Difference" between two sets. I use the alias and model name for my set, if your Instruments support it you can do something similar with the *IDN? command. Knowing the alias and instrument is useful for some cases.
mcduff
EDIT: This link may have an 64 bit version
‎09-03-2021 02:17 AM
@VinnyAstro a écrit :
Here is an updated version 🙂
A LV16 version is also enclosed using Search 1D Array.vi instead of Search sorted 1D array.vim
Thanks for your inputs 🙂
 
Actually I've realized the hard way that, in this configuration, if no devices are found in the first instance, it will generate an error and the other Find VISA Reesource.vi in the loop will forever generate that error and not even try to look out for a device.
So one would either need to break that error wire (prevent the first one to communicate its error with the second) or to clear that specific error in the first place.(error -1073807343)
‎09-03-2021 02:22 AM
@mcduff a écrit :
You can check out this link, it may do what you want if you are using Windows. (I think the dlls are only 32 bit though, not sure if that is a problem for you. If you recompile to 64 bit, please post an update, although the links to the original source code no longer seem valid.)
I do something similar for DAQmx devices. Instead of using an array, I use a Set. There is a built in function for "Set Difference" between two sets. I use the alias and model name for my set, if your Instruments support it you can do something similar with the *IDN? command. Knowing the alias and instrument is useful for some cases.
Unfortunately no, my devices are just USB to serial adapters and do not answer to any commands.
I'm only working with 32bits anyway, makes it easier to work on various projects.