09-06-2010 05:16 AM
Hi all,
I will make my question as general as possible as I believe someone must have come accross this behaviour before. I am using the Open/Create/Replace File function to programmatically open a file, by giving a path input created in an earlier vi. The odd behaviour I observe is that although Labview returns Error 1 when I give my file programmatically, it reads the file OK if I give it as a constant. The path constant I give is exactly the same as the one I am tryinng to give programmatically.
Any suggestions? Is it to do with some string formatting problem? I have attached my portion of VI dealing with the path_in section.
Thanks for your time,
Regards,
Harry
Solved! Go to Solution.
09-06-2010 07:26 AM - edited 09-06-2010 07:30 AM
Wild guess: You need to use "build path" instead of "concatenate strings" to built the path.
(Also use a path diagram constant (not a string!) for "c:\ni-rt\" and get rid of the "trim whitespace" and "string to path".)
See if it makes a difference. (build path is OS independent while string operations are not).
Never operate on paths as strings. There are very few instances where that would be appropriate.
09-06-2010 10:11 AM
Thanks altenbach,
I followed your advice and was able to sort it out..
Cheers