09-17-2024 08:00 AM
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.
Regards,
Faizan Habib
09-17-2024 08:13 AM
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...
09-17-2024 08:43 AM
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
09-17-2024 08:53 AM
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
09-17-2024 09:03 AM
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.
09-17-2024 09:05 AM
Yes I am Closing it.
09-18-2024 03:58 AM
@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.
10-16-2024 03:05 PM
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.