Programati​cally close a USB port

Is there any way to programatically close a USB port?
Sometimes when accessing my USB device if an error is encountered the port will not close properly and then will not allow the device to be accessed the next time without unplugging or reseting the computer first. I have seen something about a RAW USB name being used to control the USB ports through the VISA functions but I didnt know if this was the correct way to handle this situation and also didnt know how to obtain the RAW port name. Essentially I want to deactivate/reactivate a port before I run my program to be sure the port is not busy.
Thanks for any help you can provide.
-Dave

Matthias Eisner wrote:
> Dan Mondrik wrote:
>
>> Dave:
>>
>> It sounds more like you're talking about a reset of some sort. VISA
>> doesn't provide this.
>>
>> Also, VISA Close is no magical silver bullet here - it merely releases
>> something that VISA Open already accessed. So if you're using VISA
>> for USB with a RAW resource, then you should release it with VISA
>> Close when you're done. But if you're not using VISA in the first
>> place, you can't use VISA to close what it didn't open.
>>
>> Dan Mondrik
>> National Instruments
>
>
> Hello,
>
> for me there si also the problem that I want to reste my USB-Bus. I am
> using two webcams and two USB2Serial (Keyspan) on the bus, where the two
> Converters and one webcam are addressed fr
om within labview. From time
> to time one of the cameras seems to hang and this hangs the whole Bus
> and afterwards the application then, so a USB-Reset would help a lot if
> the commands timeout. Actually reconnecting the Devices does the job as
> well, but I don't want to sit in front of my equitpent all night to see
> if it hangs :-)
>
> Is there any possibility to fix this?
I assume this is only possible by going directly into the Windows kernal
and do some stuff, probably not really politically correct, in there.
Definitely not something VISA or such should be concerned about if one
of the underlying device drivers messes up.
What I assume happens is that the webcam driver and the keyspan driver
at some point compete for the USB bus and hang each other in waiting for
one or the other semaphore. It is definitely a bug in either the webcam
or keyspan driver but how to proof to the manufacturer will be a
difficult exercise. Just try to see if they have newer drivers.
At least
you can hope they found the problem already in the meantime.
Rolf Kalbermatter
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions

