LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Open or create file doesn't allow creation of file

As I said, we need the VI containing whatever you entered as default data in the path control. The rest we can leave or delete, does not matter. You can even paste that path control into a new VI and attach it here. That's all we need.

0 Kudos
Message 21 of 38
(1,403 Views)

@James.M wrote:

@rr1024 wrote:
I have to strip a path from a path dialog and then build it again even thought the path and file are already in  the path. That is a bit on the quarky side, I do realize that all the other languages I know all have some quarky things, usually compile issues but non are perfect but file handly should be more straight forward I think.

Aside from all the other back and forth that's going on, what you've done is completely unnecessary. The Open or Create option does do exactly what you've forced in your code. If it's not, then there's something wrong with your path. Stripping and Building your path as well, not something I've ever seen needed before.

In my first reply, I asked "What path are you trying to use?". I bet if you had responded with your path, we could have pointed something out there that is causing your issue.

 

What you're doing here is adding extra parsing steps and hoping the translation functions work magic to fix your bad path. Please include your VI with the path set as default, so we can run the code the same way you are. That's the only way to get to the real bottom of this, instead of the see-what-sticks method.


That path has not change its the application directory which is C:\Users\xxx101\Documents\99.97 Software Tools\LabViewProject\34401A Prj

The path works, I can read, write and I am the owner of it.

 

Well that is what is so confusing about this, the path was the same path before in the orginal code, but in order to make it work for what ever reason I had to add strip path

0 Kudos
Message 22 of 38
(1,402 Views)

THe path control still does not contain any default data as requested.

0 Kudos
Message 23 of 38
(1,384 Views)

@altenbach wrote:

THe path control still does not contain any default data as requested.


No default path is require if you click the little path icon, you will recieve a browser window that you can browse to your own path. Because many people tend to enjoy using MS Default My Documents directory and it's path is variable by user, i.e. C:\Users\YourUserNameHere\Documents, then having a default directory would be counter productive. If you must have one here is one with C:\

 

 

Untitled.jpg

0 Kudos
Message 24 of 38
(1,360 Views)

You will have to learn to use probes (or add indicators)to see the data flowing. You will also have to watch in light bulb mode to see things like "My stop button does not work!"

 

Compare this code to yours and see if you can spot the diffrences and explain to yourself "why".

 

WriteToFile.png

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 25 of 38
(1,351 Views)

@rr1024 wrote:

@altenbach wrote:

THe path control still does not contain any default data as requested.


No default path is require if you click the little path icon, you will recieve a browser window that you can browse to your own path. Because many people tend to enjoy using MS Default My Documents directory and it's path is variable by user, i.e. C:\Users\YourUserNameHere\Documents, then having a default directory would be counter productive. If you must have one here is one with C:\


That was a request for troubleshooting not a suggested general modification for the UI. Obviously something is different on your machine and we suspected that maybe the path as entered contains unusual characters or similar. What is your OS language? Maybe something is corrupted. Do you have a diffferent computer to try? Did you do an AV/malware scan?

 

In any case, here's all that should be needed on a regular computer. There should be no need to jump through flaming hoops with case structures and irrelevant path operations.

 

Note: If you want to append to an existing files, you might want to set the file position before the loop. Alternatively, you might want to clear the file. Currently it will overwrite from the beginning, which is probably not desirable. Modify as needed.

 

0 Kudos
Message 26 of 38
(1,351 Views)

@rr1024 wrote:

@altenbach wrote:

THe path control still does not contain any default data as requested.


No default path is require if you click the little path icon, you will recieve a browser window that you can browse to your own path. Because many people tend to enjoy using MS Default My Documents directory and it's path is variable by user, i.e. C:\Users\YourUserNameHere\Documents, then having a default directory would be counter productive. If you must have one here is one with C:\


You can be sure we know how to browse for a path. So there must be another reason we ask for the exact path in the control that you are using. That reason is because there is obviously something going wrong with your path, either syntax, strange whitespace, or something else. Your code additions are unnecessary. If they do fix the problem, then they must be altering the path somehow.

 

Add indicators like this, and check to see if the paths and/or strings differ from each other at all. Right-click the string indicator and select "/" display to look at the whitespace. Ideally, you will give us this code with the deafult value set to your used value (whether it's your local machine path or not, we can still see what's going on).

PathLessTraveled.PNG

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 27 of 38
(1,349 Views)

Thanks Ben, Yes I've been using those now. I think you told me about them earlier . The file handing is working fine now but the 

 

 

0 Kudos
Message 28 of 38
(1,348 Views)

Oh, that's a good idea James I'll use that in the future for sure

0 Kudos
Message 29 of 38
(1,345 Views)

@rr1024 wrote:

 


Parallel stopping can be tricky. Either use a parallel communication mechanism like a queue (in an advanced architecture, this is usually the way), or a simple local variable if you program is small enough.

With a local variable, make sure you set the stop boolean back to false after all loops have stopped.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 30 of 38
(1,343 Views)