Jump to content

How to get file path?


Recommended Posts

Hello everyone,

Please take a look at the enclosed image. How could I get the file path value in case "True"?

(Case "True" description: there is no path input to "Read from Text file", a dialog box will pop up for selecting file. I want to get the path value and pass it back to the file path control on front panel. )

Thanks in advance

post-17688-038556700 1287066290_thumb.pn

Link to comment

Hello everyone,

Please take a look at the enclosed image. How could I get the file path value in case "True"?

(Case "True" description: there is no path input to "Read from Text file", a dialog box will pop up for selecting file. I want to get the path value and pass it back to the file path control on front panel. )

Thanks in advance

You might consider using the function "Check if File or Folder Exists" instead. The path may not be empty, but that doesn't mean the file exists.

Use the file or folder exists? output to control your case statement and use the dup path for the read file function.

Link to comment

If you use the Close File function, the output is the path to the file.

Yes, that's it. Thanks. How could I ignored "close file" :frusty:

You might consider using the function "Check if File or Folder Exists" instead. The path may not be empty, but that doesn't mean the file exists.

Use the file or folder exists? output to control your case statement and use the dup path for the read file function.

Thanks. "Check if File or Folder Exists" does avoide the VI to open unexist file, but it couldn't deal with empty path. So I combied both "Check if File or Folder Exists" and "Empty string or path".

Edited by Mars Su
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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.