06-30-2026 06:43 PM
I am tasked to make our LabVIEW application to automatically find which com port an instrument is connected to. The vi: "VISA Find Resource" is used with the filter: "ASRL[0-9]*::?*INSTR" to enumerate the com ports to test for the instrument's presence. This outputs a string array, each element of which is of the form: "ASRL<x>::INSTR" where <x> is a number that has no relationship to the com port number that appears in the form: "COM<x>" that our LabVIEW application's users are familiar with.
I understand that NI-MAX can be used to assign a comp port alias to an ASLR number. But it is too much to ask our customer users to do these bindings. They cannot be counted on to be competent to do that. What is needed is for my LabVIEW application to somehow come by the ASRL to com port bindings so that the found instrument's serial port can be presented in the familiar to the user COM<x> format. Is there a way for a LabVIEW application to access these bindings?
Is there a way to get the serial port enumeration in the COM<x> format just as it appears in a: "VISA resource name" front panel selection box control?
My LabVIEW version is 21.
Solved! Go to Solution.
06-30-2026 07:03 PM
Specifying "Aliases Only" on the 'VISA Find Resource' function should give you what you need.
06-30-2026 07:33 PM
That worked.
Thank you 🙂
07-01-2026 08:09 AM - edited 07-01-2026 08:10 AM
Here is the code I use to find my serial ports. I also have a "filter" on the list so I can find ports that showed up due to a UUT powering up (do the search before turning on the UUT, and then search again afterwards and only return the list of new ports).
