LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Automatically save using build path

Solved!
Go to solution

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

0 Kudos
Message 1 of 11
(3,571 Views)

If you probe the path, what do you get?

 

And you really should form the file path outside the loop and pass it in.

0 Kudos
Message 2 of 11
(3,565 Views)

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

Please remember to accept any solutions and give kudos, Thanks


LV 8.6.1, LV2010,LV2011SP1, FPGA, Win7
0 Kudos
Message 3 of 11
(3,557 Views)

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

0 Kudos
Message 4 of 11
(3,552 Views)

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.

0 Kudos
Message 5 of 11
(3,548 Views)

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

Please remember to accept any solutions and give kudos, Thanks


LV 8.6.1, LV2010,LV2011SP1, FPGA, Win7
0 Kudos
Message 6 of 11
(3,546 Views)

That is a typo.. forgot it should be backslash rather than forward slash..


0 Kudos
Message 7 of 11
(3,541 Views)
Solution
Accepted by Atamsih

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

 

 

Please remember to accept any solutions and give kudos, Thanks


LV 8.6.1, LV2010,LV2011SP1, FPGA, Win7
Message 8 of 11
(3,535 Views)

I am ashamed! you're completly right!

Kudos and solution ackowlegeded!

0 Kudos
Message 9 of 11
(3,520 Views)

I wouldnt be too embarassed I keep doing things like that, glad your problems solved tho

Please remember to accept any solutions and give kudos, Thanks


LV 8.6.1, LV2010,LV2011SP1, FPGA, Win7
0 Kudos
Message 10 of 11
(3,517 Views)