LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ASRL<x>::INSTR to COM<x> Alias Binding

Solved!
Go to solution

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.

0 Kudos
Message 1 of 4
(556 Views)
Solution
Accepted by topic author Artst

Specifying "Aliases Only" on the 'VISA Find Resource' function should give you what you need.

Darren_0-1782864207015.png

 

Message 2 of 4
(541 Views)

That worked.

 

Thank you 🙂

0 Kudos
Message 3 of 4
(526 Views)

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).



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 4
(417 Views)