LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Fine if using File Dialog; error otherwise.

 Hello,

 

I'm heavily modifying a scanning file for a laser and I've run into an issue. When I run the vi with File Dialog, I click okay to select a directory and it works wonderfully. If I attempt to replace this with a string containing the path name, it doesn't pass on the filename properly. I'm not quite sure why. I guess two questions.

1) Anyone have any ideas why this might be?

2) What is the actual output from the File Dialog node?


Thanks!

0 Kudos
Message 1 of 4
(2,240 Views)

Please attach the actual VI, especially the one that does not work (i.e. with the string input, not the file dialog).

 

Is the string formed correctly? proper delimiters, etc.

Is the string control set to "limit to single line"?

Who wrote the subVIs? What's in them?

Why are you converting the path to a string?

0 Kudos
Message 2 of 4
(2,236 Views)

LiquidPhD wrote:  If I attempt to replace this with a string containing the path name, it doesn't pass on the filename properly.

My recommendation is to change that subVI to accept a Path data type instead of a string.  Then you know that the path is formatted correctly.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 4
(2,209 Views)

Path-to-string should really only be used for either string formatting or for cases where external code requires a string (e.g. "system exec"). If you don't want to modify the subVI, you can still use a path control and convert to to a string before the subVI to ensure that the syntax is correct.

 

Every time you use strings (for paths) instead of path datatype, the code is immediately platform specific and will not work on other OS types (mac, linux, etc.).

0 Kudos
Message 4 of 4
(2,189 Views)