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.
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.
02-04-2011 03:22 AM
Hello all
I would like to know if it is possible to partition, and format, a USB drive (or HDD for that matter) from LV. I could really use an automated program to find a specific device and partition/format it.
It is to be used by production personnel, and 'diskpart' is a bit too low level for them.
Ideally my application should recognise a USB memory stick, partition/format it and write an image file ('imagex' from the Windows prompt).
I'm using the newst LV and Windows 7.
Is any of the above possible, and where do I look?
02-04-2011 03:51 AM
Hi teknik_kim,
you can use diskpart and remote control it from your LV application. You can use the "System Exec.vi" for it.
Hope it helps.
Mike
02-04-2011 03:55 AM
Hello
Thanks, but there is an issue with this method. I need to be able to find the specific USB device before I partition it. In this case the 4028MB key is the one to partition and format.
How can I make sure to always (automatically) choose this disk - it could also be mounted as disk 3-5 at other times.
Microsoft DiskPart version 6.1.7600
Copyright (C) 1999-2008 Microsoft Corporation.
On computer: DK-CNCQ34J
DISKPART> list disk
Disk ### Status Size Free Dyn Gpt
-------- ------------- ------- ------- --- ---
Disk 0 Online 149 GB 0 B
Disk 1 Online 1910 MB 0 B
Disk 2 Online 4028 MB 0 B
Disk 3 No Media 0 B 0 B
Disk 4 No Media 0 B 0 B
Disk 5 No Media 0 B 0 B
DISKPART>
02-04-2011 04:13 AM
Hi teknik_kim,
if you know the size and you have only this usb stick, then you can extract it from your list. If you need it automatically, then you can wait on an event. In winXp (should be the same on WIN 7) you get an event if you add a new device (USB) to the pc. If this is a USB stick, then you can also get the drive to which it is mounted.
Mike
02-07-2011 01:54 AM
Hello again
Thanks for your reply. I am, however, uncertain how to use LV USB functionality to find the drive. It is in fact a Compact Flash card, not a USB memory stick as I previously mentioned (sorry).
Is it stille possible to detect upon insertion, no matter the state of the drive (formatted, unformatted, partitioned, unpartioned)?
02-07-2011 11:14 AM - edited 02-07-2011 11:16 AM
Hi teknik_kim,
you can also get your information if you use the "system exec" function to call the diskpart.exe. Call it with a script as parameter and parse the result. Attached you'll find an example and the result from my system.
Hope it helps.
Mike