07-29-2025 01:09 AM
I would like to do, Re-scan method with Labview.
Tasks:
1. want to see all connected comports
2. Then I will selelct which component I need to disable/eject.
3. Then i again install that disabled comport.
4. Again, I want to see all connected Comport
Please guide me through it, if you have a solution
07-29-2025 01:38 AM
Hi Rshah,
@Rshah31 wrote:
I would like to do, Re-scan method with Labview.
Tasks:
1. want to see all connected comports
2. Then I will selelct which component I need to disable/eject.
3. Then i again install that disabled comport.
4. Again, I want to see all connected Comport
Please guide me through it, if you have a solution
07-29-2025 01:52 AM
Thank you for the reply,
I will select the Comport which I want to disable/eject from Scan list, and Press on the button "Disable" So that particular port will no longer be used.
After that, I again pressed the Enable button to install it again.
This is what you want to ask! Sorry if I misunderstood something!
07-29-2025 01:58 AM
Hi Rshah,
@Rshah31 wrote:
I will select the Comport which I want to disable/eject from Scan list, and Press on the button "Disable" So that particular port will no longer be used.
After that, I again pressed the Enable button to install it again.
I would do something like this:
I hope I understood your requirements correctly…
07-29-2025 02:05 AM
Yes, perfectly matches my requirements.
Could you please guide me a bit more? Which VIs/Functions do I need to use?
Sorry to ask these questions, but I am very new to LabVIEW, so I don't know much about that. If Possible, could you please share some examples
07-29-2025 02:23 AM
Hi Rsash,
@Rshah31 wrote:
Could you please guide me a bit more? Which VIs/Functions do I need to use?
I already mentioned VISAFindResources several times.
I also mentioned a listbox and you can edit their properties (like item array, en-/disable items) using property nodes.
To react on user input (aka button actions) I recommend an event structure…
@Rshah31 wrote:
I am very new to LabVIEW, so I don't know much about that. If Possible, could you please share some examples
There is a whole section on Training resources offered at the top of the LabVIEW board!
And LabVIEW comes with an example finder, stuffed with lots of example VIs…
07-29-2025 09:30 AM
This is the fastest way I found to get the connected devices in LabVIEW:
07-29-2025 09:46 AM
Thank you for your Help.
For the Enable/Disable button I am using User Event structure.
But I could not understand What should I implement into the user structure. How can I do this task
07-29-2025 11:38 AM
When you say "Enable" and "Disable", you need to be more specific about what you are trying to accomplish here.
Are you trying to copy the functionality of "Device Manager"? Meaning, that you want to add something in LabVIEW that makes it so when you tell it to "disable" a COM port, it's the same as if you had right-clicked the port and selected "Disable device", making it so that every single application on your PC could no longer use it until you enable it again?
If this is the case, you probably can't do it in LabVIEW, or automate it in any way.
Please back up a few steps and explain why disabling COM ports is important to you.
If I had a guess, I would guess that you have a device that uses a COM port, and it sometimes stops working. You have figured out that if you unplug the device and plug it back in, or disable and then enable it in Device Manager, that it starts working again. So you want to add code to do this automatically. If that's the case, then your real problem is something else, and your solution needs to reflect that. If it's what I just guessed, then you probably either need to update the drivers for your COM port, or buy a different model of COM port adapter.
If I guessed, wrong, let me know. But this problem you are trying to solve sounds like the middle part of something, not the beginning of something. Tell us what the beginning is.
07-30-2025 04:50 AM
@Kyle97330 wrote:
If this is the case, you probably can't do it in LabVIEW, or automate it in any way.
It can be done using the device console, pnputil and probably, for the very adventurous, with direct calls to the windows setup API.
Tell us what the beginning is.
Yes.
I can also imagine that this is about preventing the user to connect to a specific device by temporary de-listing a specific port from the drop-down. The question looks very much like an XY-Problem.