Detect USB Stick insertion

I am trying to write a LabVIEW app that will be able to detect that a USB stick/key has been inserted into the computer. I know that I can get the names and serial numbers of all the drives that are currently mounted. However, I do not know how to check to see if one of them is a USB mass storage device, more specifically a USB stick as opposed to a USB-attached optical drive.
I could just check the size of the device and if it is under 4GB assume that it is a USB key. But if there is a more elegant way of doing it that I can be more sure of, I would like to do it.
Using LabVIEW 8.2.1
Kyle

Thank you. I think I am just going to go with the polling with the list directory VI every 100 ms or around that. Just compare the new list of drives to the old ones, if there is a new one I will take the action that I want.
I think the environment is controlled enough that we won't have issues with that. No one will be swapping drives out like mad (or at least they shouldn't be!).
Kyle
Message Edited by Kyle Thompson on 05-29-2007 08:07 AM

Similar Messages

  • Think M72e start windows 7 with usb stick inserted

    I know in the scheme of things my M72e annoyance is pretty minor,but I am more curious than exasperated.
    If I try to start the machine with a usb stick in any of the ports it won't boot into windows 7and I get a "No bootable partition in table" message and the machine just hangs there.
    If I remove the usb stick and restart, it boots to windows 7 fine.
    Obviously, i figured that the machine is trying to boot off the usb stick before the harddrive. So I went into the bios but there is no option to boot off the hardrive first.
    I can press F12 and it gives me a one time option to boot off the hardrive but I don't want to have to do this everytime.
    Anybody know why Lenovo in its wisdom hobbled the boot choices in the bios?
    Thanks,

    F3Spirit wrote:
    Thank you,
    I try this.
    Also check this one out
    But i think you would be far better served by installing Windows in a virtual machine.

  • Detecting USB Device insertion/​removal

    Hi All,
    With reference the an earlier post by softengr (here), I'm trying to detect the USB devices while being connected.
    I'm trying to compile the same code posted by softengr, but getting some compilation error even after adding windows.h.
    I think I'm missing some header file here.
    The following are the errors during compilation;
      Undeclared identifier 'DEV_BROADCAST_DEVICEINTERFACE'.
      Undeclared identifier 'NotificationFilter'.
      Undeclared identifier 'GUID_DEVINTERFACE_USB_DEVICE'.
      Undeclared identifier 'GUID_CLASS_USB_DEVICE'.
    I'm using LabWindows/CVI 2012 with Windows7 64bit.
    Can anybody suggest waht am i doing wrong here.
    Thankyou,
    Dosth

    A search of the NI forums for "USB Event notification" returned an entry that may help you:
    Windows device event notification
    Message Edited by Phillip Brooks on 12-01-2008 06:49 AM
    Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
    If you don't hate time zones, you're not a real programmer.
    "You are what you don't automate"
    Inplaceness is synonymous with insidiousness

  • My Superdrive cannot be detected by both my Macbook Pro Retina and MacBook Air. It used to be working perfectly. On the same token My USB stick cant be detected by My MacBook Pro Retina. But It can be detected by my Macbook AIR

    My SuperDrive cannot be detected either by MY MBP Retina and my MBA. it was working perfectly till a month ago.
    To add to this issue my MBP Retina is not able to detect my USB stick either. Is there anything to do with the firmware?!!

    Is this the Apple USB 2.0 SuperDrive (I'm assuming that it has to be...). Likely a problem with the drive, if neither computer recognizes it. Take it to your local Apple Store and have them look it over and see if it will work with any of their display models. If you're still under warranty, they should replace it for nothing. If it's out of warranty, you may just have to buy a new one.
    I would also carry along your rMBP and the USB stick that's causing problems. Have you tried another USB device in the port? Another USB flash drive? Or is the problem with the one flash drive?
    I don't know of any firmware updates for the 2012 models that have come out specifically tied to USB problems. There were some earlier in the year... have you kept up with all of the updates via Software Update?
    Good luck - sounds as if you've a bad SuperDrive and (possibly) a problem with your USB ports (or maybe just this one USB flash drive).
    Clinton

  • LR starts every time I insert a USB stick or memory card

    Hi,
    My problem is that LR starts up every time I insert a USB stick or memory card into a slot. I don't want this, but cannot find a way to turn it off. Can someone help?
    Thanks,
    Rogier

    OK, sorry, should have checked. Got my question answered.
    Thanks,
    Rogier

  • Script to detect when USB stick is plugged

    Script to detect when USB stick is plugged to my mac.
    Is it possible?
    Thank you!

    How to invoke a Unix command from Applescript
    Name: toggle-hidden
        Author: rccharles
        Copyright 2010 rccharles
        GNU General Public License
        This program is free software: you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation,  version 3
        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU General Public License for more details.
        For a copy of the GNU General Public License see <http://www.gnu.org/licenses/>.
    on run
        -- Write a message into the event log.
        log "  --- Starting on " & ((current date) as string) & " --- "
        try
            set results to do shell script "defaults read com.apple.finder AppleShowAllFiles"
            log "results = " & results
        on error errorMsg
            -- Most likely, the variable AppleShowAllFiles does not exit. 
            -- AppleShowAllFiles isn't defined in a newly created account.
            -- The write command below will create the AppleShowAllFiles variable.
            log "Error ..." & errorMsg
            set results to "FALSE"
        end try
        if results = "FALSE" then
            display dialog "Displaying all files.  Finder will restart." giving up after 2
            set the_rc to do shell script "defaults write com.apple.finder AppleShowAllFiles TRUE  ;killall Finder"
        else
            display dialog "Hiding hidden files.  Finder will restart.." giving up after 2
            set the_rc to do shell script "defaults write com.apple.finder AppleShowAllFiles FALSE  ;killall Finder"
        end if
    end run

  • New USB stick - "The disk you inserted was not readable by this computer'

    I recently bought a 32GB USB stick to transfer data from my current Powerbook G4 with Mac OS X 10.4.11 to a new laptop.
    However, when I insert the disk I am told "The disk you inserted was not readable by this computer" with the options to "Initialise", "Ignore" or "Eject".
    In all honesty I just want to avoid having to send the USB back, getting a refund and finding one that is compatible with my computer.
    Consequently I was wondering if there's a way I can alter the USB disk to become readable by my computer?
    Also the USB is described as an "iBoutique 32GB USB 2.0 Hi-Speed Elite Flash Drive".
    Would be really grateful if you could help as my my current laptop is dying due to it's age and I would like to move the data over to the new laptop as soon as possible.
    Thanks,
    Becca

    It would lose all data re-initialising it.
    A few options...
    You could format that HDD as Fat32/MS-DOS, but you'd be limited to 4 GB Filesizes.
    NTFS-3G Stable Read/Write Driver...
    http://www.ntfs-3g.org/
    MacFUSE: Full Read-Write NTFS for Mac OS X, Among Others...
    http://www.osnews.com/story/16930
    MacDrive for the PCs... allows them to Read/Write HFS+...
    http://www.mediafour.com/products/macdrive/

  • Im staying in SA and wants to use a 3G HSPA USB stick to get 3G on the go.  The moment I insert my stick in the slot it says: "unexpected error".  Is this 3G stick compatible with Apple MacAir

    Im staying in South Africa and wants to use a 3G HSPA USB stick to get 3G internet on the go.  I have put the stick into my USB port, but get an msg " UNEXPECTED ERROR, PLEASE RESTART.  Every time I press restart the same happens again. 
    Is this stick compatible with Apple Macbook Air.

    You need to look up the specifications of the device.

  • Problems installing Windows 7 from a USB stick

    I have got a brand new W510 that i am doing a clean install of Windows 7.
    However i have faced major problems with installing from a USB stick attached to the W510.
    Please notice that there isn't any problem installing Windows 7 to my other PC from this USB stick, this problem is only present with W510.
    I have the BIOS from Lenovo v 1.35, Bios settting are reset to default to isolate any faulty settings.
    In the readme file the say they have fixed some USB detection problems by Windows. bug still present??
    Version 1.35 (BIOS ID: 6LET74WW) [for BIOS ID 6Lxxxxxx-based computer]
     [Problem fixes]
    - Fix an issue that a USB device is not recognized by Windows connecting
    to USB 3.0 port.
    Below is picture of the problem.
    First i choose to boot from my USB Stick Sandisk Cruzer which Windows 7 files are placed, i know these files and the USB stick works with my other computer.
    Picture 1
    Next step when it boots
    Picture 2
    I press Install Now
    Picture 3
    This warning message comes up, can't find driver device
    Picture 4
    I click browse and try to find my USB stick, none of my USB sticks are listed, is this a Lenovo BIOS bug or Windows 7 Installation detection problem??
    Picture 5

    I think you need to fix your links, you seem to have maybe copied the post from another board / forum, the link style you have inserted doesn't work here.
    Andy  ______________________________________
    Please remember to come back and mark the post that you feel solved your question as the solution, it earns the member + points
    Did you find a post helpfull? You can thank the member by clicking on the star to the left awarding them Kudos Please add your type, model number and OS to your signature, it helps to help you. Forum Search Option T430 2347-G7U W8 x64, Yoga 10 HD+, Tablet 1838-2BG, T61p 6460-67G W7 x64, T43p 2668-G2G XP, T23 2647-9LG XP, plus a few more. FYI Unsolicited Personal Messages will be ignored.
      Deutsche Community     Comunidad en Español    English Community Русскоязычное Сообщество
    PepperonI blog 

  • How do I block an account on a USB stick?

    My daughter has created a new account on a USB stick (which I cannot find!) that overrides all the passwords and security checks for her account.  She has named it, and uses it when I am at work.  I have no idea how to stop this and although I have changed the passwords an all our family accounts to one she CANNOT guess, she obviously is able to gain access to the computer with the USB stick.  I have no idea where to begin!  The account shows as  "[son's name]'s iMac" and it has Administrators priviledges (although I have changed his settings back to "managed" in the Users & Groups pane, this makes no difference), my son is at University and therefore does not live with us and has not given her permission to use his account.  This has been going on now for three months and I'm sick of her downloading rubbish onto my computer but more importantly it means she is coming back downstairs to log back on until 2 am on a school night when we're all asleep!  Can someone please help me with blocking this account?  I'd be very grateful!!   

    Insert the stick.
    Wait for it to appear on the Desktop.
    Drag your files to it.
    Wait for the copying to complete.
    Drag the icon of the drive to the Trash.
    Do not remove the stick until the icon has disappeared from the Desktop.
    There are backup programs available which will make the process easier by using 'incremental backups' which copy over and update only changed files.

  • Windows 7 Bootable USB stick

    Hi, I am trying to create a bootable USB stick for use in deploying an Embedded Windows 7 image.  I have followed the instructions here:
    http://msdn.microsoft.com/en-us/library/ff795043(v=WinEmbedded.1001).aspx.  That seems straight forward.  But, I can not seem to boot to the stick.  Is that page missing any instructions?
    Thanks,
    Scott

    Ok.  Still no luck.  I have tried on more than one usb stick.  I have also booted the target device from a CD-Rom to prove the BIOS is working properly.  Steps 1 - 7 are straight forward.  I am new to Windows Embedded 7 in general
    and ICE.  But, 8-14 seem fairly straight forward as well.  I am not quite sure what to look at.   ICE is a trial version. Hopefully that is not an issue.  For the ICE portion above, I do the following. 
    1) I start ICE.  I have the distribution share pointing here: C:\Program Files (x86)\Windows Embedded Standard 7\DSSP1.
    2) I right click to create a new answer file.  I Validate -> Validate Only, then I resolve the dependencies.  I then save the answer file.  I can post that if it helps.
    3) I then choose Tools -> Create Media -> Create IBW Image from Answer File..." and chose a folder to write that to.  After the process, the image folder I created, has the following in it:
    AUTORUN.INF
    AutoUnattend.xml
    AutoUnattend_Files
    BOOT
    BOOTMGR
    EFI
    RELEASE NOTES.HTM
    SETUP.EXE
    sources
    SUPPORT
    UPGRADE
    4) I copy that to the root of the USB stick.
    5) I go to my target device.  I try to boot to the stick.  I am told "Disk Boot Failure.  Insert system disc and press enter"
    So, it seems that I can not boot from the stick.  In the past, I have had Windows XP installed on the target device, and, know that I can see the USB port.  So, I do not believe that is the problem.  Maybe someone sees a problem with what
    I have done?  Any ideas on how to trouble shoot?
    Thanks,
    Scott

  • Is it possible to burn playlists in MP3 format from i tunes to an external drive such as a USB stick.  I can only find options to burn to a CD

    hi there,
    New to these forums and communites and was just trying to get feedback on this question...is it possible to burn playlists in MP3 format from i tunes to an external drive such as a USB stick.  I can only find options to burn to a CD.
    If anyone can help[ that would be great.

    Melofthesea wrote:
    hi there,
    New to these forums and communites and was just trying to get feedback on this question...is it possible to burn playlists in MP3 format from i tunes to an external drive such as a USB stick.  I can only find options to burn to a CD.
    If anyone can help[ that would be great.
    Mel,  Sure, although that is "copying," not "burning."  It is easily done, as follows:
    Insert the USB stick into your computer, and open it up so it looks like a folder.  Highlight the songs you want in iTunes, and drag them into the folder.
    If you normally run iTunes in full screen mode, make it smaller so that you can do the drag.

  • USB stick troubles

    I'm trying to get USB sticks up...just one problem: every time I plug in my USB stick, it mounts somewhere else. I set
    /dev/sdb1 /media/usb vfat default 0 0
    in my fstab, but the next time I plugged it in, it registered at sdc! Now, I'm no expert, and I know we're supposed to do things on our own, but this isn't working. what's the accurate fstab setting for this?
    Also, when I get it right (like if I changed the above code to sdc1), and select "open in new window" in the KDE dialogue, I get an error message "Only HAL can do this." UPDATE: The same happens when I insert another medium, such as a CD.
    And I've been over the HAL wiki page as well as the forum post it leads to. The post didn't really help me because the poster once had the feature working fine.
    Last edited by ArchPad (2007-05-17 19:37:01)

    One more question. I get an error when ejecting my iPod, be it from Amarok or from the Desktop. It successfully unmounts, but fails to eject. For those familiar with iPods, the screen persists with the "Do not disconnect message" and the flashing circle. Has anyone else run into this, and if so, where can I find a fix?

  • USB Stick

    I recently bought a 120mb mp3 player/ usb stick in europe at the Media Markt. It was a great buy, pretty cheap with 128mb and it plays mp3s!
    last week i plugged it in the back of my laptop, but then my gf wanted to sit down on my chair, so i accidently picked up the laptop and moved it. when i was concentrated on the computer again, i saw the usb-stick and it was crooked! before i had moved the laptop, it was mounted and i was accessing files on the stick. Now since  i saw it crooked, i plugged it out without mounting and i trying to straighten.
    when it was good again, Arch Linux couldn't recognize it. i checked dmesg and it said "device will not accept address" and then a number. each time that i would plug it in, the number would increase by one. i switched over to M$ XP and the usb stick didn't work either.
    i thought that maybe the usb pins inside the mp3 had broken, so i opened it to inspect it. i grabbed a voltmeter and i checked that everything was good. and yes it was!
    when the usb was working fine, i would just plug in the usb stick while it was on and then it would turn on by itself and display on the screen "USB".  The files are trapped inside. Since i can't mount it anywhere, the mp3 files still play, but i can't access the data files.
    Has anyone experienced anything similar? is there any hope that i can get the usb stick working again?
    btw, the stick is a TIME stick. it's the small one with purple around it. since it was 33 euros, there's no features on it. it just plays mp3s and is also a storage usb.

    My USB stick is dying on me too: yesterday it was working just fine. I was installing Cygwin/X on it on a Windows XP computer, but I stopped the install after a few percent since copying a few thousand files over USB 1.0 (the stick is USB 2.0, the controller was 1.0) takes a lot of time.
    In the end, I installed Cygwin/X to a dir on the hard disk, RAR'ed the dir and copied the .rar file to the stick (took about 30 seconds).
    This morning I wanted to access the stick on my own computer running Arch, but I only got a partial dirlisting after mounting it. I tried unmounting it, but this didn't work (device busy). I yanked it out, and tried to remount it, but this time it wouldn't even mount. This is the error I got:
    Dec 13 12:38:24 ferro usb 2-2: new full speed USB device using address 7
    Dec 13 12:38:24 ferro hub 2-2:1.0: USB hub found
    Dec 13 12:38:24 ferro hub 2-2:1.0: 1 port detected
    Dec 13 12:38:24 ferro usb 2-2.1: new full speed USB device using address 8
    Dec 13 12:38:24 ferro scsi4 : SCSI emulation for USB Mass Storage devices
    Dec 13 12:38:24 ferro Vendor: Generic Model: USB Flash Disk Rev: 1.00
    Dec 13 12:38:24 ferro Type: Direct-Access ANSI SCSI revis
    ion: 02
    Dec 13 12:38:24 ferro SCSI device sda: 512000 512-byte hdwr sectors (262 MB)
    Dec 13 12:38:24 ferro sda: Write Protect is off
    Dec 13 12:38:24 ferro sda:scsi4: ERROR on channel 0, id 0, lun 0, CDB: 0x28 00 0
    0 00 00 00 00 00 08 00
    Dec 13 12:38:24 ferro Current sda: sense = 70 3
    Dec 13 12:38:24 ferro ASC=11 ASCQ= 0
    Dec 13 12:38:24 ferro Raw sense data:0x70 0x00 0x03 0x00 0x00 0x00 0x00 0x0a 0x0
    0 0x00 0x00 0x00 0x11 0x00 0x00 0x00 0x00 0x00
    Dec 13 12:38:24 ferro end_request: I/O error, dev sda, sector 0
    Dec 13 12:38:24 ferro scsi4: ERROR on channel 0, id 0, lun 0, CDB: 0x28 00 00 00
    00 01 00 00 07 00
    I've tried the stick on two of my computers, one of them running Arch and giving the above error message, the other one running Windows98 SE. Both computers have been able to access the stick just fine. They both also have a USB 1.0 controller. Unfortunately, none of them can read the stick anymore.
    So now I'm testing the stick on a computer at school, running Windows 2000 SP4 with a USB 2.0 controller on-board.
    The disk is shown in My Computer, but I can't access it. Just like in Windows98.
    Furthermore, when I put the stick in a USB-connector, the LED flashes a few times as usual, but then it stays on for as long as it's in the computer.
    Does anyone have any suggestions on how to save quite a lot of data from the stick?

  • Won't recognize my USB stick

    i recently bought my mac pro and i also bought a 4GB USB stick from office Depot, and every time i insert the stick in the port, nothing happens. i already tried to pull up the disk utility in application, but it is unrecognizable. what do i do?

    Hi N,
    Does the flash drive work in another computer? Does another USB device work in the port/s you are trying?

Maybe you are looking for