11-26-2012 03:41 AM
Hey everyone.
I bet there is an easy solution to my problem. But for the life of me I cannot find it.
I have this VI that measures pressure. It works brilliantly but I when I want to save the data the VI produces I have specify a file name using a string control, if I don't it prompts me to write it. This wouldn't be a problem except for the fact that it has to log data quite often and I can't always stay around the computer when its running. I therefore wrote some code that automatically creates a unique string (not shown in the picture) but when I attach that string to build path string terminal I prompt me to write a file name instead.
In short: I want my VI to automatically create a file with unique filename (e.g.. "Timestamp_Operator_type_of_measurement_measurement_number")
Any thoughts, I've tried altering the options for the path control but it doesn't seem to work.
Thank you in advance
Atamsih
Solved! Go to Solution.
11-26-2012 03:47 AM - edited 11-26-2012 03:51 AM
If you probe the path, what do you get?
And you really should form the file path outside the loop and pass it in.
11-26-2012 03:58 AM
I would add a number to your file name, check if file exists (check if file or folder exists.vi) , if it does increment the number and try again unitl the file does not exist then use this file name.
hope it helps
11-26-2012 04:19 AM - edited 11-26-2012 04:41 AM
Hey BillMe
When im probing the path that im inputting is "C:\users\RI-DEMS\Data" which is what i want.
The file name input probe says "26-11-2012 11:14 63.txt" which is a timestamp and the measurement number.
But the output of Build path remains "not a path" why is that?
And of course you're right. I should put the path outside the loop.
Hope this helps in determingen the problem.
Atamsih
EDIT: Fixed typo with forwards slash instead of backslash in pathname
11-26-2012 04:22 AM
In the actual program i am adding numbers and whatnot to the filename string. My problem is that the path isn't formed corretly and i don't understand why
Thank you anyway.
11-26-2012 04:23 AM
was the slash direction in the path a typo or is that the actual direction?
I would expect the path to be of the format C:\Users\RI-DEMS\Data
hope it helps
11-26-2012 04:38 AM - edited 11-26-2012 04:40 AM
That is a typo.. forgot it should be backslash rather than forward slash..
11-26-2012 04:42 AM
the filename 26-11-2012 11:14 63.txt is invalid, you cant use colons on a filename, if you replace them with hyphens you should be ok
hasnt shown here a solution yet by the way
11-26-2012 05:50 AM
I am ashamed! you're completly right!
Kudos and solution ackowlegeded!
11-26-2012 05:52 AM
I wouldnt be too embarassed I keep doing things like that, glad your problems solved tho