Similar Messages

  • Magsafe too close to usb port

    my magsafe keeps sucking my usb key drives or adapters for SD cards. when i try to plug into the left port naturally, somtimes accidentally the usb port gets sucked by the magsafe port and the usb plug attaches to the magsafe port.
    not sure what the safety on that end is, but is it possible that now one of my SD cards don't work based on this accidental powerport magsafe connected briefly to my SD card adapter?
    i think either way, the ports are too close. sometimes the magsafe wants to connect to the usb port...i'm afraid one day it might just spark...thoughts?

    hi,
    i have the 15" macbook pro 2ghz.
    the problem is when i got to insert a usb drive or usb memory card adapter on the left hand side of the macbook pro, the usb tends to want to stick to the magnetic portion of the magsafe connector port, and hence gets "sucked" into the port.
    it's happened a couple time and i'm wondering on this last occasion that my memory card is not destroyed due to it's contact with the magsafe port.

  • Abort Execution leaves USB port open

    My VI opens a USB port and then processes the data in a while loop for as long as I let it run.  When I manually exit the while loop the VI closes the USB port and then stops execution.  Using the start control starts the loop again and the VI runs.  However if I use the abort execution button on the toolbar the VI stops without closing the USB port and the VI will not run again unless I  close and reopen it.  How do I avoid this problem?
    Solved!
    Go to Solution.

    So I suggest always stop the program from the front panel button.
    You can hide the toolbar so that the the abort button can not be clicked.
    Best Regards
    Hu Yu

  • USB port to close each other?

    Hi
    I have a Macbook with 2 USB ports, but i can only use one at a time, they are to close so if i put my mouse in one i cant get my mp3 player in at the same time.

    Yes, they are close, and some devices are too wide to plug in side-by-side. An easy solution is to buy a cheap USB hub.

  • IPod is not recognized by my computer's usb port and itunes

    Remove my ipod from the computer without ejecting it and now the ipod want turn on, it is not being recognized by my computer's usb port or itune.  I have reinstalled itune and still have the same problems.

    1. Update iTunes to the latest version. Plug in your iPod. If iTunes still can't recognize it, then in iTunes in the top left corner click help> run diagnostics. On the box that comes up, check the last two things. Click next and it should identify your iPod.
    2. Click on your windows start menu. Type in "services". Click on it and when it pops up, on the bottom of it click on "standard". Now Scroll down to find "Apple Mobile Device" Right click it when you see it and click on "Start". When it has started, close iTunes and replug in your iPod and it should show up.
    3. Check the USB cable
    4. Verify that Apple Mobile Device Support is installed
    5. Restart the Apple Mobile Device Service and verify that the Apple Mobile Device USB Driver is installed.
    6. If you just want to add some photos, songs and movies from computer to your devices, you can use an iTunes alternative to do the job.
    7. Check for third-party software conflicts.

  • USB Ports on Macbook Pro (Late 2011) no longer working...

    Hey all,
    I know there are numurous posts on this but none have seemed to help me.
    Today both of my USB ports have stopped working. Two months ago the one next to the thunderbolt port would go in and out and today both of them just don't work at all except to supply power. I can still charge my phone with them but thats it, nothing is recognized when I plug it in.
    I've tried the PRAM reset, the SMC reset, manual reset, regular reset, updating the OSX to the latest and nothing has helped. I've read I might have to replace the logic board but I really hope I don't have to resort to that. 
    I've posted the reports from the System Information and an app called Etrecheck. Hopefully someone will be able to pinpoint the issue.
    System Information
    USB Hi-Speed Bus:
      Host Controller Location:          Built-in USB
      Host Controller Driver:          AppleUSBEHCI
      PCI Device ID:          0x1c2d
      PCI Revision ID:          0x0005
      PCI Vendor ID:          0x8086
      Bus Number:          0xfa
    FaceTime HD Camera (Built-in):
      Product ID:          0x8509
      Vendor ID:          0x05ac  (Apple Inc.)
      Version:           5.16
      Serial Number:          CC2BA30DEXDG6LL0
      Speed:          Up to 480 Mb/sec
      Manufacturer:          Apple Inc.
      Location ID:          0xfa200000 / 3
      Current Available (mA):          500
      Current Required (mA):          500
    Hub:
      Product ID:          0x2513
      Vendor ID:          0x0424  (SMSC)
      Version:           b.b3
      Speed:          Up to 480 Mb/sec
      Location ID:          0xfa100000 / 2
      Current Available (mA):          500
      Current Required (mA):          2
    BRCM2070 Hub:
      Product ID:          0x4500
      Vendor ID:          0x0a5c  (Broadcom Corp.)
      Version:           1.00
      Speed:          Up to 12 Mb/sec
      Manufacturer:          Apple Inc.
      Location ID:          0xfa110000 / 5
      Current Available (mA):          500
      Current Required (mA):          94
    Bluetooth USB Host Controller:
      Product ID:          0x821a
      Vendor ID:          0x05ac  (Apple Inc.)
      Version:           0.42
      Speed:          Up to 12 Mb/sec
      Manufacturer:          Apple Inc.
      Location ID:          0xfa113000 / 8
      Current Available (mA):          500
      Current Required (mA):          0
    Apple Internal Keyboard / Trackpad:
      Product ID:          0x0252
      Vendor ID:          0x05ac  (Apple Inc.)
      Version:           1.18
      Speed:          Up to 12 Mb/sec
      Manufacturer:          Apple Inc.
      Location ID:          0xfa120000 / 4
      Current Available (mA):          500
      Current Required (mA):          40
    USB Hi-Speed Bus:
      Host Controller Location:          Built-in USB
      Host Controller Driver:          AppleUSBEHCI
      PCI Device ID:          0x1c26
      PCI Revision ID:          0x0005
      PCI Vendor ID:          0x8086
      Bus Number:          0xfd
    Hub:
      Product ID:          0x2513
      Vendor ID:          0x0424  (SMSC)
      Version:           b.b3
      Speed:          Up to 480 Mb/sec
      Location ID:          0xfd100000 / 2
      Current Available (mA):          500
      Current Required (mA):          2
    IR Receiver:
      Product ID:          0x8242
      Vendor ID:          0x05ac  (Apple Inc.)
      Version:           0.16
      Speed:          Up to 1.5 Mb/sec
      Manufacturer:          Apple Computer, Inc.
      Location ID:          0xfd110000 / 3
      Current Available (mA):          500
      Current Required (mA):          100
    EtreCheck Information
    Hardware Information:
              MacBook Pro (13-inch, Late 2011)
              MacBook Pro - model: MacBookPro8,1
              1 2.4 GHz Intel Core i5 CPU: 2 cores
              8 GB RAM
    Video Information:
              Intel HD Graphics 3000 - VRAM: 512 MB
    System Software:
              OS X 10.8.5 (12F45) - Uptime: 0 days 0:26:0
    Disk Information:
              TOSHIBA MK5065GSXF disk0 : (500.11 GB)
                        disk0s1 (disk0s1) <not mounted>: 209.7 MB
                        Macintosh HD (disk0s2) /: 499.25 GB (234.19 GB free)
                        Recovery HD (disk0s3) <not mounted>: 650 MB
              HL-DT-ST DVDRW  GS31N 
    USB Information:
              Apple Inc. FaceTime HD Camera (Built-in)
              Apple Inc. BRCM2070 Hub
                        Apple Inc. Bluetooth USB Host Controller
              Apple Inc. Apple Internal Keyboard / Trackpad
              Apple Computer, Inc. IR Receiver
    FireWire Information:
    Thunderbolt Information:
              Apple Inc. thunderbolt_bus
    Kernel Extensions:
              com.squirrels.driver.AirParrotSpeakers          (1.7)
              com.squirrels.airparrot.framebuffer          (3)
              com.protech.NoSleep          (1.3.3)
              com.jft.driver.PdaNetDrv          (1.0.64)
              com.Cycling74.driver.Soundflower          (1.6.2)
    Problem System Launch Daemons:
              [loaded] com.jft.PdaNetMac.plist
    Problem System Launch Agents:
    Launch Daemons:
              [loaded] com.adobe.fpsaud.plist
              [loaded] com.mice.360Daemon.plist
              [loaded] org.macosforge.xquartz.privileged_startx.plist
    Launch Agents:
              [loaded] com.protech.NoSleep.plist
              [loaded] net.culater.SIMBL.Agent.plist
              [loaded] org.macosforge.xquartz.startx.plist
    User Launch Agents:
              [failed] com.apple.CSConfigDotMacCert-[redacted]@me.com-SharedServices.Agent.plist
              [loaded] com.google.keystone.agent.plist
              [not loaded] com.spotify.webhelper.plist
              [loaded] com.valvesoftware.steamclean.plist
    User Login Items:
              PdaNetMac
              Spotify
              iTunesHelper
              SIMBL Agent
              VMware Fusion Helper
              Android File Transfer Agent
              Dropbox
              VMware Fusion Start Menu
              NIHardwareAgent
              Content Manager Assistant
    3rd Party Preference Panes:
              Flash Player
              Native Instruments USB Audio
              NoSleep
              XBox 360 Controllers
    Internet Plug-ins:
              Flash Player.plugin
              FlashPlayer-10.6.plugin
              iPhotoPhotocast.plugin
              JavaAppletPlugin.plugin
              QuakeLivePlugin.plugin
              QuickTime Plugin.plugin
              Silverlight.plugin
    User Internet Plug-ins:
              Google Earth Web Plug-in.plugin
              KickStartPlugIn64.plugin
              RealPlayer Plugin.plugin
    Bad Fonts:
              None
    Top Processes by CPU:
                  13%          Google Chrome
                   7%          WindowServer
                   3%          EtreCheck
                   2%          hidd
                   1%          fontd
                   0%          coreservicesd
                   0%          ps
                   0%          Dropbox
                   0%          mds
                   0%          CMA
    Top Processes by Memory:
              287 MB             firefox
              131 MB             Google Chrome
              82 MB              App Store
              66 MB              Dropbox
              57 MB              mds
              49 MB              WindowServer
              43 MB              Google Chrome Helper
              41 MB              Finder
              33 MB              Dock
              25 MB              loginwindow
    Virtual Memory Statistics
              4.89 GB            Free RAM
              1.69 GB            Active RAM
              238 MB             Inactive RAM
              1.18 GB            Wired RAM
              443 MB             Page-ins
              0 B                Page-outs

    Thanks for the response,
    1. I live in Atlanta, close enough to an Apple store. But I just know that going there will probably mean I'll have to get the logic board replaced.
    2. The only thing I noticed before the first USB port started acting funny was that my battery status changed to "Service Battery". I plan on replacing it this week too.
    3. Nope only difference is that my battery drains kind of fast. After about 3-4 hours of my normal usuage with it (Internet, music, videos, and sometimes using Logic) it will be time to hook up the charger.
    Would replacing the battery do anything? I'm not thinking it would but figure it'd be worth a shot since I've got to replace it anyway.
    And to goofyziggy,
    I too noticed that most people who had this problem had some version of OSX 10.8.x

  • Ipod shuffle shuts down PC when put in USB port

    Hello
    I found a discussion on this topic from 2006 but there were no solutions.  Hopefully in 2014 there is someone out there that can help me.
    I have successfully synced, loaded and recharged ipod shuffle on PC.  But this week I plugged in my ipod shuffle (early generation) into the USB port to recharge, the system shut down, and I got the "blue screen of death". Windows XP blue screen indicated there was some software or hardware that might cause harm to PC.  I had to close PC by pressing button on tower.  I tried couple more times and got same message.  No harm has been done to PC as far as I can tell.  I used the Safely Remove Hardware device and not sure it worked but removed shuffle.  I did do this 2 or 3 times with same result each time.  Ipod shuffle still works. 
    Thanks!

    I have found the solution.  I installed the most recent updates and it works now.

  • IPod touch won't work with car's USB port after sw update

    I've been using my iPod with my 2011 Honda CR-V's USB port to play my music through the car's audio system without issue since I bought the car.  This stopped working after the latest iPod software update a few days ago--the msg on the audio screen says it's now "unsupported". Is there anything I can do to fix this without a full restore? Why did it change?  Thanks for any help.

    Hey there,
    Glad to hear we're getting closer. Looks like you're connected to the network, just not able to utilize it's internet connection.
    Let's check your iPod's IP addres. Tap Settings > Wi Fi and look for your network. To the right, there's a blue circle with a white arrow in it. Tap that circle. If the IP address starts out with 169.x.x.x, it is a self-assigned IP address. Since it came from the iPod, and not the router, it can't be used.
    I would recommend resetting your iPod's network settings:
    Settings > General > Reset > Reset Network Settings
    When the iPod restarts, reconnect it to your network and try Safari again.
    If it still isn't working, try powercycling your router and resetting those settings at the same time.
    1. Turn off the router
    2. Reset the network settings again, as indicated above
    3. Turn the router back on
    4. Reconnect the iPod to the network
    If it still isn't working, let's check your iPod's software version.
    Settings > General > About
    If you've upgraded to 2.0, the latest version is 2.0.2. If you haven't upgraded, the latest version is 1.1.5. If you're not at either of those numbers, connect the iPod to your computer and use iTunes to check for software updates for the iPod.
    Regarding the router settings, I'm not familiar with your router manufacturer. I'd check their website for instructions on that. I think at this point you wouldn't really need to change any settings, but just check for firmware updates.
    CG

  • Can't use my HP Deskjet F4580 Wireless Printer with the AirPort Extreme Base. The printer is NOT connected at the USB port of the AirPort Extreme, and is placed in another room. It worked just fine with my previous router (Linksys WRT54G). Help me!

    Hey Guys!
    I just got my AirPort Extreme Base, but I can't use my HP Deskjet F4580 wireless printer with it.
    The printer is not connected to the AirPort Extreme's USB port. It is placed in another room, and I'd like to use it (the printer) wirelessly (not connected to the USB port os the AirPort Extreme), as I used to. There is no place for the printer close the AirPort Extreme. It worked just fine with my previous wireless router (Linksys WRT54G). I'm very disappointed with the AirPort Extreme Base Station because of that!...
    Can you help me? Please?!
    Thanks Folks!

    This must be a tough one, no suggestions at all.

  • USB Ports Randomly Stop Working

    I have an HP Pavilion dv6 Notebook with Windows 7. All of the ports, 2 2.0 and 2 3.0 ports, began to randomly stop working. My mouse light would still light up, but the mouse wouldn't work. If I rebooted the entire laptop, all of the ports would come back on for a short period of time before they randomly shut off again. They will also come back on for a short period of time if I close the lid for a few seconds and reopen it. However, lately, the 3.0 ports have stopped working entirely and the 2.0 ports stopping is becoming more frequent.
    The first time I noticed this was when I was testing a micro usb cable (it has stopped charging and I was testing whether it was the cable or the wall adapter). I plugged the cable into one of the 2.0 ports and it gave me a USB surge warning. Other than that, I haven't received any notices. The drivers are up to date. I have uninstalld the root hubs multiple times. I have tried all kinds of Power plans for the laptop. Nothing works. The USB ports still stop working, and it's becoming increasingly more frustrating.

    Hello Abby_Renee,
    With the USB 3.0 port not working, and your 2.0 port working intermittently, I would suggest the following document Troubleshooting USB Connections (Windows 7) for troubleshooting.
    In this document there is a specific option for USB 3.0 ports stop working, which would be the best steps to follow for your 3.0 ports. Now for the 2.0 ports, I would suggest USB device not detected by Windows (no device name in device manager), or the other option is USB devices are detected by Windows but are not working properly. The last two options are dependant on the specific errors you are experiencing.
    Please let me know the outcome of the troubleshooting steps.
    Good Luck!
    I worked on behalf of HP

  • External USB2 drive doesn't work on left USB port

    Hi,
    I have an 2,5" external usb hard drive which works on my right usb port, but not on my left one, when i try the disk on the left port, afterwards the usb port is dead untill restart, even my mighty mouse does'nt work on it. My logic board and board with audio and left usb port are already replaced, without result, also the cable beween logic board and daughter board...
    The disk works on a colleage's macbook pro on both ports...
    what to do?

    Try resetting the PRAM:
    http://docs.info.apple.com/article.html?artnum=2238
    Make sure also that no USB devices are connected when you put the machine to sleep (close the lid, or start energy saver).
    A restart will clear a hung USB port usually.

  • Q190 USB Port Power

    I have had a Q190 for about a month. In spite of the reviews/comments that I have seen on the Q180, I am greatly satisfied with this machine. I've even become accustomed to Windows 8! :-)
    Here's my issue: When the machine is in Sleep Mode, the USB Ports seem to go into a reduced power state. I want to charge my Iphones. etc., but the USB Ports (which will charge it normally) will stop charging in Sleep Mode.
    I know that there is SOME power to the ports during sleep mode, because I have an LED Backlit Keyboard, and THAT remains lit during sleep mode. So, presumably, the USB Ports are going into some sort of "reduced power state" on System Sleep.
    I have made (what I think), are all the proper OS changes (usb controllers are set to not allow the PC to turn off the usb, (box unchecked) and the usb selective suspend mode in advanced power settings is set to disabled). I'm also using the High Performance Power Plan. I see NO option for USB Power in the BIOS.
    Does anyone have any ideas on how to keep the USB Ports on Full Power during system sleep. I know this can be done on many Windows Systems, as I have colleagues who do it regularly.
    TIA! :-)

    hi LeonS,
    Can you try to:
    1. Press the Winkey+R > type devmgmt.msc
    2. On the Device Manager, navigate to Human Interface Devices
    3. Do a right click > properties on all HID-compliant device and USB input Device and enable Allow this device to wake the computer under the Power Management Tab.
    4. Close the device manager, put the computer to sleep and try to connect a gadget that supports USB charging
    Let me know your findings
    Cheers
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"! This will help the rest of the Community with similar issues identify the verified solution and benefit from it.
    Follow @LenovoForums on Twitter!

  • HT1414 I keep trying to restore my i pod touch and am getting nowhere I have checked usb port

    Hi i am trying to update my i pod touch but it had error 1602 I followed all the instructions given but now it is stuck in recovery mode.... any suggestions?!

    Error 1604
    This error is often related to USB timing. Try changing USB ports, using a different dock connector to USB cable, and other available USB troubleshooting steps (troubleshooting USB connections. If you are using a dock, bypass it and connect directly to the white Apple USB dock connector cable. If the issue persists on a known-good computer, the device may need service.
    If the issue is not resolved by USB isolation troubleshooting, and another computer is not available, try these steps to resolve the issue:
    Connect the device to iTunes, confirm that the device is in Recovery Mode. If it's not in Recovery Mode,put it into Recovery Mode.
    Restore and wait for the error.
    When prompted, click OK.
    Close and reopen iTunes while the device remains connected.
    The device should now be recognized in Recovery Mode again.
    Try to restore again.
    If the steps above do not resolve the issue, try restoring using a known-good USB cable, computer, and network connection.
    Error 1600, 1601, 1602
    Follow the steps listed above for Error 1604. This error may also be resolved by disabling, deactivating, or uninstalling third-party security, antivirus, and firewall software. See steps in this article for details on troubleshooting security software.
    Did you try on another computer and cable like the troubleshooting said to try last?

  • One USB port isn't working...

    Hey,
    I just realised that one of my USB ports isn't working when I plugged in my mouse... Should I be very concerned about this?
    I live in a really remote community (ie no stores anywhere closer than a 3 hour plane ride away) and can't bear the thought of living without a computer for several weeks if I send it to Apple to be repaired.
    Could it be a sign that there's something else going on? Is is expensive to fix?
    Thanks!!

    Welcome to the Apple discussions.
    When one USB port isn't working, often a Power Management Unit (PMU) reset will fix it. Follow these directions: http://docs.info.apple.com/article.html?artnum=14449

  • G6 Pavillion 2230sa USB ports not working

    Hi, this is my first time posting anything on these forums
    My G6 Pavilion 2230sa is running Windows 8.1, and for the past week the USB ports haven't been working at all. Not only are any devices not recognized by the computer, but they aren't powered (ie Phone, tablet won't charge from the usb ports.) My xbox 360 wired controller is completely unresponsive (lights not coming on), as is my mouse. This applies to all three usb ports, I'm not sure if its a software or hardware problem.
    The problems started after taking the laptop on an aeroplane. (one of the hinge casings has also popped open and won't close, but it seems to be just cosmetic damage. I'm no expert though.
    I've tried restarting, removing the battery, and restoring from a system image dating from before the incident; no change.
    Any help/assistance anyone can offer me will be much appreciated; not having usb ports is a real inconvenience, and being a student I don't want to have to buy another laptop.
    Thanks for reading.

    Some things appear to have changed since I last posted yesterday:
    The USB ports on the left now work intermittently- my USB powered cooling mat runs steadily then powers down, and then powers up again. My xbox 360 controller also shows power throughout startup, but the lights flicker and I haven't been able to see if it works in a game yet.
    The USB port on the right still does not work.
    These changes happened after the computer froze, and after installing some windows updates- nothing shows in update history though. Upon restarting, the usb devices showed the signs above. But then the BSoD appeared, listing "WDF_Validation" as the problem. Windows restarted automatically, leading the the situation now, where the cooling mat runs most of the time, and a light occasionally flickers on the xbox controller.
    This raises my hopes that it is a software problem, and not a potentially very costly hardware problem.
    Thanks for reading this, I hope it helped.

Maybe you are looking for

  • Looking for a good document on family syncing with iCloud and multiple iOS devices

    We have recently migrated off of Android devices for the whole family except for a Kindle Fire HD for my daughter.  We all have an iPhone/iPad/iPod Touch type device that we want to sync our family calendars/reminders/notes to.  Is there a good docum

  • Help required for Payment Term change report in SAP BI

    Dear Experts , I have got a client requirement to develop a report to present all the purchase orders for which there has been a change in Payment Term. Could any one provide his input as which extractor can give me this information or where can I ge

  • Qosmio G10-133 has no sound

    Hi just new to forum so bare with me. Bought my g10 recently and carried out system restore as instructed on update documents: 1 product recovery cd-rom 2 qosmioplayer recovery cd-rom 3 qosmioplayer update cd-rom 4 qosmio update cd-rom. Notebook has

  • Query in sql

    oracle database version 10.2.0.1 on windows server 2003 segment_id is a common column in two tables "segment" and "mv_cat_seg_reg_prod" mv_cat_seg_prod can have more than a single row for each segment_id whereas segment table has one row for each seg

  • Math functions drawing...

         Hi, I'm looking for a java class like a JPanel that contains methods to draw mathematical functions, with axes (manual or auto), legends, ...      Does it already exist (I'm shure !) ? Where can I find such a class ?      Thanks.