From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Device loses connection generates another ASRL Number

I am trying to stay connected to a serial device using the VISA Configure Serial Port VI. I can temporarily connect to the device and data log for some time, but after a while I will lose connection and my indicators read zero. I can then reconnect to the device by refreshing the VISA resource name dialog box and selecting the new ASRL number that was generated. For instance, I started out using resource name COM4 which is listed as ASRL4::INSTR "COM4" in NI MAX. The device data logs for a while and then loses connection. I stop the program, refresh the VISA resource name dialog box, and select the newly generated ASRL5::INSTR (listed as ASRL5::INSTR in NI Max (port binding COM4)). The program then data logs for a while and then loses connection. I stop the program again and then use the newly generated ASRL6::INSTR resource name (listed as ASRL6::INSTR in NI Max (port binding COM4))  and so on to infinity.

 

Why are new ASRL numbers being generated? Is there a way to prevent this from happening.

 

 

0 Kudos
Message 1 of 5
(1,281 Views)

Let me guess, your device is in reality a USB device, using the USB-CDC class to appear as a serial device. Or it has a custom USB protocol and uses its own USB driver that makes it appear as serial port in the computer.

 

In both cases the device for some reason is apparently resetting from time to time and then gets assigned a new COM port when reconnecting. Possible reason:

 

- Your USB port is not able to provide enough power for the devices operation and that causes the device to randomly reset. Solutions: Power the device independently through its own power supply if possible, or use a powered USB hub between your computer and the device.

 

- Your devices USB-CDC device implementation is buggy and causes the OS USB device driver to reset the device.

 

- If it is a custom device with its own device driver, it could be also that device driver which is buggy.

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 5
(1,265 Views)

@eceannt wrote:

 

Why are new ASRL numbers being generated? Is there a way to prevent this from happening.

 

 


Well on top of what rolfk said, basically no. 

 

Assigning a new virtual com port to your USB device every time it is inserted is not a LabVIEW or VISA problem, it is a Windows "feature"...

 

Windows is supposed to "remember" the UUID of your USB device and assign the same virtual com port every time it is connected. But sometimes this does not work, usually for the reasons rolfk stated. (poorly written Windows drivers)

 

If for some reason Windows can not remember what port your device was last assigned it gives it the next available port.

 

The only thing you can do is go into the Windows Device Manager, under "View" select Show Hidden Devices. Then look under Ports (Com & LPT) and you should see all the com ports that are "reserved". You will have to manually remove the ports from this list for them to ever be assigned again.

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 5
(1,248 Views)

Assuming your device is actually a USB to serial adapter, you can try turning off USB power saving.  Might help, might not.

 

You could also switch to a different adapter.  If you have an adapter using a Prolific chip (or worse yet, a counterfeit of a Prolific chip) then this is just a thing that happens because their devices don't have a unique ID in them, they get a new port every time.  Because their chips are so cheap they are used by about 75% of all of the adapters out there, and they're a very good example of the idea of "you get what you paid for".

 

If you can find a model that uses a FTDI chip (about 20% of what's out there), or an even better manufacturer (I recommend this one by Tripp-Lite, which actually uses a Texas Instruments chip), it could also solve the problem.

0 Kudos
Message 4 of 5
(1,224 Views)

Truth be told, I'd much rather have a desktop computer that I can add real COM ports to.  Relying on USB COM ports to come up in the same place is just too much of a headache to solve.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 5
(1,192 Views)