09-03-2025 04:11 AM - edited 09-03-2025 04:17 AM
Hello. I need to detect automatically through Labview which COM port number is associated to the various intruments that are connected to the board to be tested. I imagine that I have to use some property of the device shown on the computer as an input of a function that gives me the corresponding COM number. This could avoid to have error of exchange the number of COM when there is more than one instruments connected and you have to select manually the COM.
09-03-2025 04:22 AM
Hi V.,
@V.Life wrote:
I need to detect automatically through Labview which COM port number is associated to the various intruments that are connected to the board to be tested.
In general an "autodetect COM port with device" feature works by:
When you want to detect several "same" devices you easily get in trouble when those devices don't support things like UUIDs or serial numbers…
09-03-2025 04:25 AM
What it is possible to do if they have UUID instead?
09-03-2025 04:27 AM
Hi V.,
@V.Life wrote:
What it is possible to do if they have UUID instead?
Read the UUID and check with your reference table of UUIDs: now you know which device is connected to your COM port…
09-03-2025 04:32 AM
Thank you. How can I get UID (or other info that can be used to identify the device)?
09-03-2025 04:42 AM
Hi V.,
@V.Life wrote:
How can I get UID (or other info that can be used to identify the device)?
By sending an appropriate command to your device and reading its response.
Do your devices support such features at all?
09-03-2025 05:27 AM
If I assing a name to the device in NI MAX (as default it is equal to COMxx corresponding to ASRLXX) can I find the resources by this name? I tried but I can get only the string before the name (for example ASRL39::INSTR).
09-03-2025 05:34 AM
Hi V.,
@V.Life wrote:
If I assing a name to the device in NI MAX (as default it is equal to COMxx corresponding to ASRLXX) can I find the resources by this name?
Sure: instead of "COMxx" you simply use the alias name as VISA resource.
But: this only allows to decouple device alias from COM port instance. It will NOT "find" or "detect" a device…
09-03-2025 06:41 AM
It could be a solution if I search for the name, find the ASRLXX and then set COMXX as port for the "NAME" device.
09-03-2025 07:11 AM
Hi V.,
@V.Life wrote:
It could be a solution if I search for the name, find the ASRLXX and then set COMXX as port for the "NAME"
device.
???
I don't know what you are talking about…