LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to make a action to File copy.cut/del to Usb disk?And how to auto unplug the USB DisK with Labview?

My company manufacture the USB Disk.So now i need auto-action on it using Labview. THANKS!
0 Kudos
Message 1 of 7
(3,556 Views)
I'm not sure I understand the question, but if you write a .dll that communicates with the USB drive to unplug it, that .dll can be called from LabVIEW using the Call Library Function Node. Or, you can actually create a .dll in LabVIEW using the Application Builder if you know the calls that need to be made to the driver.
0 Kudos
Message 2 of 7
(3,543 Views)
I donnot know how to write the dll driver for handling the USB Disk. Could you give me a example code for it ?Thanks a lot !
0 Kudos
Message 3 of 7
(3,519 Views)
What is a USB Disk? If this is something that your company is manufacturing, your company will already have a driver for it and the dll's that go with that driver. The driver just enables the software to communicate with the hardware. What you would need to do is write a program that communicates with those dll's that come with the driver, which is not something I can do for you. I recommend talking to the driver developers at your company.
0 Kudos
Message 4 of 7
(3,503 Views)
One addition thing: assuming that a "USB Disk" is simply a hard drive that uses the USB bus, then any File operations you would need to do (copy, delete, etc.) would be done using the standard LabVIEW File I/O palette--the same as any other file I/O operation. The driver for the device in question would be responsible for making it appear as a valid storage device to the operating system.

Regarding the "unplug" question: assuming the device does require some special unmounting operation (which it may not in all OSes, or for all configurations of the device), I'll bet that is available via a DLL call to the driver, as Tyler suggests.

--John
0 Kudos
Message 5 of 7
(3,496 Views)
guys - I think he wants to unmount the USB FLASH DRIVE. There is no external driver for these devices - instead they are built into windows. (if you unplug the device without unmounting it you get an error dialog)
0 Kudos
Message 6 of 7
(3,490 Views)
Are you asking how to programmatically unmount a disk?
If your disk is mounted and showing up on the OS, you would read and write to it just like any other disk. If it's not recognized and mounted by the OS, labview won't help you, you need to get down to a lower level in the OS.


I'm not sure you can eject USB hardware directly with VI's. There's some OS level things that you can't do unless you use a system DLL. For example you can change the sound output volume with a VI but there is no provision for adjusting the sound IN.


Please clarify...

Sheldon
Technical geek, engineer, research scientist, biodegradable...
0 Kudos
Message 7 of 7
(3,484 Views)