LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

file path

Sorry, can I ask a very simple question...I would like simply make a string control linked to a file path, in turns linked to the TDMS, so that the name the user writes in the control string is added to the final name of the saved file. So for example, if the file paht is C/.../Test1, if I write "CONTROL" on the string control, the final name is C/.../Test1_CONTROL. Thank youj.

0 Kudos
Message 1 of 10
(419 Views)

How about something like this?

filename.png

-------------------------------------------------------------------
Unfortunately, most readers of this Forum, including some real Experts, have not mastered the skill of being able to read the code that Posters fail to post. If we cannot see "what you did wrong", we are unable to tell you how to fix it. (Bob Schor 28 August 2018)
Message 2 of 10
(410 Views)

@RTSLVU wrote:

How about something like this?

filename.png


Personally, I prefer using the Format Into String than the Concatenate Strings expanded to enable many constants.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Message 3 of 10
(391 Views)

Hi, thank you to all for your suggestions...yes it is that!

Just the last question about the file path (the /Base/Path/to your file in the figure you attached). When I run the VI it ask me to choose a file.

Is possible to choose only the directory? so that the write to measurement file then creates the file with the name indicated in string? thank you!!!!

0 Kudos
Message 4 of 10
(356 Views)

What VI are you referring to?  To get a dialog when you run, you would have to be trying to open/create/replace a file or something along those lines.

 

You could use the File Dialog express VI and configure it so that you can only select a folder.  That would only replace the folder constant we used.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
0 Kudos
Message 5 of 10
(339 Views)

@GT_ wrote:

When I run the VI it ask me to choose a file.

Is possible to choose only the directory?


That path is a diagram constant and cannot be changed at run time. If you get a dialog, it means you entered garbage or left it empty.

If this is a path control, you can right-click and change "browse options" , of course.

 

Browse.png


LabVIEW Champion. It all comes together in GCentral GCentral
Message 6 of 10
(331 Views)

@crossrulz wrote:

You could use the File Dialog express VI and configure it so that you can only select a folder.  That would only replace the folder constant we used.


While I, in general, don't like Express VIs, the File Dialog Express VI is an exception (largely because NI took away the "old" way of doing it which had much better Property settings).  Look at the Detailed Help for this function.  If you want to always use a particular Folder to save your file, you would wire its path into the Start Path input.  If you knew, in advance, the name of the file, but wanted to pick the Folder to put it in, you would configure the Express VI to return only a Folder (you can choose if it has to be new, can be existing, or must be existing), and would combine the Path from the Express VI with the name of the File using a Build Path function.

 

I miss the old File Dialog function, but it hasn't entirely gone away -- it is buried in the File Dialog Express VI with the note that "LabVIEW no longer supports this function on the Block Diagram.  National Instruments recommends that you use the File Dialog Express VI instead".

 

Bob Schor

0 Kudos
Message 7 of 10
(324 Views)

@crossrulz wrote:

You could use the File Dialog express VI and configure it so that you can only select a folder.  


I really hate that option, because the browse dialog does not show any files, often confusing the user. I always set it to "files or folders" (often even with a pattern specific to the application) and give the user a choice. (1) "Click select folder" in the dialog, (2) just double-click any file in the dialog and it will strip it to the folder.

 

For a real "folder only" dialog, something like this would be more intuitive.

 

FolderBrowser


LabVIEW Champion. It all comes together in GCentral GCentral
0 Kudos
Message 8 of 10
(285 Views)

Thank you to all of you 🙂

0 Kudos
Message 9 of 10
(227 Views)
Highlighted

@crossrulz wrote:

@RTSLVU wrote:

How about something like this?

filename.png


Personally, I prefer using the Format Into String than the Concatenate Strings expanded to enable many constants.


That actually is a bit neater, I will have to remember it.

-------------------------------------------------------------------
Unfortunately, most readers of this Forum, including some real Experts, have not mastered the skill of being able to read the code that Posters fail to post. If we cannot see "what you did wrong", we are unable to tell you how to fix it. (Bob Schor 28 August 2018)
0 Kudos
Message 10 of 10
(205 Views)