LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Find Resource Function issue after COM port disconnected

Solved!
Go to solution

I have an application in which I am using two COM port for communication, at  a time only one is active.

 

In between testing one com port gets connected and disconnected dynamically. I am able to connect and disconnect without issue.

 

Now after my dynamic com port disconnected, its not visible in device manager also but if I search all available com port using VISA find resource after it disconnects, then dynamic COM port is also visible in that list.

 

USB interface name is USB Serial Port  and this com port is dynamic which will be disconnected. Attached VI

 

 

Any suggestion please

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 1 of 20
(3,932 Views)

Also after my testing comples, and dynamic COM port is disconnected and if I search dynamic COM port then it will not visible.

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 2 of 20
(3,930 Views)

Any suggestion?

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 3 of 20
(3,908 Views)

Any suggestion?

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 4 of 20
(3,872 Views)

First, do no not bump the thread 🙂

Second, I am not really sure if I understood exactly your problem. I do not really understand what you mean about "dynamic COM port". You mean, this is a USB-to-serial interface? Do you mean, you see problems when you unplug and re-plug this USB device? I often work with such interfaces to get multiple RS232 com port, but I never unplug such USB devices. I never had any problem, why do you need to unplug the USB interface at all? The USB interface is the "device under test"?

0 Kudos
Message 5 of 20
(3,861 Views)

Let's be fair blokk.  The 2hr bump was absurd.  Bumping after 3 days isn't a bad thing.  How else would he hope to get a response?

0 Kudos
Message 6 of 20
(3,854 Views)

Let me explain my problem again.

My testing device has USB port mounted on it. Once powered on I detect the USB port(Driver for this USB is already installed) which is my dynamic COM port and do the communication. Once I turn off my device I dynamic com port disappears.

 

Now the problem statement

 

Once device is on I can connect and communicate with USB. When device turns off, dynamic com port disappears from device manager but if in that time only I use VISA FIND RESOURCE then that dynamic COM port is visible. Which should not be visible. how to ensure this doesn't visible. Name of my USB deice is 'USB Serial Port'

 

 

Attached VI.

 

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 7 of 20
(3,850 Views)

I guess my threshold got pushed down recently by other users 🙂

Anyway, I am still corious about the hardware requirements in your test. So what is the exact scenario?

 

edit: I just got the explanation, thanks!

Ok, now i understand your problem. If it is visible in VISA, even if it is unplugged, your application will try to communicate? I would just try to initiate a communication with the device, like requesting ID, or whatever. If the communication fails, then most likely the USB port is disconnected. Kind of workaround...

0 Kudos
Message 8 of 20
(3,846 Views)

Now the problem statement

 

Once device is on I can connect and communicate with USB. When device turns off, dynamic com port disappears from device manager but if in that time only I use VISA FIND RESOURCE then that dynamic COM port is visible. Which should not be visible. how to ensure this doesn't visible. Name of my USB deice is 'USB Serial Port'

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 9 of 20
(3,842 Views)

See my edit above. I guess somehow VISA does not know about the com port was disconnected. Maybe there is a way to "refresh" the LabVIEW side, so it reflects exactly the com port list in the Windows device list? I do not know. But a workaround should work, see above...

0 Kudos
Message 10 of 20
(3,835 Views)