LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabView VISA Resourse Name

I am seeing a new port connection each time at VISA Resource Name when I reconnect my USB to the port or I restart my firmware. My actual port is  COM 99 , any idea why is it happening and how I can solve it so that I only get COM99. See the attached SS as reference.

 

 

 

Faizan_habib_0-1726577835494.png

 

Regards,
Faizan Habib 

 

0 Kudos
Message 1 of 8
(345 Views)

It is up to Windows to assign the COM port number to a connected device. In short, there are ways, but not a simple and easy one.

 

Here is a detailed discussion on that topic - https://forums.ni.com/t5/LabVIEW/Assigning-a-fixed-com-number-to-a-USB-port-on-a-computer/td-p/42729...

 

https://learn.microsoft.com/en-us/answers/questions/452998/how-to-assign-static-com-port-number-to-a...

 

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 8
(338 Views)

The only time I have seen the little monitor icons is when I did not close a serial port when a VI ended.  I think this indicates multiple connections to the same port.  You can drop a VISA Close vi on another vi, wire a visa resource to it, select the port, and run it to close an extra connection, or just restart LabVIEW

0 Kudos
Message 3 of 8
(312 Views)

Hi,
Thanks for your reply. But the question is not the about the little monitor its shows (in-use) I am asking about the port name each time I run my program I see a new name for port how can i fix this. see the SS attached as well for reference.

Thanks

0 Kudos
Message 4 of 8
(307 Views)

I think what jjohn1 means is: Are you closing the VISA before you run your program again? If not then it could create another one.

0 Kudos
Message 5 of 8
(299 Views)

Yes I am Closing it. 

0 Kudos
Message 6 of 8
(295 Views)

@Faizan_habib wrote:

Yes I am Closing it. 


Obviously not! The icon in front of the resource means that VISA still has that resource opened. When you do an explicit VISA Close (hidden in one of the subpalettes and not available on the top level palette) that icon goes away. While VISA doesn't strictly need a VISA Close at the end of using a device it is still good practice to call VISA Close anyways every time you are done with communicating to a device.

Rolf Kalbermatter
My Blog
0 Kudos
Message 7 of 8
(217 Views)

Maybe not a direct answer to your question, but more likely the real solution that you need - I use the code below and pass instrument name as seen in Device Manager to "COM name" control. "COM" array elements can then be passed to VISA Open. Thanks to that, I don't need to worry at all which COM port is assigned to my device.

 

Find COM port with instrument name.png

0 Kudos
Message 8 of 8
(121 Views)