Jump to content

Accessing USB FLASH DRIVE and it .dat file content


Recommended Posts

QUOTE (rejgina @ Apr 24 2008, 11:38 AM)

Hi guys, Good day!I have a problem.. I'm a new programmer of Labview. how can i access the USB FLASH DRIVE and the .dat file content by using the Labview.Hope you can help me. Thanks! Kind Regards,rejgina :lightbulb:

If your USB drive is (for example) installed as "E:", then a simple file open with E:\YourFilePath.dat should do it.

Do you need to know which Drive letter is assigned? You can get the drives by listing the Directories without specifying a path. You can then try to get the label anme of each one to find the USB drive you require...... (theory)

Ah, I just tried doing what I'm proposing, but I don't know how to get the Volume label from the Volume letter...... There's no "Get Volume Label" function.

It would be possible via a DOS Batch file or something, but I don't think there's a built-in LV function for it.

I looked under LV 8.20.

Shane.

Link to comment

Hi Shane,

Thank you for your reply...

I think I didn't explain right the question..

First I have a file (Myfile.dat) and it is constantly inserted... (E:\Myfile.dat)

What I need to do is to detect if the flash drive is already inserted so that I can read the file(E:\Myfile.dat) and then proceed to the testing..

I have read here taht i need to have awhile loop until the value for example set to true meaning it is inserted... But its oo complicated.. can you help me? Thanks!

rejgina :lightbulb:

Link to comment

QUOTE (rejgina @ Apr 28 2008, 12:18 AM)

Hi Shane,

Thank you for your reply...

I think I didn't explain right the question..

First I have a file (Myfile.dat) and it is constantly inserted... (E:\Myfile.dat)

What I need to do is to detect if the flash drive is already inserted so that I can read the file(E:\Myfile.dat) and then proceed to the testing..

I have read here taht i need to have awhile loop until the value for example set to true meaning it is inserted... But its oo complicated.. can you help me? Thanks!

rejgina :lightbulb:

Hi, I think the best way to check this, is to verify if the file exist. You can do it using the open/create/replace file vi. If the file exist (the USB flash memory is inserted) you will have a ZERO on the error out, but if it is not inserted you will have a SEVEN on the error out connector.

here my two cents.........

Over and out.

Norbac

Link to comment

QUOTE (Norbac @ Apr 29 2008, 04:58 AM)

Hi, I think the best way to check this, is to verify if the file exist. You can do it using the open/create/replace file vi. If the file exist (the USB flash memory is inserted) you will have a ZERO on the error out, but if it is not inserted you will have a SEVEN on the error out connector.

here my two cents.........

Over and out.

Norbac

Hi Norbac,

Yes i alredy do that.. But the error indicator is compose of a package the boolean the numeric and the strings? so how can i extract it to compare the numeric 7 to 0 so i can trigger my next program to proceed if read the memory stick??? thanks alot!!!

rejgina :lightbulb:

Link to comment

QUOTE (rejgina @ Apr 28 2008, 08:54 PM)

Hi Norbac,

Yes i alredy do that.. But the error indicator is compose of a package the boolean the numeric and the strings? so how can i extract it to compare the numeric 7 to 0 so i can trigger my next program to proceed if read the memory stick??? thanks alot!!!

rejgina :lightbulb:

Please read the introduction to LabVIEW first and then a bit about clusters, bundling and unbundling.

Rolf Kalbermatter

Link to comment

QUOTE (rejgina @ Apr 28 2008, 07:54 PM)

Hi Norbac,

Yes i alredy do that.. But the error indicator is compose of a package the boolean the numeric and the strings? so how can i extract it to compare the numeric 7 to 0 so i can trigger my next program to proceed if read the memory stick??? thanks alot!!!

rejgina :lightbulb:

OK, that "package" is a Cluster, you can access any of the Cluster components using the "Unbundle by Name" function, it is located on the Cluster Palete. With this function you can select, in a induvidual way, any of the components of the Cluster.

I hope this information "make a light on your way" ;)

Norbac

Link to comment

QUOTE (Norbac @ Apr 29 2008, 09:42 PM)

OK, that "package" is a Cluster, you can access any of the Cluster components using the "Unbundle by Name" function, it is located on the Cluster Palete. With this function you can select, in a induvidual way, any of the components of the Cluster.

I hope this information "make a light on your way" ;)

Norbac

Guys,

Thanks alot!!! I really appreciate your help... I guess i need to read alot of things.. Sorry guys, 'coz i just started this w/o any reading i just started this by the lecture of one of my colleagues and by self practice....I'm glad I found this site!!! Thanks! God Bless! ;)

Kind regards,

rejgina

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.