05-12-2009 08:59 AM
I have a vi that has worked well for years. I took the basics for saving my data and made it part of a new vi. It involves taking the base path, 'C:\' and taking the motor number (1001), and appending to it the file name for the data to save, 'finalvibes.dat'. The expected appended path should be 'C:\FanVibes\1001\finalvibes.dat', but what I am getting is 'C:\\FanVibes\1001\finalvibes.dat'. How come?
05-12-2009 09:01 AM
05-12-2009 09:08 AM
Appending a path adds a \. Pass it C: instead of C:\ and you will get a single c:\
05-12-2009 09:11 AM
I tried that, but then again, maybe something else was wrong. I believe when I tried to take the '\' out of the path, it automatically put it back in, but I could be wrong.
Thanks!
05-12-2009 09:28 AM
Here is the screen of my save data portion. I was correct. For some reason, when I delete the '\', the software puts in back in. If I erase the '\' and the semicolon, obviously the path is not valid.
Thanks in advance.
By the way, the FanVibes folder is a valid folder on my C drive. I am appending the date, the machine number (1001) and the type of data, finalvibes is spectra, time is time waveforms, and overalls are rms overall values.
05-12-2009 09:38 AM
It appears you have "C:\(space)" in the constant. At least this is what the probe at C:\ \FinalVibe.... is telling me.
Are you saying that when you delete the \ from C:\ it puts it back in?
05-12-2009 09:40 AM
05-12-2009 10:21 AM
05-12-2009 10:23 AM
elset191 wrote:It appears you have "C:\(space)" in the constant. At least this is what the probe at C:\ \FinalVibe.... is telling me.
Are you saying that when you delete the \ from C:\ it puts it back in?
It's supposed to since it's a path constant, and "C:" is not, technically, a valid path.
The reason the extra "\" is there is indeed because there is a space at the end of the constant.
As I noted before, you should be using Build Path for all path creation. In your code you are using both.